S.A.K.R. - SUSE Automated Kernel Remover - Version 1.0.5

I have finally written a bash utility I call S.A.K.R. for SUSE Automated Kernel Remover, to allow the removal of kernel files compiled and installed by S.A.K.C. which is SUSE Automated Kernel Compiler. If you are not using S.A.K.C then you will not be needing S.A.K.R. To find out more about S.A.K.C., you can use the following link to its blog: S.A.K.C. - SUSE Automated Kernel Compiler .

For those that don’t know, S.A.K.C. is a kernel compiler that compiles and installs kernels outside of YaST. That has then meant you must manually remove them once they are no longer required. But now, the removal process is also automated for you. Using S.A.K.R., you can remove unneeded kernels one at a time. You can not remove a kernel compiled by S.A.K.C. which you are still running and you can not remove a kernel which was installed by YaST. Always use YaST to remove kernels installed by YaST. I have added an option to S.A.K.R. that asks if you want to remove another kernel when you have completed removing the first one you have selected.

S.A.K.R. now creates a KDE icon if you are found to be using the KDE Desktop. Look on your Desktop (for Folder View) or in the Desktop Folder, if placed on the Desktop (as done by the openSUSE KDE installation default). S.A.K.R. also creates a KDE system icon, so look for it in the Applications menu. Root user authority will be requested to add this icon in for you.

In order to start using the new compiled kernel remover, just Copy and Paste the text of this script into a text editor and save it as the file sakr in your home area bin folder (~/bin/sakr). The script is too large to be posted in a message here and is included in SUSE Paste.

S.A.K.R. - SUSE Automated Kernel Remover - Version 1.0.5

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/sakr. It is possible to directly download sakr using the following terminal command (You must delete or remove the old version first):

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

This script must be marked executable to be used. Please run the following Terminal command:

chmod +x ~/bin/sakr

It is even possible to string all three of these commands together as one which is Highly Recommended for you to use! Copy the following command, open up a terminal session, paste it in and press enter:

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

To use sakr, open up a terminal session and type in the command:

sakr

S.A.K.R. has a few settings you can modify at the top of the script should you wish to change the default operation of S.A.K.R. so please take a look:

#
# Make Sure the Following Folder/File names are correct and exist!!!
#

compile_folder=$HOME/Kernel

# *****************************************************************************
# sakr can create a kde icon if you want. sakr_icon_check=true creates an icon
# if not there for the KDE desktop. sakr_icon_check=false does not create a  
# desktop icon. The KDE icon is located/named $HOME/Desktop/S.A.K.R..desktop.
# *****************************************************************************

sakr_icon_check=true

# *****************************************************************************
# sakr can create a kde menu icon if you want. sakr_appl_check=true creates a 
# appl menu if not there. sakr_appl_check=false does not create a appl menu
# icon. The sakr_icon_check=true above must be set before an Application menu
# is create located/named as /usr/share/applications/S.A.K.R..desktop.
# *****************************************************************************

sakr_appl_check=true

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

kde_icon_name="S.A.K.R..desktop"

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

sakrkdeicon="$HOME/Desktop/$kde_icon_name"

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

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


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

use_color=true

As always, if you have any comments about using S.A.K.R., please let me know what they are.

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

I am always in such a hurry to release my scripts, that a few things seem to slip through. So, just one day later, S.A.K.R is up to 1.0.1 with a few minor changes. If you use KDE, you can now get a KDE desktop icon. There was an error spawning the bootmanager in openSUSE 12.2 now fixed and verbage for Grub 2 has been added. I failed to modify the GPL statements to reflect the new program in which it resides. I had left out the script color statement used to turn off color if you wish. And, there may be other minor changes I forgot to remember I did. As always, your comments are very welcome.

Thank You,

Another night and a few more fixes to sakr. Basically I found one bug which caused sakr to say the compile folder for kernel 3.5 was not there because the compiled kernel was called 3.5.0 so I fixed that problem. But, once you start working on the code, you just can’t stop making it “better”. I did add more comments, which is good. I shorten some text, reduced some duplication and it general tried to find any other issues. This bash script has been the hardest to (want to) create because I could do it manually just fine and due to the issues in kernel text and version numbers I knew must be dealt with. Even as it was hard to get started on this bash script, its been more than a year since I decided it was needed, once started, I just don’t want to stop working on it. So, hopefully, it is working for you and if not, you are letting me know so.

Thank You,

S.A.K.R. - SUSE Automated Kernel Remover has been updated to Version 1.0.3 and now creates a KDE Application system icon for you and it will allow you to cycle through removing more than one kernel instead for the need to restart S.A.K.R. for each one.

Thank You,

S.A.K.R. - SUSE Automated Kernel Remover has been upgraded to Version 1.0.4 with two minor fixes. First, now the ability for SAKR to start over and remove a second or more kernels in a row works. Next, if you are found to be using Grub 2, you no longer need to run YaST as the Grub 2 menu update is now used instead.

Thank You,

S.A.K.R. - SUSE Automated Kernel Remover has been updated to Version 1.0.5 with a minor fix that kept it from removing kernels 3.10.0 or higher due to an error in thinking the second number would not go over 9, but here we are with 10.

Thank You,