S.G.T.B. - SuSE Git Kernel Tarball Creator - Version 1.86

http://paste.opensuse.org/view/download/18586147](http://www.imagebam.com/image/0ea82f162592259)

S.G.T.B. - SuSE Git Kernel Tarball Creator - Version 1.85 (works with openSUSE 12.2) creates a kernel tarball as one can download from kernel.org but for ANY past or recent kernel version ever released. SGTB now supports multiple GIT URL’s, which you select at startup.

This sgtb script will do the following:

  1. Install git if it is not installed
  2. Check for your Download folder and offer to create it if not there.
  3. Download the entire kernel source tree from github.com or kernel.org, as you select at startup.
  4. If, the source tree is present, update the tree today.
  5. Enter the kernel version you want to create as a tarball.
  6. Create the kernel source file tarball as you could download from kernel.org when it was up and running.
  7. Copy the tarball to your ~/Downloads folder for use by any kernel compile script, such as sakc.
  8. You can now get a list of included kernel versions to select from.
  9. You can now elect to change your Git URL without leaving the program.
  10. SGTB now creates a KDE Icon in your Desktop and in the KDE Applications menu.

The following values can/could/should/perhaps be edited by the user before using the script:

#******************************************************************************
# Where do you want your Kernel Tarballs copied to? Do not add a / at the End!
# *****************************************************************************

downloads=$HOME/Downloads


#******************************************************************************
# Where do you want your Git Source Folder Located? Do not add a / at the End!
#                 Git_Base_Folder=$HOME/Kernels" is the default
# *****************************************************************************

Git_Base_Folder="$HOME/Kernels"

# *****************************************************************************
#         From where are you downloading your kernel source files? 
#            see http://git.kernel.org/ for more git sources
# *****************************************************************************
urls=5

nam[1]="Torvalds Linix.git @ Kernel.org    "
url[1]="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"

nam[2]="Torvalds Linix.git @ GitHub.com    "
url[2]="https://github.com/torvalds/linux.git"

nam[3]="Linux-Stable.git @ Kernel.org      "
url[3]="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"

nam[4]="Torvalds Linix-2.6.git @ Kernel.org"
url[4]="git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git"

nam[5]="Target-Pending git/nab @ Kernel.org"
url[5]="git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git"

# *****************************************************************************
# sgtb can create a kde icon if you want. sgtb_icon_check=true creates an icon
# if not there for the KDE desktop. sgtb_icon_check=false does not create a  
# desktop icon. The KDE icon is located/named $HOME/Desktop/S.G.T.B..desktop.
# *****************************************************************************

sgtb_icon_check=true

# *****************************************************************************
# sgtb can create a kde menu icon if you want. sgtb_appl_check=true creates a 
# appl menu if not there. sgtb_appl_check=false does not create a appl menu
# icon. The sgtb_icon_check=true above must be set before an Application menu
# is create located/named as /usr/share/applications/S.G.T.B..desktop.
# *****************************************************************************

sgtb_appl_check=true

# ****************************************************************************
#                          KDE Desktop icon name 
# ****************************************************************************

kde_icon_name="S.G.T.B..desktop"

# ****************************************************************************
#     KDE Desktop icon Location/Name - Look for it in your desktop folder 
# ****************************************************************************

sgtbkdeicon="$HOME/Desktop/$kde_icon_name"

# ****************************************************************************
#   KDE Menu icon Location/Name - Look for it in your kde Applications menu 
# ****************************************************************************

sgtbkdeappicon="/usr/share/applications/$kde_icon_name"

# *****************************************************************************
#                 Do you want to see S.G.T.B. in color?  
#             The default is true, but can be set to false 
#           New Escape Sequences work without a Desktop loaded 
# *****************************************************************************

use_color=true


Copy and Paste the text of this script into a text editor and save it as the file sgtb in your home area bin folder (~/bin/sgtb). The script has become too large to be posted in a message here and is now included in SUSE Paste.

S.G.T.B. - SuSE Git Kernel Tarball Creator - Version 1.86

Open the above Link in a new Tab. Select the Download option in the top right and then select Open With Kwrite or other text editor and then save the bash script text file as ~/bin/sgtb. It is possible to directly download sgtb using the following terminal command (You must delete or rename the old version of sgtb first):

rm ~/bin/sgtb
wget -nc http://paste.opensuse.org/view/download/1617846 -O ~/bin/sgtb

The script file sgtb must be marked executable in order to use it. Open up a terminal session and run the following command:

chmod +x ~/bin/sgtb

It is even possible to string all three of these commands together as one. This is a Highly Recommended Way to get SGTB! Copy the following command, open up a terminal session, paste it in and press enter:

rm ~/bin/sgtb ; wget -nc http://paste.opensuse.org/view/download/1617846 -O ~/bin/sgtb ; chmod +x ~/bin/sgtb

To use the script, open up a terminal session and run the following command:

sgtb

Just as before, I would love to hear any comments on the use of this script that you might have.

Thank You,

Blogs: asroot : Bash : Packet Filter : C.F.U. : GPU’s : fewrup : F.S.M. : H.I. : nVIDIA : LNVHW : N.S.F. : S.A.K.C. : MMCHECK
S.A.S.I. : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E. : S.L.R.C. : S.T.A.R.T. : S.U.F.F. : SYSEdit : systemd : YaST Power

SGTB - SuSE Git Kernel Tarball Creator - Version 1.51 has been updated with new features which includes three built in GIT kernel source URL’s to select from and the ability to list the included kernel source files which are supported. If you have been using SGTB, you will want to download the latest version.

Thank You,

This script is really neat, but I found a couple of problems. The first showed up when I ran on an account that did not have the directory ~/Downloads present. It created an ordinary file and failed when it tried to move the tarball.

The second fault was in the step where the tarball produced by the “git archive” is unpacked into a new directory.

Both conditions are fixed by the patch file below:

Index: finger/sgtb
===================================================================
--- finger.orig/sgtb
+++ finger/sgtb
@@ -30,6 +30,7 @@ declare -a nam
 # Where do you want your Kernel Tarballs copied to? ***************************
 #
 downloads=$HOME"/"Downloads
+mkdir -p $downloads
 
 #
 # From where are you downloading your kernel source files?
@@ -264,7 +265,7 @@ while $cont ; do
          git archive "${sum$Selected_Kernel]}" | bzip2 > "linux-${ker$Selected_Kernel]}.tar.bz2"
          mkdir linux-${ker$Selected_Kernel]}
          cd linux-${ker$Selected_Kernel]} 
-         tar -vxjf "$Selected_Kernel/linux-${ker$Selected_Kernel]}.tar.bz2" > /dev/null
+         tar -vxjf "../linux-${ker$Selected_Kernel]}.tar.bz2" > /dev/null
          cd ..
          tar cjfv "linux-${ker$Selected_Kernel]}.tar.bz2" "linux-${ker$Selected_Kernel]}/" > /dev/null
          mv linux-${ker$Selected_Kernel]}.tar.bz2 $downloads

Larry, you can not imagine just how much I appreciate your comments here. I have updated the script above to version 1.53. I added a section that determines if the downloads folder exists and if not asks if you want to create it or exits if you do not. I then added on the other line with the tar command. I left the old one there as a comment and will determine what the change does in the future. Again, thanks so much for your help. :slight_smile:

Thank You,

I had to modify the bash script SGTB to handle the new kernel version 3.1-rc10. The newest -rcx was being downloaded, but not showing up as the most recent version you could create. I have modified the show-ref command to run through a sort using the command sort -V -k2 which seemed to fix the issue nicely. So, you need version SGTB 1.61 to get the new sort command added to your script.

Thank You,

SGTB - SuSE Git Kernel Tarball Creator - Version 1.75 has been updated to use COLOR and to display Major and RC’s kernel versions on a separate line. If you use SGTB, you really want to download version 1.75 And as always I want to hear you comments on using SGTB today.

Thank You,

Oh James why don’t you use git or any other DVCS?

l1zard I am not sure I understand the question. SGTB is using git to fetch the latest kernel files. If you mean using git for my script file versions, it has been suggested and might be something I do in the future. Since the number of scripts I have is not yet in the hundreds, its not been a problem to keep track. Further, each time I open up the script to be edited, it makes a dated backup copy. Not as good as git I am sure, but it has been good enough so far.

Thank You,

I would like to say that SGTB version 1.78 is finally working properly in every way I can see. It now properly brings in the latest kernel tags, allow you to create the very latest kernel versions. The only thing I am not yet doing is allowing the creation of kernel next, before it has a release candidate number or final release number. I am presently filtering out anything that is not designated a kernel tag release, but I am not sure what the next kernel version would be even called if it is after a tagged release, but not yet assigned a new tag? None the less, you can now keep with with the very latest releases. Linux-Stable.git @ Kernel.org is the one to watch for the latest final releases and latest release to be used on your PC with the sakc bash kernel compiler. As always your comments are greatly appreciated.

Thank You,

S.G.T.B. - SuSE Git Kernel Tarball Creator - Version 1.80 has been updated and allows you to select the Git Clone folder to a location other than your /home/yourname folder. Other changes have been made as well.

Thank You,

Today I have updated SGTB to version 1.81 to fix a minor problem in displaying the last RC version found in the main menu.

Thank You,

Is that a typo on line 45?
Git_Base_Folder=/$Home

shouldn’t it be?
Git_Base_Folder=$HOME

Almost forgot to say thank you for the script.

[QUOTE=tom_enos;bt529]Is that a typo on line 45?
Git_Base_Folder=/$Home

shouldn’t it be?
Git_Base_Folder=$HOME[/QUOTE]

So yes, a typo and should be Git_Base_Folder=$HOME as suggested in the comment, but oddly, the double slash seems to make no difference at all and it simply must be ignored I guess, but it is safe to remove it and thanks for pointing it out.

Thank You,

S.G.T.B. - SuSE Git Kernel Tarball Creator has been upgraded to Version 1.85 and now can create a KDE Desktop icon and Application menu icon for you. The color display engine now works even when no desktop is loaded. The folder creation option can now create a folder outside of your home area.

Thank You,

SGTB - SuSE Git Kernel Tarball Creator has been upgraded to Version 1.86 with three minor changes.

  1. Spell Linux correctly which had it wrong in two places
  2. Change the display of the sorted rc version to properly show the last rc in the main menu correctly
  3. Display the fact that the delay of the main menu being shown is while the kernel versions are being sorted.

As always, if you have a problem or suggestion, I would like to hear what it is.

Thank You,