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

Bug#483082: initramfs-tools: Error while detecting rootfs when 'MODULES=dep'



Le Tuesday 27 May 2008 à 15:58, vous avez écrit:

Hi,

> rethinking i like your hardening with checking that $3 must be
> '/', but i don't see so much the point of changing the regex in
> front. awk '/ \/ / # ought to be enough.

 "awk '/\/dev\//" is need beacause mount returns 'rootfs on / type 
rootfs' on the first line. With only "awk '/ \/ /", we won't catch 
the root device, but always the first line!

>
> > The new version is attached.
>
> didn't get the new patch?
> if you'd made it applyable with p1 that be a bonus.

My fault.
The patch is attached.


> ok ack, no the /dev/root is due to lilo.
> it's the naming we gave it in initramfs-tools similar to others.

Ok.
Cheers,
-- 
http://www.glennie.fr
The reasonable man adapts himself to the world; the unreasonable one 
persists in trying to adapt the world to himself. Therefore all 
progress depends on the unreasonable man.
--- initramfs-tools/hook-functions.ori	2008-05-27 19:02:08.000000000 +0200
+++ initramfs-tools/hook-functions	2008-05-27 18:49:33.000000000 +0200
@@ -222,7 +222,11 @@
 	local block minor root FSTYPE root_dev_path x
 
 	# findout root block device + fstype
-	eval "$(mount | awk '/ \/ / {print "root=" $1 "\nFSTYPE=" $5; exit}')"
+	eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
+	if [ "${root}" = "/dev/root" ] ; then
+		root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null
+	fi
+	root="$(readlink -f ${root})"
 
 	# find out real rootfs on auto type
 	if [ "${FSTYPE}" = "auto" ]; then

Reply to: