Posts tagged Kernel Switcher
A little matter I would like to bring to your attention is our wiki page for Virtualbox can produce a small surprise. The scenario is that you download Sabayon 8 version, install it and than decide to install Virtualbox and Virtualbox pulls a lot of stuff including a new kernel of 3.3. Sabayon 8 iso comes with kernel 3.2 so when you go and install Virtualbox you are indirectly invoking a kernel upgrade. So the question is how to install Virtualbox.
Well, here is what I would do. We keep our packages updated so we might as well upgrade the kernel also, but instead I would do it in a bit of different order of just doing equo install virtualbox-bin, I’d start with kernel-switcher.
We can use equo search linux-sabayon to see what the latest kernel is. And in my case it shows sys-kernel/linux-sabayon-3.3-r2 is the latest kernel. To see what your current kernel version is, simply run uname -r.
So now we can upgrade the kernel with:
kernel-switcher switch sys-kernel/linux-sabayon-3.3-r2
This will than upgrade the kernel and all the needed modules and add the entry to your grub. Now at this point and time I would reboot and boot into the new kernel. Once rebooted I would than:
equo install virtualbox-bin
The modules should pull, but if not:
equo install virtualbox-modules#`uname -r`
usermod -a -G vboxusers YOUR_USER_NAME
Now go ahead and log out and than log back in so the changes can be applied.
To get virtualbox modules to load automatically:
# nano /etc/conf.d/modules
add to it:
modules="vboxdrv vboxnetflt vboxnetadp"
then save and exit, reboot.
Once you have Virtualbox installed you won’t have to worry about pulling kernels, it’s just that initial install and if there is a new kernel available scenario. If one had downloaded and install Sabayon 8 and installed Virtualbox before kernel 3.3 came out, one would never of had to fuss with a different kernel.
The only thing we are really doing that the wiki doesn’t cover is switching the kernel first. Why do I recommend using kernel-switcher vs just installing it all with equo install virtualbox-bin? The main thing is, you’re changing kernels so I want to keep that process simple and smooth vs pulling it and doing a bunch of updates along side it. In theory both methods should work, I just want to take the extra step and make sure it goes right.
I use to think updating the kernel in Sabayon Linux was always a pain till I decided to change the kernel on my Ubuntu box. I was having issues of system freezing up and others were reporting an upgrade to .36 kernel fixed it for them. Well I thought instead of only going to .36, I would get .38 kernel instead. I soon ran into an issue that .38 was not available via the package manager. So after doing some googling and reading various things. I discovered that people are installing newer kernels via several methods. Some of these methods included very long walk throughs, some included running scripts and some involved doing it the old fashioned manual way. I sat there thinking to myself wow, this is crazy. I eventually ran across a site that had the .38 deb kernel and headers for download and I used dpkg -i to install them. I’m a bit of an Ubuntu noob, but I could see where this would frustrate a lot of users. I started to think how great Sabayon’s tool kernel-switcher is. There is no reason to complain about how easy it is to upgrade to the latest kernel in Sabayon.
Remember, doing regular upgrades will not pull the new kernel. You need to invoke a kernel change. We do this to prevent users from breaking their system and than screaming at us on the forums or in irc. A new tool recently introduced into main line entropy called kernel-switcher will make your life easier for this job.
# kernel-switcher –help for options
So you want to upgrade to 2.6.38, simply issue:
# kernel-switcher switch linux-sabayon-2.6.38
and you will get something like this:
# kernel-switcher switch linux-sabayon-2.6.38
>> @@ Calculating dependencies …
>> ## [U] [sabayonlinux.org] sys-kernel/linux-firmwares-2.6.38|0 [2.6.37|0]
>> ## [N] [sabayonlinux.org] sys-kernel/linux-sabayon-2.6.38|0
>> ## [N] [sabayonlinux.org] net-wireless/broadcom-sta-22.214.171.124-r1#2.6.38-sabayon|0
>> ## [N] [sabayonlinux.org] x11-drivers/nvidia-drivers-260.19.29#2.6.38-sabayon|0
Your mileage will vary pending on the modules/drivers you have installed. After install, the grub2 gets updated. Some users are reporting their graphics stuff aren’t working as well afterwards. You need to make sure your using the proper driver and to do this:
# eselect opengl list
Available OpenGL implementations:
 nvidia *
Notice my * is set to nvidia, if it’s not where it’s suppose to be, use the eselect opengl set # replace # with the number next to your driver and it will set the system up to use it. Restart X and you should have all your eye-candy working well. You can also check and make sure kernel is selected with eselect kernel list.
# eselect kernel list
Available kernel symlink targets:
 linux-2.6.38-sabayon *
Looking good as it’s set to .38. If not, eselect kernel set # in the same manner as setting opengl. Best thing, before reboot, check those two commands out and make sure they are set properly and than reboot to your new kernel.
Another quick thing, Sabayon has migrated to GCC-4.5.2. So upon install it’s good thing to check and make sure it’s set.
# gcc-config -l
 x86_64-pc-linux-gnu-4.4.5 *
So after install, my gcc is still at 4.4.5, time to switch it:
# gcc-config x86_64-pc-linux-gnu-4.5.2
and than we get
* Switching native-compiler to x86_64-pc-linux-gnu-4.5.2 …>>> Regenerating /etc/ld.so.cache… [ ok ]
* If you intend to use the gcc from the new profile in an already * running shell, please remember to do:
* # source /etc/profile
So we run the command source /etc/profile and check again:
# gcc-config -l
 x86_64-pc-linux-gnu-4.5.2 *
Perfect, and what great tools to make it all so simple. After big updates I always like to run equo deptest and equo libtest to make sure things are sane. I guess using Sabayon can kinda make ya lazy, but at same time, you realize and appreciate how much time it can save you and makes your computing easier. It’s not a perfect operating system, but #1 in my book.
Finally, a break through in kernel upgrades! Fabio has committed a beta script for everyone to try out. Some of yas maybe sitting there going cool, but how do I make this wonderful feature work. Let’s do this real quick:
- As user, you need to copy and paste the contents from git to a new file in your home directory. So I simply fire up terminal and type in nano kernel-switcher and than paste the contents from git to it, ctrl x to close and Y to save it. Now in my home directory is a file called kernel-switcher.
- Now we need to give it permission to execute, so as user chmod +x kernel-switcher
- You are now ready to switch to root to run the script. It don’t really matter if you are user or root to create the script, but you must be root to run the script.
- Check to make sure it works. I will assume we are in the same working directory here so:
- SL64Gnome ~ # ./kernel-switcher help
- You can run ./kernel-switcher list and get a list of the kernels available, I found this to be a bit much and may confuse some as to what kernel to select. So you can also just use the simple command equo search linux-sabayon to pull less kernels and the kernel you will need. Use uname -r to find your kernel version. So if that returns 2.6.36-sabayon and you see @@ Package: sys-kernel/linux-sabayon-2.6.37 is available, we can simply update to that kernel.
- You just run ./kernel-switcher switch linux-sabayon-2.6.37 and that command will tell equo to download the new kernel, download the modules/drivers you need for that kernel, and than update your grub2 so your new entry is there. I would double check before rebooting and make sure your eselect kernel list has the * next to new kernel and eselect opengl list has the * next to your video.
This is beta yet and if you have any ideas to implement, feel free to drop us a line. This is going to make our rolling release better. We will keep you posted of future changes of course.
Another thing to touch on here. Since I don’t experience this, I’m out of the loop on it. Apparently the GMD/KDM/LXDM only support the American keyboard layout. So this thread on the forum is for you. It’s now been integrated into the keyboard-configuration-helpers package. How that works, I have no idea as I use American keyboard layout. Questions and support can be asked on the forum.
Hope everyone is enjoying the release of Sabayon 5.5, first time we ever beat our deadline! Cheers!