
GRUB NextBoot
Source (link to git-repo or to original if based on someone elses unmodified work):
FEATURES
It allows you to reboot from KDE directly to another OS, such as Windows, by bypassing the normal GRUB boot menu.
It reads your menu entries directly from your GRUB configuration, so changes to your configuration are automatically included.
There are no hard-coded limits to how many menu entires it will allow.
It contains a string table, to allow for easy translation to your native language.
All file paths in the script are stored in variables, so they are easy to change if you have an unusual system (compared to SuSE).
The script can automatically reboot immediately or allow you to reboot manually later by the normal logout/shutdown methods.
When told to reboot immediately, it shuts down your session safely according to your KDE session management settings.
The script makes use of kdialog, so it will respect your look & feel preferences.
The script will auto-install an icon on your desktop.
The script will work on systems with either menu.lst or grub.conf menu files.
The script is well-documented (I hope), and contains installation instructions.
Send bug reports to my e-mail--I don't check this page often.
20040419 v1.0 Initial version
20040420 V1.1 Add features, more distribution agnostic
20040420 V1.1 Added $MENU_NOT_FOUND and $GRUB_NOT_FOUND strings
20040420 V1.1 Added routine to find grub menu file
20040420 V1.1 Added routine to find grub itself
20040420 V1.1 Added routine to find kde directories and applications
20040420 V1.1 Added $USE_HARDCODED_PATHS option to preserve ability to use on unusual systems
20040420 V1.1 Added $DO_NOT_INSTALL_ICON option so icon is only installed if it is not present & the user wants it
20040420 V1.1 Added $VERSION to facilitate testing
20040420 V1.1 Added $LANGUAGE_ENCODING to facilitate translations
20040420 V1.1 Added $BOOT_UNMOUNTED option for those whose /boot is normally unmounted.
20040421 V1.1.1 Fix Ayurvedi bug -- Menu parser too dumb to deal with minor differences in GRUB menu title entry formats.
20040421 V1.1.1 Make sure OS titles are at least 2 characters long
20040421 V1.1.1 Added $NO_MENU_ENTRY string.
20040425 v1.1.2 Apply fixes from BCJ (Thanks!) for Redhat/Fedora
20040425 v1.1.2 Added /sbin to grub exec search paths
20040425 v1.1.2 Added check if title line is commented out
20050220 v1.1.3 Set icon in OS selection dialog box
20050220 v1.1.3 Changed to work with nextboot in $PATH (_Must_ be in path now) tuxlover's bug - Thanks!
20050221 v1.1.4 Much smarter find_grub routine. Thanks deadbabylon!
20050222 v1.1.5 Much smarter menu parser.
Ratings & Comments
43 Comments
Hi, I find your program very interesting. But what I want is to have something similar to Mandriva. In Mandriva when you click on the shutdown button in the KDE menu and choose to reboot, it appears a list with the next operating system to reboot with. Is there any way to integrate this program with the normal KDE shutdown button?
Booting from inside a functioning Linux can help avoid the problem of large disks. It is called the 137-GB problem or 32-GB problem, but the essence is the same - BIOS cannot work with disks that have more than 2^16 cylinders. I have the 81.9 GB Maxtor 6Y080L0 disk which is arranged as 158816 cylinders, 16 heads and 63 sectors. Unfortunately, BIOS sees only those parttitons which start in the upper third of the disk. I have not yet tested the script.If it boots without resorting to disk BIOS functions, there is a chance that it will boot the partitions not accessible from BIOS. Best wishes BNK
Oh, okay... That's exactly what I wanted. Thank you.
Very nice concept... However, is there a way to run this thing from somewhere other than the desktop? I have a link on my panel, but every time I run it, it simply generates a link on my desktop. My desktop already has enough icons on it, and I would prefer not to have NextBoot there too. Is there a way around this?
Read documentation in the script. You are looking for: # Set to "TRUE" if you don't want an icon on your desktop, like if you already had one, but moved it to the panel or a custom menu $DO_NOT_INSTALL_ICON = undef; # "TRUE" | undef
Reports of a serious bug in nextboot were determined to be due to a misconfigured grub, not any problem in nextboot. Mark
While getting some input from the kde-devel list on nextboot version 1.1.4, Stephan Kulow, the KDE 3.4 Release Coordinator, posted an e-mail informing me that KDE 3.4 will have "native" GRUB support. Yeah! Provided this duplicates the functionality of nextboot 1.1.4, I will likely quit maintaining it. Anxiously awaiting KDE 3.4, Mark
What about trying to integrate this into KDM?
That would be great, with he new KDM !!!
great job! maybe you can get grub support in KDE? (eg the control center can only change lilo).
Please file a bug report, then vote for the bug. This should be integrated in kde; maybe I'll take a fresh look at the code (my C++ is better now than last year). Thanks. Mark
On Fedora Core grub is located in /sbin/ Otherwise nice app! :)
This is great! One thing that would be nice: Make the script independent of which path it is in. As long as it's in your $PATH, I think the icon should be created upon running it the first time, and then it should work. I put it in /usr/bin/nextboot, and (of course :) it didn't work, as it made the desktop shortcut with a wrong path. I tried fiddling with the bash script but couldn't get it to work right away (using something like: $nextboot_path = `which nextboot`), will play with it later again.
but I must have screwed up, as nothing happens. I ran the script, have the icon, the menu.lst file is already readable, what have I missed please?
What about the Gentooers and others that have /boot in a seperate partition that's mounted with noauto? It's not gonna work with me is it? :(
I have a /boot partition as well, and I'm running SuSE. The problem isn't the boot partition itself, but rather that gentoo keeps it unmounted by default. I wrote the script to make workarounds for this easy. You have two options. 1) keep /boot mounted all the time, OR 2) Copy your menu.lst or grub.conf file (as appropriate in your case) to a location that _is_ mounted all the time. Then tell the script where to find it (read the comments in the script). This will work fine, and shouldn't be too bad, as long as you aren't constantly changing your boot menu _titles and respective indexes_. The most important info for the script are the index numbers [0...n]. For any menu entry, you may change anything you like (kernels, locations, kernel options, etc.) without having to update the readable copy of your menu file, unless you change the menu title (not a fatal problem) and it's index (order in the menu file)(fatal problem). Regards, Mark
Or you could just mount the boot partition readonly, and when you need to edit it, remount using "mount -o remount,rw /boot" ... Unless of course this program needs write access ...
This tool/options has to be integrated in kdm. Control Center --> Login Manager --> Shutdown --> Show grub boot options This nice feature has been added there for lilo, would be coll if the grub option where on the same place. phob
Now it works without problems! Tx Marktaff!!!
I haven't tried this program yet, but I'd like to ask just if the reboot menu for Grub is already integrated into KDE reboot menu, if your program is installed with root priviledges.... if not, I think it could be a good idea.
This option is not already available in KDM, hence the need for this. It is not installed as root, but as a normal user. That said, the GRUB commands themselves that are executed require root permissions, so KDESU will prompt you for the password at the right time. Also, you need to make your GRUB menu file readable by a normal user. Mark
:) :) :)
v1.1.1 should fix your problem. I tested it with the menu file you posted. Happy rebooting :-)
This is my grub.conf: default 0 timeout 8 #splashimage=(hd0,6)/boot/grub/splash.xpm.gz splashimage=(hd0,6)/boot/grub/handy_gabryhack.xpm.gz title=Linux 2.6.5-gentoo root (hd0,0) kernel (hd0,6)/boot/kernel-2.6.5-gentoo root=/dev/ram0 init=/linuxrc real_root=/dev/hda8 video=vesa:ywrap,mtrr vga=794 splash=silent hdc=ide-scsi hdd=ide-scsi initrd (hd0,6)/boot/initrd-2.6.5-gentoo title=Linux 2.4.23 Win4Lin root (hd0,0) kernel (hd0,6)/boot/kernel-2.4.23-win4lin root=/dev/ram0 init=/linuxrc real_root=/dev/hda8 vga=794 splash=silent hdc=ide-scsi hdd=ide-scsi initrd (hd0,6)/boot/initrd-2.4.23-win4lin title=Windows XP root (hd0,0) chainloader (hd0,0)+1
I see what may be the problem (in my script), but it is time to go to bed. I will fix it for you tommorrow. Mark