[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: proposed fix for lilo RC bug



On Mon, 2008-10-27 at 11:56 +0900, Paul Wise wrote:

> I propose to fix #479607 with the attached patch.

Ugh, the patch was buggy. Here is a new and tested one.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
diff -u lilo-22.8/debian/lilo.config lilo-22.8/debian/lilo.config
--- lilo-22.8/debian/lilo.config
+++ lilo-22.8/debian/lilo.config
@@ -24,6 +24,20 @@
 		db_endblock
 		db_go
 	fi
+
+	if grep -q "^[[:space:]]*large-memory" /etc/lilo.conf; then
+		db_set lilo/add_large_memory false
+	else
+		db_beginblock
+		db_text high lilo/add_large_memory || true
+		db_endblock
+		db_go
+
+		db_get lilo/add_large_memory || true;
+		if [ x"$RET" = x"true" ]; then
+			have_to_run=1
+		fi
+	fi
 fi
 
 if [ x"$isfresh" = x"0" ]; then
diff -u lilo-22.8/debian/lilo.postinst lilo-22.8/debian/lilo.postinst
--- lilo-22.8/debian/lilo.postinst
+++ lilo-22.8/debian/lilo.postinst
@@ -58,6 +58,26 @@
 	    fi
 	fi
 
+	db_get lilo/add_large_memory || true;
+	if [ x"$RET" = x"true" ]; then
+		if ! grep -q "^[[:space:]]*large-memory" /etc/lilo.conf; then
+			sed -i -e '1i\# Automatically added by lilo postinst script\nlarge-memory\n' /etc/lilo.conf
+			echo "WARNING: Added large-memory option, please run lilo before you reboot"
+		fi
+	else
+		kernel_size=$(stat -L -c %s /vmlinuz)
+		initrd_size=$(stat -L -c %s /initrd.img)
+		size=$(($kernel_size+$initrd_size))
+		large_mem=$(grep -c "^[[:space:]]*large-memory" /etc/lilo.conf) || true
+		if [ $large_mem -eq 0 -a $size -ge 8388608 ]; then
+			echo
+			echo "WARNING: You have a large kernel+initrd and large-memory is not set in lilo.conf."
+			echo "WARNING: Do NOT reboot or LILO may fail to boot."
+			echo "WARNING: Please read /usr/share/doc/lilo/README.Debian"
+			echo 
+		fi
+	fi
+
 	db_get lilo/runme || true;
 	if [ x"$RET" = x"true" ]; then
 		echo "Running lilo..."
diff -u lilo-22.8/debian/changelog lilo-22.8/debian/changelog
--- lilo-22.8/debian/changelog
+++ lilo-22.8/debian/changelog
@@ -1,3 +1,15 @@
+lilo (1:22.8-6.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Add some information about large initrd boot problems:
+    - Document the issue and workarounds in README.Debian
+    - Alert users to the issue in NEWS.Debian
+    - Prompt users to add large-memory to /etc/lilo.conf
+    - Thanks to debian-l10n-english for the review!
+    (Closes: #479607)
+
+ -- Paul Wise <pabs@debian.org>  Sat, 25 Oct 2008 21:25:18 +0800
+
 lilo (1:22.8-6) unstable; urgency=low
 
   * debian/liloconfig: Use large-memory mode. (Closes: #479607).
diff -u lilo-22.8/debian/README.Debian lilo-22.8/debian/README.Debian
--- lilo-22.8/debian/README.Debian
+++ lilo-22.8/debian/README.Debian
@@ -4,0 +5,27 @@
+
+--[ Large initrd files and lilo
+
+By default, LILO loads the initrd file into the first 15MB of memory
+to avoid a BIOS limitation with older systems (earlier than 2001).
+
+However, with newer kernels the combination of kernel and initrd
+may not fit into the first 15MB of memory and so the system will not
+boot properly. It seems that the boot issues appear when the
+kernel+initrd combination is larger than 8MB.
+
+If this machine has a recent BIOS without the 15MB limitation, you can
+add the 'large-memory' option to /etc/lilo.conf to instruct LILO to use
+more memory for passing the initrd to the kernel. You will need to
+re-run the 'lilo' command to make this option take effect.
+
+If this machine has an older BIOS, you may need to reduce the size of
+the initrd *before* rebooting.
+
+If you are using initramfs-tools, you should replace MODULES=most with
+MODULES=dep in your configuration and regenerate your initrd file:
+
+sed -i -e s/MODULES=most/MODULES=dep/ /etc/initramfs-tools/initramfs.conf
+update-initramfs -u
+
+If you are using yaird or any other initrd generator, please consult
+the documentation for your initrd generator.
diff -u lilo-22.8/debian/lilo.templates lilo-22.8/debian/lilo.templates
--- lilo-22.8/debian/lilo.templates
+++ lilo-22.8/debian/lilo.templates
@@ -25,6 +25,27 @@
   new: install=menu
   old: install=/boot/boot-menu.b or boot.b
 
+Template: lilo/add_large_memory
+Type: boolean
+Default: true
+_Description: Do you want to add the large-memory option?
+ By default, LILO loads the initrd file into the first 15MB of memory
+ to avoid a BIOS limitation with older systems (earlier than 2001).
+ .
+ However, with newer kernels the combination of kernel and initrd
+ may not fit into the first 15MB of memory and so the system will not
+ boot properly. It seems that the boot issues appear when the
+ kernel+initrd combination is larger than 8MB.
+ .
+ If this machine has a recent BIOS without the 15MB limitation, you can
+ add the 'large-memory' option to /etc/lilo.conf to instruct LILO to use
+ more memory for passing the initrd to the kernel. You will need to
+ re-run the 'lilo' command to make this option take effect.
+ .
+ If this machine has an older BIOS, you may need to reduce the size of
+ the initrd *before* rebooting. Please see the README.Debian file for
+ tips on how to do that.
+
 Template: lilo/runme
 Type: boolean
 Default: false
diff -u lilo-22.8/debian/NEWS lilo-22.8/debian/NEWS
--- lilo-22.8/debian/NEWS
+++ lilo-22.8/debian/NEWS
@@ -1,3 +1,10 @@
+lilo (1:22.8-6) unstable; urgency=low
+
+  lilo may fail to boot with a large kernel+initrd. Please read
+  README.Debian for ways to work around this problem.
+
+ -- Paul Wise <pabs@debian.org>  Sat, 25 Oct 2008 21:24:04 +0800
+
 lilo (1:22.7.3-1) unstable; urgency=low
 
   With this new version of LILO, upstream had addressed various RAID problems.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: