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

Please hint nslu2-utils/0.10+r71-9



Please hint nslu2-utils/0.10+r71-9 for testing.  This package has an
initramfs-tools hook that will parse /etc/fstab and write the root
device to the initramfs.  This is needed in order to boot on this
machine since the boot loader doesn't provide a root= cmd line.

We have seen quite a few reports from people who made their box
unbootable by putting things like LABEL=root into /etc/fstab.
nslu2-utils didn't understand this syntax but would happily write it
to the initramfs anyway, and then it would fail to boot.  I've now
implemented support for LABEL and UUID.  Additionally, users will now
get a warning if the root device does not exist.

The diff from 0.10+r71-5 to 0.10+r71-9 is:

Index: debian/control
===================================================================
--- debian/control	(.../0.10+r71-5)	(revision 109)
+++ debian/control	(.../0.10+r71-9)	(revision 109)
@@ -8,7 +8,7 @@
 XS-Vcs-Svn: svn://svn.debian.org/pkg-nslu2-utils/trunk
 
 Package: nslu2-utils
-Architecture: arm armeb
+Architecture: arm armel armeb
 Section: admin
 Depends: ${misc:Depends}, ${shlib:Depends}, slugimage, devio, flash-kernel
 Suggests: beep
Index: debian/changelog
===================================================================
--- debian/changelog	(.../0.10+r71-5)	(revision 109)
+++ debian/changelog	(.../0.10+r71-9)	(revision 109)
@@ -1,3 +1,32 @@
+nslu2-utils (0.10+r71-9) unstable; urgency=low
+
+  * Add armel architecture.
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 16 Feb 2007 14:18:30 -0500
+
+nslu2-utils (0.10+r71-8) unstable; urgency=low
+
+  * List LED names in leds.8. Closes: #406560
+  * Correct a misparse of /etc/fstab if it contains nfs mount points with a
+    source directory ending in a "/". (Ie, "foo:/home/")
+
+ -- Joey Hess <joeyh@debian.org>  Sat, 10 Feb 2007 01:29:05 -0500
+
+nslu2-utils (0.10+r71-7) unstable; urgency=medium
+
+  * Make /etc/fstab parsing more robust:
+     - Parse LABEL and UUID strings and convert them to a device.
+       Closes: #403012
+     - Prompt the user if the device doesn't exist.
+
+ -- Martin Michlmayr <tbm@cyrius.com>  Mon, 05 Feb 2007 22:48:49 +0100
+
+nslu2-utils (0.10+r71-6) unstable; urgency=low
+
+  * Fix fstab parsing to ignore comments. Closes: #405566
+
+ -- Joey Hess <joeyh@debian.org>  Thu,  4 Jan 2007 11:20:56 -0500
+
 nslu2-utils (0.10+r71-5) unstable; urgency=low
 
   * Make initramfs-tools hook scripts executable; since they're patched in,
Index: debian/README.Debian
===================================================================
--- debian/README.Debian	(.../0.10+r71-5)	(revision 109)
+++ debian/README.Debian	(.../0.10+r71-9)	(revision 109)
@@ -53,7 +53,7 @@
 
    # Prdefined default lease for networks w/o dhcp.
    lease {
-   	interface "eth0";
+	interface "eth0";
 	fixed-address 192.168.1.77;
 	option broadcast-address 192.168.1.255;
 	option routers 192.168.1.1;
Index: files/leds.8
===================================================================
--- files/leds.8	(.../0.10+r71-5)	(revision 109)
+++ files/leds.8	(.../0.10+r71-9)	(revision 109)
@@ -10,7 +10,8 @@
 .B leds beep {args}
 .SH DESCRIPTION
 This program can control the leds on the front panel of the NSLU2, except
-for the ethernet led.
+for the ethernet led. The names of the leds are disk-1, disk-2, ready, and
+status.
 .P
 The first usage above is used to set leds during system boot to indicate a
 particular boot state.  'boot' means that the system is transitioning to
Index: initramfs-tools/hooks/nslu2
===================================================================
--- initramfs-tools/hooks/nslu2	(.../0.10+r71-5)	(revision 109)
+++ initramfs-tools/hooks/nslu2	(.../0.10+r71-9)	(revision 109)
@@ -65,9 +65,43 @@
 esac
 
 # Record the root filesystem device for use during boot, since the slug's
-# bootloader is hardcoded to use roo=/dev/ram.
-rootdev=$(egrep '^[^ 	]*[ 	]*/[ 	]' /etc/fstab | awk '{print $1}') || true
-if [ -z "$rootdev" ]; then
+# bootloader is hardcoded to use root=/dev/ram.
+rootdev=$(egrep '^[^# 	]+[ 	]+/[ 	]' /etc/fstab | awk '{print $1}') || true
+
+# Translate LABEL and UUID entries into a proper device name.
+if echo "$rootdev" | grep -q "="; then
+	a=$(echo "$rootdev" | cut -d "=" -f 1)
+	b=$(echo "$rootdev" | cut -d "=" -f 2)
+	case "$a" in
+		LABEL)
+			# Not all labels show up in /dev/disk/by-label:
+			# e.g. LABEL=/ doesn't.
+			found=0
+			if [ -e /dev/disk/by-label ]; then
+				for i in $(ls -1 /dev/disk/by-label/); do
+					[ "$i" = "$b" ] && found=1
+				done
+			fi
+			if [ $found -eq 0 ]; then
+				echo "/etc/fstab parse error; $rootdev not supported or found" >&2
+				rootdev=/dev/sda1
+				pause_error
+			else
+				rootdev="/dev/disk/by-label/$b"
+			fi
+		;;
+		UUID)
+			rootdev=/dev/disk/by-uuid/$b
+		;;
+		*)
+			echo "/etc/fstab parse error; cannot recognize root $rootdev" >&2
+			rootdev=/dev/sda1
+			pause_error
+		;;
+	esac
+fi
+
+if [ ! -e "$rootdev" ]; then
 	rootdev=/dev/sda1
 	echo "Warning: /etc/fstab parse error; guessing that the root device is $rootdev" >&2
 fi

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: