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

Bug#608339: initramfs-tools: MODULES=dep fails when / is ubifs (reopen)



Hi,

* maximilian attems <max@stro.at> [2010-12-30 21:11:18+0000]:
>
> > This is trivially resolved by amending the routines that search for the
> > root block device and fstype in /usr/share/initramfs-tools/hook-functions
> > to the following instead:
> > ----
> > # findout root block device + fstype
> > eval "$(mount | awk '!/^rootfs / && / on \/ type / {print "root=" $1 "\nFSTYPE=" $5; exit}')"
> > 
> > # On failure fallback to /proc/mounts if readable
> > if [ -z "$root" ] && [ -r /proc/mounts ]; then
> >         eval "$(awk '!/^rootfs / && / \/ / {print "root=" $1 "\nFSTYPE=" $3; exit}' /proc/mounts)"
> > fi
> > ----
> 
> first please if you do changes send them as diff, it is pretty
> trivial these days and helps a lot for the review of a change:
> git clone git://git.debian.org/kernel/initramfs-tools.git
> and see short guide on how to add features or fixes
> http://git.debian.org/?p=kernel/initramfs-tools.git;a=blob_plain;f=docs/maintainer-notes.html;hb=HEAD
>
Apologies, .
 
> > This filters out the useless '^rootfs' entry (enabling embedded folk to
> > continue symlinking) and permits anything (not just '^/dev/...') as the
> > root device.  Now the ubifs root filesystem detection functions.
> 
> so based on your proposal a diff would look like this:
> 
> diff --git a/hook-functions b/hook-functions
> index cc8b344..6dfd54d 100644
> --- a/hook-functions
> +++ b/hook-functions
> @@ -229,7 +229,7 @@ dep_add_modules()
>  
>  	# On failure fallback to /proc/mounts if readable
>  	if [ -z "$root" ] && [ -r /proc/mounts ]; then
> -		eval "$(awk '/\/dev\// {if ($2 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}' /proc/mounts)"
> +		eval "$(awk '!/^rootfs / {if ($2 == "/") {print "root=" $1 "\nFSTYPE=" $3; exit}}' /proc/mounts)"
>  	fi
>  
>  	# recheck root device
>
Don't trust it enough for the 'mount |' try too? ;)

Works for me, many thanks.

> > It should also be noted, the original 'failure fallback' does not work
> > anyway as it incorrectly refers to $5 (over eager cutting and pasting it
> > seems) when it should refer to $3 for FSTYPE.
> 
> well you may choose your words more wisely, as if you'd continue to read
> the function you would see that we don't use this FSTYPE value, so this
> doesn't matter (;
>
Ahhh, well if that is the case, why bother to set FSTYPE? ;)

To clear up confusion, is it not being used after the '-z $root' check?

Cheers and have a Happy New Year.

-- 
Alexander Clouter
.sigmonster says: Honk if you hate bumper stickers that say "Honk if ..."



Reply to: