Hi,

        When upgraded to kernel-2.4.2-20mdk, I found some problems with
/boot/initrd.img symlink and with /boot/grub/menu.lst ...... this is
mainly because I used a separate /boot partition. (This setup isn't
uncommon, right?)

1) In menu.lst, I found the added entry is as follows:

        title 242-20
        kernel (hd0,4)/boot/vmlinuz-2.4.2-20mdk root=/dev/hda6
        initrd /boot/initrd-2.4.2-20mdk.img

It can be seen that I use /dev/hda6 for / and /dev/hda5 for /boot.
However /boot is not stripped from kernel entry, and no (hdx,y) entry is
added to initrd entry, causing me to reboot so many times to discover this
:(

2) /boot/initrd.img is a symlink to /boot/initrd-2.4.2-20mdk.img (note
the absolute path), so that grub cannot find such thing as
"/boot/blah.img" under /boot. That's equivalent to searching for
/boot/boot/blah.img ???


Attached two patches, the first one strips "/boot" from menu.lst if
"/boot" is found under /etc/fstab ; the second one fixes symlink. So far
I can test under grub (didn't install lilo), so can anybody verify if
there's similar problem with lilo?

--- grub.bak    Tue Mar 27 05:13:53 2001
+++ grub        Tue Mar 27 16:07:53 2001
@@ -39,6 +39,7 @@
 
 my $cnt = 0;
 my $grub_partition;
+my $use_boot_partition = 0;
 
 # we keep entry as hash for future use.
 my (%main, %entry);
@@ -119,10 +120,10 @@
        print "\n";
        print << "EOF";
 title $glabel
-kernel $grub_partition/boot/vmlinuz-$version root=$root_device
 EOF
+       print "kernel $grub_partition" . ($use_boot_partition ? "" : "/boot") . 
+"/vmlinuz-$version root=$root_device\n";
 if ( -f "/boot/initrd-$version.img" ) {
-    print "initrd /boot/initrd-$version.img\n";
+    print "initrd $grub_partition" . ($use_boot_partition ? "" : "/boot") . 
+"/initrd-$version.img\n";
 }
 close F;
 select STDOUT;
@@ -149,7 +150,7 @@
     while (<F>) {
        my @s = split ' ';
        $part = $s[0] if $s[1] =~ m|/$| and not $part;
-       $part = $s[0] if $s[1] =~ m|/boot$|;
+       do { $part = $s[0]; $use_boot_partition = 1 } if $s[1] =~ m|/boot$|;
     }; 
     close F;
     return  $part
--- make-initrd.bak     Tue Mar 27 05:13:53 2001
+++ make-initrd Tue Mar 27 15:18:44 2001
@@ -45,7 +45,7 @@
 
 if ( -f "/boot/initrd-$version.img") {
     debug("doing the symlink");
-    my_symlinkf("/boot/initrd-$version.img", "$link_initrd") if $link;
+    my_symlinkf("initrd-$version.img", "$link_initrd") if $link;
 } else {
     debug("no need to do any symlink, no initrd generated");
 }

Reply via email to