Hello,
When MODULES is set to 'dep' in /etc/initramfs-tools/initramfs.conf,
update-initramfs fails to detect correctly the root filesystem(device
and fs used). When called, this command fails with:
----------
mkinitramfs: missing rootfs root rootfs /sys entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug
update-initramfs: failed for /boot/initrd.img-2.6.25-2-amd64
----------
This bug added with #479607, makes 2 of machines unsuable with 2.6.25 kernel series.
The attached patch resolves the issue on my machines. Please, review the patch and consider it for the next release of this package.
Thanks,
Kernel: Linux 2.6.25-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages initramfs-tools depends on:
ii cpio 2.9-13 GNU cpio -- a program to manage ar
ii findutils 4.4.0-2 utilities for finding files--find,
ii klibc-utils 1.5.9-2 small utilities built with klibc f
ii module-init-tools 3.4-1 tools for managing Linux kernel mo
ii udev 0.114-2 /dev/ and hotplug management daemo
Versions of packages initramfs-tools recommends:
ii busybox 1:1.9.2-3 Tiny utilities for small and embed
-- no debconf information
--- /tmp/hook-functions 2008-05-26 21:32:24.000000000 +0200
+++ /usr/share/initramfs-tools/hook-functions 2008-05-26 21:24:46.000000000 +0200
@@ -222,7 +222,11 @@ dep_add_modules()
local block minor root FSTYPE root_dev_path x
# find out real rootfs on auto type
if [ "${FSTYPE}" = "auto" ]; then
05-26-2008, 10:41 PM
maximilian attems
Bug#483082: initramfs-tools: Error while detecting rootfs when 'MODULES=dep'
On Mon, May 26, 2008 at 11:41:15PM +0200, Glennie Vignarajah wrote:
> Package: initramfs-tools
> Version: 0.92a
> Severity: grave
> Tags: patch
> Justification: renders package unusable
please learn to set severity properly.
MODULES=dep is not the default, thus is is max important, thanks.
also failing on 2 boxes is not like redering initrmafs-tools unusable!?
> Hello,
> When MODULES is set to 'dep' in /etc/initramfs-tools/initramfs.conf,
> update-initramfs fails to detect correctly the root filesystem(device
> and fs used). When called, this command fails with:
> ----------
> mkinitramfs: missing rootfs root rootfs /sys entry
> mkinitramfs: workaround is MODULES=most
> mkinitramfs: Error please report the bug
> update-initramfs: failed for /boot/initrd.img-2.6.25-2-amd64
> ----------
ok cool, you are the first to report on this.
> This bug added with #479607, makes 2 of machines unsuable with
> 2.6.25 kernel series. The attached patch resolves the issue on
> my machines. Please, review the patch and consider it for the
> next release of this package. Thanks,
can you please post addtitional info, i'd like to see output of
cat /etc/fstab
> --- /tmp/hook-functions 2008-05-26 21:32:24.000000000 +0200
> +++ /usr/share/initramfs-tools/hook-functions 2008-05-26 21:24:46.000000000 +0200
> @@ -222,7 +222,11 @@ dep_add_modules()
> local block minor root FSTYPE root_dev_path x
>
> # findout root block device + fstype
> - eval "$(mount | awk '/ / / {print "root=" $1 "
FSTYPE=" $5; exit}')"
> + eval "$(mount | awk '/ /dev// {if ($3 = "/") {print "root=" $1 "
FSTYPE=" $5; exit}}')"
there seem to be a typo here, awk '//dev// {}' without space works
better for me.
> + if [ "${root}" = "/dev/root" ] ; then
> + root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null
> + fi
> + root="$(readlink -f ${root})"
shouldn't the readlink be also under the if as only needed for UUID
path?
> # find out real rootfs on auto type
> if [ "${FSTYPE}" = "auto" ]; then
thanks for report.
--
maks
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
05-27-2008, 07:17 AM
Glennie Vignarajah
Bug#483082: initramfs-tools: Error while detecting rootfs when 'MODULES=dep'
Le Tuesday 27 May 2008 vers 00:41, maximilian attems(maximilian
attems <max@stro.at>) a écrit:
Hello,
> please learn to set severity properly.
> MODULES=dep is not the default, thus is is max important, thanks.
> also failing on 2 boxes is not like redering initrmafs-tools
> unusable!?
I set it to severity grave beaucause added with an other bug some
machines may became unbootable under 2.6.25 kernel series...
You can downgraded the serverty if you think it's high.
> can you please post addtitional info, i'd like to see output of
> cat /etc/fstab
> there seem to be a typo here, awk '//dev// {}' without space
> works better for me.
You're right.
Moreover, the there is mistake. In fact, '($3 = "/")' *must be* '($3
== "/")'.
The new version is attached.
>
> > + if [ "${root}" = "/dev/root" ] ; then
> > + root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root})
> > 2>/dev/null + fi
> > + root="$(readlink -f ${root})"
>
> shouldn't the readlink be also under the if as only needed for
> UUID path?
No. In fact, On 2 of my machines, the rootfs is mounted
on /dev/root. It googled a bit, and this issue is related to be
busybox....
So we have 3 cases here. eval "$(mount | awk '/"... returns
* an UUID when the rootfs is mounted with the 'LABEL=' or 'UUID='.
The UUID is a relative symbolic link located in /dev/disk/by-uuid/
pointing to the real device.
* the real disk device.
* /dev/root
When "root=/dev/root", we have to figure out what it is, which is
done in the "if" block.
Once we got the symlink to the root device, we can use 'readlink' to
get the real device. Using 'readlink' on a file which is not a
symlink doesn't matters(case 2).
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.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
Bug#483082: initramfs-tools: Error while detecting rootfs when 'MODULES=dep'
On Tue, 27 May 2008, Glennie Vignarajah wrote:
> > + eval "$(mount | awk '/ /dev// {if ($3 = "/") {print
> ^^^^^^
> > > "root=" $1 "
FSTYPE=" $5; exit}}')"
>
> > there seem to be a typo here, awk '//dev// {}' without space
> > works better for me.
>
> You're right.
> Moreover, the there is mistake. In fact, '($3 = "/")' *must be* '($3
> == "/")'.
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.
> The new version is attached.
didn't get the new patch?
if you'd made it applyable with p1 that be a bonus.
> No. In fact, On 2 of my machines, the rootfs is mounted
> on /dev/root. It googled a bit, and this issue is related to be
> busybox....
> So we have 3 cases here. eval "$(mount | awk '/"... returns
> * an UUID when the rootfs is mounted with the 'LABEL=' or 'UUID='.
> The UUID is a relative symbolic link located in /dev/disk/by-uuid/
> pointing to the real device.
> * the real disk device.
> * /dev/root
>
> When "root=/dev/root", we have to figure out what it is, which is
> done in the "if" block.
ok ack, no the /dev/root is due to lilo.
it's the naming we gave it in initramfs-tools similar to others.
> Once we got the symlink to the root device, we can use 'readlink' to
> get the real device. Using 'readlink' on a file which is not a
> symlink doesn't matters(case 2).
ack
best regards
--
maks
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
05-28-2008, 05:24 AM
Glennie Vignarajah
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.