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

Bug#511840: initramfs-tools: Initrd fails to find root device after boot into system following install - INCLUDED PATCH solves the problem.

Package: initramfs-tools
Version: 0.92o
Severity: important
Tags: patch

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=ru_RU.UTF8, LC_CTYPE=ru_RU.UTF8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

During reboot after an LVM/encrypted root install, the /init script in
the initrd fails to find the root device.  /init is calculating the root
major/minor numbers using a hex value supplied by Lilo to the kernel
command line (the value turned out to be incorrect in my case), when we
can easily forget about whatever Lilo thinks the root device is and just
use the value of 'target' in /conf/conf.d/cryptroot, simplifying things

I've done just that in the following patch.  Using the param.conf
facility, I set $ROOT right after cryptsetup sets up the encrypted root.
The patch has been tested and works for me just fine.  Note that a
separate patch will be necessary for the case of an _unencrypted_ LVM
root mount.  I can send one along if you wish.


--------------------------------- SNIP ------------------------------------
diff --git a/scripts/local-top/cryptroot b/scripts/local-top/cryptroot
index 56d1d63..c0b4d06 100755
--- a/scripts/local-top/cryptroot
+++ b/scripts/local-top/cryptroot
@@ -264,6 +264,10 @@ setup_mapping()
 		message "cryptsetup: $crypttarget setup successfully"
+		echo "ROOT=$NEWROOT" >> /conf/param.conf
+		if [ -e "/dev/root" ]; then
+			rm -f /dev/root
+		fi

--------------------------------- SNIP ------------------------------------

Reply to: