GRUB2/BURG Integration in KDE

No, you’re not having a déjà vu, this is my second post about GRUB2/BURG support for KDM which shows up in PlanetKDE. I am sorry to abuse the planet for publicity, but I have seen quite a bit of confusion as to how KDE should be configured in order to interface with GRUB2/BURG and I would like to get some things straight.

What follows is a step-by-step guide describing how to configure KDE in order to automatically select a GRUB2/BURG entry other than the default when rebooting:

Shutdown Dialog

If you are a GRUB2 user skip the BURG instructions and vice versa.

Step 1. Inform GRUB2/BURG that you plan to use this feature:

GRUB2 instructions:

Open /etc/default/grub in the text editor of your preference (as root) and add the following:

GRUB_DEFAULT=saved

In case a GRUB_DEFAULT option already exists, just set it to “saved”.

BURG instructions:

Edit /etc/default/burg instead. The variable name is the same (GRUB_DEFAULT).

Step 2. Update your GRUB2/BURG menu file:

GRUB2 instructions:

The menu configuration file must contain set default=”${saved_entry}”. You are highly discouraged to manually edit this file, so execute the following command (as root):

grub-mkconfig -o /boot/grub/grub.cfg

Please note that some distributions (i.e. Fedora, Gentoo, Mandriva, openSUSE) use a slightly different naming scheme for GRUB2. So you’d have to adjust the above to the following:

grub2-mkconfig -o /boot/grub2/grub.cfg

BURG instructions:

BURG users should execute the following command (as root):

burg-mkconfig -o /boot/burg/burg.cfg

Step 3. Inform KDE that you are using GRUB2/BURG:

GRUB2 instructions:

Select “Grub2″ as your bootloader under “System Settings > Login Screen > Shutdown > Boot manager”.

BURG instructions:

For KDE >= 4.8.0:

Select “Burg” as your bootloader under “System Settings > Login Screen > Shutdown > Boot manager”.

For KDE < 4.8.0:

Select “Grub2″ as your bootloader under “System Settings > Login Screen > Shutdown > Boot manager”.

Step 4. Create symlinks:

GRUB2 instructions:

This step only applies to Fedora/Gentoo/Mandriva/openSUSE (or any other distribution which uses /boot/grub2 instead of /boot/grub)! If this is not the case for you, skip it.

For KDE >= 4.8.3:

You don’t have to do anything! You may safely skip this step.

For KDE < 4.8.3:

Execute the following commands (as root):

mkdir /boot/grub
ln -s /boot/grub2/grub.cfg /boot/grub/grub.cfg
ln -s /sbin/grub2-reboot /sbin/grub-reboot

In the above commands replace /sbin/ with wherever the grub2-reboot binary is installed. You can easily determine this with “which grub2-reboot”.

BURG instructions:

For KDE >= 4.8.0:

You don’t have to do anything! You may safely skip this step.

For KDE < 4.8.0:

Execute the following commands (as root):

mkdir /boot/grub
ln -s /boot/burg/burg.cfg /boot/grub/grub.cfg
ln -s /sbin/burg-reboot /sbin/grub-reboot

Same rule as above applies here: if the burg-reboot binary is not located under /sbin/, locate it with “which burg-reboot”.

Step 5. Reboot!

That’s it, you’re done! Now either reboot or restart KDM (something like “/etc/init.d/kdm restart”) and you’re all set ;-)

As a side note, GRUB2 Editor (supports BURG) automatically adjusts your configuration to the above (i.e. it automatically performs steps 1 and 2).

Feel free to link to this post in linux forums as a reference. All of the above refer to KDE >= 4.7.

About these ads

15 thoughts on “GRUB2/BURG Integration in KDE

  1. First of all, thanks for the article.
    I unfortunately have a problem. After following these steps I do get the option to choose which system to reboot into in KDE and it does reboot, but once BURG loads up it doesn’t skip the selection screen, I still have to choose an entry.

    I’m using Arch Linux and BURG.

      • Thanks for your reply.
        I remember when I used Mandriva 2006 or openSUSE 10 or something like that, this worked out-of-the-box with KDE 3.* and when using this feature it completely skipped the grub selection screen. I was using grub(1) at the time.

        Is there a way to make burg do that?

        • Well, no, as far as I know. You would have to create a script that 1) sets the value of GRUB_TIMEOUT variable to 0 in /etc/default/burg (for instant boot) 2) regenerates the /boot/burg/burg.cfg menu file and 3) runs burg-reboot with the entry you want to reboot once. Then it would have to revert to the old value when booting back in your linux distro and re-regenerate your menu file. But that would be too much of a hassle.

          For my personal use with this feature I have set a very low GRUB_HIDDEN_TIMEOUT (3 seconds) and 0 GRUB_TIMEOUT. I can live with 2-3 seconds waiting.

          For a cleaner approach you should contact upstream (BURG – GRUB2 actually) and file a wishlist report.

  2. I spoke too soon. Everything works fine. The problem was that burg has two views and one of them hides all the fallback options. I had this one selected, but the restart dropdown in KDE shows all the options. I selected the last one which was saved into /boot/burg/burgenv as 3. The problem was that with the fallback options hidden there was no fourth option, there were only two.

    Thanks for your help.

  3. Pingback: Compile KDE from sources (currently 4.8.x) under (K)Ubuntu 12.04 | [Po]lentino's blog

  4. THANK YOU SO MUCH!

    I’ve had this setup on my laptop for quite some time now, but couldn’t for the life of me, remember how to do it or where I’d found to do it. I’ve wanted for ages to get this setup on my desktop.

  5. Pingback: A guided tour of my KDE 4.8.4 desktop (Part 1) « Fitzcarraldo's Blog

  6. Pingback: [kubuntu] grub2 integration in Kubuntu 12.10 / Lightdm | My Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s