Bug 63800 - support for Grub in reboot in <OS> functionallity
Summary: support for Grub in reboot in <OS> functionallity
Status: RESOLVED FIXED
Alias: None
Product: kdm
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdm bugs tracker
URL:
Keywords:
: 131913 177904 224630 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-06 14:52 UTC by Sander Devrieze
Modified: 2010-09-16 17:54 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
perl script (1.08 KB, text/plain)
2003-10-14 18:39 UTC, Gerald Teschl
Details
Patch: use grub-set-default (864 bytes, patch)
2006-07-07 22:48 UTC, Gert Menke
Details
Chapter from `info grub` (1.77 KB, text/plain)
2006-08-06 05:46 UTC, Heiko Baums
Details
Change KDM 4.1.2 to use the command grub-set-default (832 bytes, patch)
2008-10-19 12:31 UTC, wakatanka
Details
kdm grub-set-default _or_ patched grub (2.10 KB, patch)
2009-04-01 08:44 UTC, Rohan McGovern
Details
strace of the kdm process while shutting down and selecting "Windows 7" (22.79 KB, application/zip)
2010-06-19 11:46 UTC, Unknown
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sander Devrieze 2003-09-06 14:52:09 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

kdm (and kcmkdm) already support LILO for rebooting in another OS. It would be nice if this functionallity also works with Grub.
Comment 1 Gerald Teschl 2003-10-14 18:38:03 UTC
Seconded.

PS: The attached perl script can be saved as "/sbin/lilo" and it will
make grub look like lilo for kdm.
Comment 2 Gerald Teschl 2003-10-14 18:39:47 UTC
Created attachment 2775 [details]
perl script
Comment 3 Sander Devrieze 2004-06-27 18:33:53 UTC
Not yet in kde 3.2.2 AFAIK
Comment 4 Cyrille Berger 2005-01-12 10:00:12 UTC
*** Bug 79659 has been marked as a duplicate of this bug. ***
Comment 5 Oswald Buddenhagen 2005-01-23 23:54:03 UTC
implemented for kde 3.4.
Comment 6 storyteller 2005-09-28 04:23:18 UTC
 This bug is marked as fixed in kde-3.4, but it is not. I'm running kde-3.4.1 on archlinux which uses a fairly straightforward menu path /boot/grub/menu.lst.....And yet I cannot boot into XP from the restart menu in kde.
 If I attempt to select XP, it still boots archlinux normally.
Comment 7 Luke Sandell 2005-09-28 06:33:48 UTC
The problem is in kdebase/backend/kdm/bootman.c @ line 142:

if ((f = pOpen( (char **)args, 'w', &pid ))) {
                fprintf( f, "savedefault --default=%d --once\n",sdRec.osindex );
                pClose( f, pid );
}

AFAIK, GRUB has never supported the `savedefault' option in interactive mode, or any other method of rebooting into a specific OS. This functionality was apparently provided by a patch that never made it into the main GRUB source tree. The GRUB people aren't going to commit it now either, because they're too preoccupied with their precious GRUB2. So tough cookies, it's an unsupported feature - at least without horrible hacks involving automatically editing the menu.lst file.
Comment 8 Gert Menke 2006-07-07 22:48:09 UTC
Created attachment 16919 [details]
Patch: use grub-set-default

This patch fixes the problem for me. Instead of using the interactive grub
shell, it uses the grub-set-default program provided by recent versions of
grub.
(I use Gentoo Linux, kde-base/kdm-3.5.3-r2)
Comment 9 Oswald Buddenhagen 2006-08-05 10:53:23 UTC
reopening for obvious reasons
Comment 10 Oswald Buddenhagen 2006-08-05 10:54:15 UTC
*** Bug 131913 has been marked as a duplicate of this bug. ***
Comment 11 Ingo Krabbe 2006-08-05 15:21:55 UTC
So what is actually assumed to work here ?  Would someone please send me a resumee about what and how the kdm-grub pair should work together ? I would then be able to write a howto or some other documentation on what and how it goes and what we should be able to do in the future possibly.
Comment 12 Ingo Krabbe 2006-08-05 16:56:36 UTC
Actually the grub-set-default script does not seem to work here, I will query the grub developers now ...
Comment 13 Gert Menke 2006-08-05 17:20:18 UTC
> Actually the grub-set-default script does not seem to work here,
> I will query the grub developers now ...

Did you remember to put "default saved" in your grub.conf?
Does the number of the selected menu entry appear in /boot/grub/default ?
Comment 14 Heiko Baums 2006-08-06 05:46:58 UTC
Created attachment 17242 [details]
Chapter from `info grub`

This is the appropriate chapter of `info grub` where the behaviour and the
correct configuration of grub is explained. Maybe it helps. ;-)
Comment 15 Deathwing00 2006-11-05 02:55:55 UTC
Which is the current status of this issue?
Comment 16 Ingo Krabbe 2006-11-05 08:35:20 UTC
Last time I used it, it worked, but this feature could be better of course.  A test for the save-default feature would be helpfull too, since there is no hint, otherwhere but in grub documentation, which isn't read by the admin in action.

We should work a bit more on the integration to kde.
Comment 17 Deathwing00 2006-11-05 14:52:23 UTC
I mean that I'm a downstream maintainer and my users request this patch to be applied every time a new version of kdm is released. I'd like to ask for the patch to be fixed in SVN before the next release.
Comment 18 Chandra Sekar 2007-09-29 12:45:48 UTC
I'm using KDE 3.5.6 on Kubuntu Feisty Fawn.  Still not working.  This must definitely be made available.  This would allow ppl who almost alway use Linux to set very timeout value in grub.  When I need to use windows (1/999 times), I can use this feature to start windows without having to be alert at grub and select windows quickly.  ;-)
Comment 19 MattyDee 2007-11-16 05:20:24 UTC
KDE 3.5.7 on Slackware 12: 
Still not working
Comment 20 ndlarsen 2007-11-22 14:00:47 UTC
KDE 3.5.8, Arch Linux. Not working.
Comment 21 Thomas Bergheim 2008-03-06 09:09:27 UTC
KDE 3.5.9, Kubuntu. Not working.
Comment 22 Alan Braslau 2008-07-25 14:18:34 UTC
KDE 4.1.00 (KDE 4.0.99 (4.1 RC1+)) debian packages kdm 4:4.0.98-1
Works (reboots, selecting the requested grub option)
but... corrupts the grub image somehow, yielding
"Grub Error 28: Selected item can not fit into memory"
no matter what boot image is then requested, and this
even after powering-down the system!

Only re-installing grub from a rescue CD allows a reboot.
(debian bug #492317 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492317)
Comment 23 wakatanka 2008-10-19 12:31:21 UTC
Created attachment 28017 [details]
Change KDM 4.1.2 to use the command grub-set-default

The problem still exists with KDE 4.1.2. As already pointed out in comment #8 the recommended approach is to use the command grub-set-default, which KDM doesn't.
The attached patch changes KDM's backend/bootman.c to call the command.
Please note that grub.conf needs to be set up to use the saved default. Have a look at e.g. the already attached 'Chapter from info grub' for details.
Comment 24 Walter Mottinelli 2008-11-28 15:58:01 UTC
Same problem here with Gentoo, KDE 4.1.3 and grub 0.97.
"savedefault" is not a valid command in grub batch mode.
The proposed patch for backend/bootman.c by wakatanka worked for 4.1.3 too and solved the issue.
Comment 25 Rohan McGovern 2009-04-01 08:44:56 UTC
Created attachment 32513 [details]
kdm grub-set-default _or_ patched grub

The grub-set-default script and the method implemented by grub-0.97-once.patch are mutually exclusive, so the earlier patch breaks this function on systems which have grub-0.97-once.patch applied.

This alternative patch should work for users of both the patched and unpatched grub.  It determines at runtime which method should be used.
Comment 26 Anish Bhatt 2009-04-12 14:39:51 UTC
any chance we can see this in the next release ?
Comment 27 François Rey 2009-08-25 15:43:22 UTC
It's been reported 3 years ago,
several patches have been proposed,
285 votes...

...and it's still not fixed?
Comment 28 Maciej Mrozowski 2009-09-15 01:19:34 UTC
Related downstream bug:
http://bugs.gentoo.org/show_bug.cgi?id=242736
(with some proposed patch apparently fixing issue, at least for some Gentoo users)
Comment 29 FiNeX 2009-09-15 12:07:47 UTC
*** Bug 177904 has been marked as a duplicate of this bug. ***
Comment 30 Oswald Buddenhagen 2009-10-03 19:31:26 UTC
SVN commit 1030993 by ossi:

fix grub support

use the upstream grub-set-default command instead of relying on the
antiquated grub-once patch.

BUG: 63800

 M  +5 -9      bootman.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1030993
Comment 31 Nicolas L. 2010-02-05 15:51:55 UTC
There is a pb with this patch because some linux distributions like mandriva, fedora ( and maybe others ) don't have grub-set-default.
Comment 32 Oswald Buddenhagen 2010-02-21 09:42:41 UTC
*** Bug 224630 has been marked as a duplicate of this bug. ***
Comment 33 Oswald Buddenhagen 2010-02-21 12:00:22 UTC
SVN commit 1093648 by ossi:

support both grub-set-default and grub-once patch, after all

BUG: 63800

 M  +25 -6     bootman.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1093648
Comment 34 Unknown 2010-03-03 14:28:12 UTC
Thank you for the fix.

Please, backport it to the 4.4 branch, too.
Comment 35 H.H. 2010-05-05 21:00:20 UTC
for me it still does not work in kde-4.4.2, to which the fix was backported (see http://websvn.kde.org/?view=revision&revision=1102715), could someone please reopen or provide a solution?
Comment 36 Oswald Buddenhagen 2010-05-06 08:42:05 UTC
sure ... if you provide some useful information. ;)
i for one have no real idea how to debug it ... try looking into /var/log/kdm.log. you may also have luck with attaching "strace -ff -s 1000 -o kdm.trace" to the running main kdm process.
Comment 37 Unknown 2010-06-19 11:46:06 UTC
Created attachment 48135 [details]
strace of the kdm process while shutting down and selecting "Windows 7"

This bug also occurs in KDE 4.5 beta 2. Please, reopen.

I'll attach the output of the command "strace -ff -s 1000 -o kdm.trace -p `pidof kdm`".
In kdm.log I found nothing interesting.

Maybe the file kdm.trace.1834 is the most interesting for you.

My system:
- grub-0.97-162.2.x86_64
- Linux szotsaki 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100 x86_64 x86_64 x86_64 GNU/Linux
- openSUSE 11.2

If you need more debug information, let me know.
Comment 38 Oswald Buddenhagen 2010-07-31 22:33:13 UTC
the trace indicates that "/usr/sbin/grub-set-default 1" is executed, which is what it is supposed to do. i guess this is somehow incorrect. mind playing a bit with the command line and reporting what happens? i'd also need the menu.lst then.
Comment 39 Unknown 2010-08-06 00:45:29 UTC
After upgrading to openSUSE 11.3, the problem disappeared. So I also think the error was somewhere near the grub-set-default.
Thanks for the patience.
Comment 40 François Rey 2010-08-17 11:55:26 UTC
I don't think this bug is fixed, I still have it in 4.5, please reopen it!
KDE Platform Version: 4.5.00 (KDE 4.5.0)
Qt Version: 4.6.3
Operating System: Linux 2.6.34-ARCH x86_64
grub 0.97-17
Comment 41 Fabio 2010-09-16 17:54:04 UTC
I have this bug too.

Archlinux 64bit.