Proper Usage for Git & Present Kernel Source File Locations

So I am having a strange issue in using the git command to fetch the most up to date kernel version. Specifically, when the kernel jumps from one release candidate to another, I am not picking that up using git pull from a bash script. For example I use the following.

  1. Run the terminal command from User Home: git clone https://github.com/torvalds/linux.git
  2. Present Kernel Source Files are downloaded to the folder ~/linux
  3. Change to folder ~/linux and run the command: **git pull https://github.com/torvalds/linux.git
    **
    The git pull command does not seem to advance to kernel-3.1-rc8 from kernel-3.1rc7 and I wonder if the difference might be a released rc# as opposed to the next release being worked on, but its got me confused. When I seem to be stuck as say kernel-3.1-rc6, I removed the entire source folder and ran the commands and then I got kernel-3.1-rc7. Tonight, I was stuck on one PC at kernel-3.1-rc7 even as another I started over came up with kernel-3.1-rc8. So, I actually switched to the ~/linux folder and ran **git pull **with no location and it fetched rc8. But I am unable to repeat that feat, but just get an error message. I basically don’t understand what goes on when we advance to the next release candidate and how to get it without removing it all and starting over. I am running git show-ref from the ~/linux folder to determine the kernel versions I have in my source folders. Here is an example of how I am using it all:

SGTB - SuSE Git Kernel Tarball Creator - Version 1.25 - Blogs - openSUSE Forums

As always, all comments and suggestions are appreciated.

Thank You,

Hi James,

Humm . . . I don’t seem to be seeing the same behavior. My git kernel source was at v3.1-rc6, from which I did a git pull and it grabbed both new tags:


$git pull
remote: Counting objects: 2835, done.
remote: Compressing objects: 100% (588/588), done.
remote: Total 1761 (delta 1386), reused 1523 (delta 1168)
Receiving objects: 100% (1761/1761), 748.90 KiB | 305 KiB/s, done.
Resolving deltas: 100% (1386/1386), completed with 404 local objects.
From https://github.com/torvalds/linux
   279b1e0..d5767c5  master     -> origin/master
From https://github.com/torvalds/linux
 * [new tag]         v3.1-rc7   -> v3.1-rc7
 * [new tag]         v3.1-rc8   -> v3.1-rc8

What exactly happened when you did a git pull from your 3.1-rc7? You mentioned there was an error message - did git give and exit status? Also did you try running a git pull just manually (not with with the script)?

Pete

Well basically it just seems stuck at rc7. Since I started afresh on another PC, I saw it came up with rc8. So, I am not sure what has to be done to get to rc8. Now consider that doing it manually may work while attempting to automate it might not. I am just not really sure. It is starting to get late here tonight, but I do wish to continue looking at this on Thursday and thanks so much for your input on this problem LewsTherinTelemon.

Thank You,

So there does not seem to be many comments here. Is that due to no one having an answer or understanding the problem or is this a case where if you have to ask, you should not be trying to fix the problem? Humm… Well, here is the most recent sequence in attempt to get git to work automatically.

We assume the git linux source folder and files already exists.

cd ~/linux
git checkout remotes/origin/HEAD
git pull https://github.com/torvalds/linux.git
git pull 

Is there anything more that is needed. Anything here not needed. Any comments? Is it raining in Spain right now? Anything relevant would be helpful.

Thank You,

Hi
But is the git repo at HEAD? Look at the output from git pull and
ensure is has switched back to HEAD.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 4 days 13:45, 3 users, load average: 0.32, 0.16, 0.15
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

Hi
But is the git repo at HEAD? Look at the output from git pull and
ensure is has switched back to HEAD.

And what would be the correct git command to switch back to HEAD if required?

Thank You,

Hi
I would use the tag reference, eg;


git show-ref

git show-ref |tail -1
e7f2a88548df497544d4fafca79836bbd8b6342e refs/tags/v3.1-rc8

git show-ref |tail -1 |cut -f1 -d " "
e7f2a88548df497544d4fafca79836bbd8b6342e

git checkout e7f2a88548df497544d4fafca79836bbd8b6342e

Previous HEAD position was 47ea91b... Resource: fix wrong resource
window calculation
HEAD is now at a102a9e... Linux 3.1-rc8


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 5 days 2:28, 3 users, load average: 0.05, 0.14, 0.14
GPU GeForce 8600 GTS Silent - Driver Version: 280.13

So its possible my present source folder has a problem and should be removed, but when I run through your commands, all which match yours until the last one where here is what I get:

james@Linux-Master:~/linux> git checkout e7f2a88548df497544d4fafca79836bbd8b6342e
error: Your local changes to the following files would be overwritten by checkout:
        Documentation/networking/scaling.txt
        arch/powerpc/platforms/powermac/pci.c
        arch/s390/include/asm/elf.h
        arch/s390/mm/pgtable.c
        arch/sparc/include/asm/spitfire.h
        arch/sparc/include/asm/xor_64.h
        arch/sparc/kernel/cpu.c
        arch/sparc/kernel/cpumap.c
        arch/sparc/kernel/head_64.S
        arch/sparc/kernel/process_32.c
        arch/sparc/kernel/process_64.c
        arch/sparc/kernel/setup_32.c
        arch/sparc/kernel/setup_64.c
        arch/sparc/mm/init_64.c
        block/blk-core.c
        block/blk-sysfs.c
        drivers/gpu/drm/i915/i915_drv.c
        drivers/gpu/drm/i915/intel_display.c
        drivers/gpu/drm/i915/intel_drv.h
        drivers/gpu/drm/i915/intel_sdvo.c
        drivers/infiniband/hw/cxgb3/iwch_cm.c
        drivers/media/video/omap/omap_vout.c
        drivers/media/video/omap3isp/ispccdc.c
        drivers/media/video/uvc/uvc_driver.c
        drivers/media/video/uvc/uvc_entity.c
        drivers/media/video/uvc/uvc_video.c
        drivers/media/video/uvc/uvcvideo.h
        drivers/media/video/v4l2-dev.c
        drivers/media/video/v4l2-device.c
        drivers/net/bnx2x/bnx2x_dcb.c
        drivers/net/bnx2x/bnx2x_main.c
        drivers/net/bnx2x/bnx2x_reg.h
        drivers/net/cxgb3/cxgb3_offload.c
        drivers/net/cxgb3/l2t.c
        drivers/net/cxgb3/l2t.h
        drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
        drivers/net/wireless/ath/ath9k/recv.c
        drivers/net/wireless/iwlegacy/iwl-core.c
        drivers/net/wireless/iwlegacy/iwl-hcmd.c
        drivers/net/wireless/iwlegacy/iwl-tx.c
        drivers/net/wireless/iwlegacy/iwl3945-base.c
        drivers/net/wireless/iwlegacy/iwl4965-base.c
        drivers/net/wireless/iwlwifi/iwl-scan.c
        drivers/net/wireless/rtlwifi/usb.c
        drivers/s390/cio/cio.c
        drivers/scsi/3w-9xxx.c
        drivers/scsi/Makefile
        drivers/scsi/aacraid/commsup.c
        drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
        drivers/scsi/libsas/sas_expander.c
        include/trace/events/writeback.h
        init/main.c
        kernel/resource.c
        net/batman-adv/soft-interface.c
        net/ceph/ceph_common.c
        net/ceph/messenger.c
        net/ceph/osd_client.c
        net/ceph/osdmap.c
        net/ipv6/ip6mr.c
        net/ipv6/route.c
        net/wireless/nl80211.c
        net/xfrm/xfrm_policy.c
Please, commit your changes or stash them before you can switch branches.
Aborting

I did look to see that e7f2a88548df497544d4fafca79836bbd8b6342e does match yours and used mine next just to make sure. But the final command seems to always fail.

Thank You,

For anyone interested, I have updated my SGTB (SuSE Git Kernel Tarball Creator) to version 1.50 and you can download kernel source files from kernel.org or GitHub.com and the kernel stable tree has also been added. Check out my blog on this bash script here:](http://forums.opensuse.org/blogs/jdmcdaniel3/sgtb-suse-git-kernel-tarball-creator-version-1-31-53/Thank)SGTB - SuSE Git Kernel Tarball Creator - Version 1.50

Thank You,

My latest SGTB script has been fully tested with openSUSE 12.1 and works like a champ. The problem I discuss here in this thread has been fixed.

SGTB - SuSE Git Kernel Tarball Creator - Version 1.78 - Blogs - openSUSE Forums

And the resulting Kernel Tarball works great with this:

S.A.K.C. - SUSE Automated Kernel Compiler - Version 2.50 - Blogs - openSUSE Forums

Thank You,