diff options
author | Ioannis Aslanidis <deathwing00@gentoo.org> | 2006-08-30 16:09:49 +0000 |
---|---|---|
committer | Ioannis Aslanidis <deathwing00@gentoo.org> | 2006-08-30 16:09:49 +0000 |
commit | d63ffd4834a229213d9b46e51487ce52221e1bf7 (patch) | |
tree | a3e8d43cb21e457d25e54fbd730f1c11bf738231 /kde-base/kdm/files | |
parent | Added patch against name-collision for function trunc, see bug #140866. (diff) | |
download | gentoo-2-d63ffd4834a229213d9b46e51487ce52221e1bf7.tar.gz gentoo-2-d63ffd4834a229213d9b46e51487ce52221e1bf7.tar.bz2 gentoo-2-d63ffd4834a229213d9b46e51487ce52221e1bf7.zip |
Added a new patch that parses the grub configuration file correctly and allows to reboot into the kernel or operating system of choice using the grub-set-default feature. Fixes bug #139603.
(Portage version: 2.1-r2)
Diffstat (limited to 'kde-base/kdm/files')
-rw-r--r-- | kde-base/kdm/files/digest-kdm-3.5.4-r1 | 6 | ||||
-rw-r--r-- | kde-base/kdm/files/kdm-3.5.4-grub-patch.diff | 64 |
2 files changed, 70 insertions, 0 deletions
diff --git a/kde-base/kdm/files/digest-kdm-3.5.4-r1 b/kde-base/kdm/files/digest-kdm-3.5.4-r1 new file mode 100644 index 000000000000..d7974a138105 --- /dev/null +++ b/kde-base/kdm/files/digest-kdm-3.5.4-r1 @@ -0,0 +1,6 @@ +MD5 71b9ee636bc39514d3d445b7034b7aa7 kdebase-3.5-patchset-02.tar.bz2 7118 +RMD160 ea3c7215e68754e8acac03e9fafea8aa9c6d1202 kdebase-3.5-patchset-02.tar.bz2 7118 +SHA256 459e2ce09a7151fd5f52bf77570dccd2447f00a604dab65adf7dfb5da431ac1b kdebase-3.5-patchset-02.tar.bz2 7118 +MD5 882a9729c08b197caef2c8712c980d9c kdebase-3.5.4.tar.bz2 23636847 +RMD160 29f763ec9de2cf3437b94567b317642e7df5e295 kdebase-3.5.4.tar.bz2 23636847 +SHA256 71e3b45d91f2237ca5a66858b06e897e1f60e3042d4c54d828ba590daaa5b420 kdebase-3.5.4.tar.bz2 23636847 diff --git a/kde-base/kdm/files/kdm-3.5.4-grub-patch.diff b/kde-base/kdm/files/kdm-3.5.4-grub-patch.diff new file mode 100644 index 000000000000..6fd004931d4a --- /dev/null +++ b/kde-base/kdm/files/kdm-3.5.4-grub-patch.diff @@ -0,0 +1,64 @@ +diff -U 4 -H -b -w -B -E -d -i -r kdm-3.5.4-orig/kdm/backend/bootman.c kdm-3.5.4/kdm/backend/bootman.c +--- kdm-3.5.4-orig/kdm/backend/bootman.c 2006-08-30 17:41:12.000000000 +0200 ++++ kdm-3.5.4/kdm/backend/bootman.c 2006-08-30 17:50:20.000000000 +0200 +@@ -77,28 +77,30 @@ + static int + getGrub( char ***opts, int *def, int *cur ) + { + FILE *f; +- char *ptr; ++ char *ptr, *linp; + int len; + char line[1000]; + +- if (!grub && !(grub = locate( "grub" ))) ++ if (!grub && !(grub = locate( "grub-set-default" ))) + return BO_NOMAN; + + *def = 0; + *cur = -1; + *opts = initStrArr( 0 ); + + if (!(f = fopen( GRUB_MENU, "r" ))) + return errno == ENOENT ? BO_NOMAN : BO_IO; +- while ((len = fGets( line, sizeof(line), f )) != -1) +- if ((ptr = match( line, &len, "default", 7 ))) ++ while ((len = fGets( line, sizeof(line), f )) != -1) { ++ for (linp = line; isspace(*linp); linp++, len--); ++ if ((ptr = match( linp, &len, "default", 7 ))) + *def = atoi( ptr ); +- else if ((ptr = match( line, &len, "title", 5 ))) { ++ else if ((ptr = match( linp, &len, "title", 5 ))) { + for (; isspace( ptr[len - 1] ); len--); + *opts = addStrArr( *opts, ptr, len ); + } ++ } + fclose( f ); + + return BO_OK; + } +@@ -129,21 +131,16 @@ + + static void + commitGrub( void ) + { +- FILE *f; +- int pid; +- static const char *args[] = { 0, "--batch", "--no-floppy", 0 }; ++ char command[256]; + + if (sdRec.bmstamp != mTime( GRUB_MENU ) && + setGrub( sdRec.osname, &sdRec ) != BO_OK) + return; + +- args[0] = grub; +- if ((f = pOpen( (char **)args, 'w', &pid ))) { +- fprintf( f, "savedefault --default=%d --once\n", sdRec.osindex ); +- pClose( f, pid ); +- } ++ sprintf(command, "%s %d", grub, sdRec.osindex); ++ system(command); + } + + static char *lilo; + |