Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Bug#483082: initramfs-tools: Error while detecting rootfs when 'MODULES=dep' (http://www.linux-archive.org/debian-kernel/95851-bug-483082-initramfs-tools-error-while-detecting-rootfs-when-modules-dep.html)

Glennie Vignarajah 05-26-2008 09:41 PM

Bug#483082: initramfs-tools: Error while detecting rootfs when 'MODULES=dep'
 
Package: initramfs-tools
Version: 0.92a
Severity: grave
Tags: patch
Justification: renders package 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
----------
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,


-- Package-specific info:
-- /proc/cmdline
BOOT_IMAGE=Linux ro root=UUID=76188785-a331-44de-a9b8-12f07ce5172d profile=64 noisapnp

-- /proc/filesystems
ext3
fuseblk

-- lsmod
Module Size Used by
binfmt_misc 17164 1
ppdev 13832 0
parport_pc 34344 0
lp 17540 0
parport 44848 3 ppdev,parport_pc,lp
autofs4 28552 1
battery 14208 0
container 9600 0
video 27412 0
output 8704 1 video
ac 9344 0
sbs 14336 0
sbshc 11904 1 sbs
wmi 13120 0
ipv6 294120 24
fuse 53440 1
loop 23044 0
ide_cd_mod 41504 0
cdrom 39464 1 ide_cd_mod
ide_disk 20096 2
ata_generic 13572 0
ipaq 44184 0
usbserial 41328 1 ipaq
snd_ens1371 32448 1
gameport 20368 1 snd_ens1371
snd_ac97_codec 118488 1 snd_ens1371
ac97_bus 6528 1 snd_ac97_codec
snd_pcm_oss 46752 0
snd_pcm 88072 3 snd_ens1371,snd_ac97_codec,snd_pcm_oss
snd_mixer_oss 21376 1 snd_pcm_oss
snd_seq_dummy 8580 0
snd_seq_oss 36736 0
snd_seq_midi 13376 0
snd_rawmidi 31008 2 snd_ens1371,snd_seq_midi
via82cxxx 12932 0 [permanent]
snd_seq_midi_event 12544 2 snd_seq_oss,snd_seq_midi
snd_seq 58912 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_mid i_event
snd_timer 29328 2 snd_pcm,snd_seq
snd_seq_device 12948 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi ,snd_seq
snd 66888 12 snd_ens1371,snd_ac97_codec,snd_pcm_oss,snd_pcm,snd _mixer_oss,snd_seq_oss,snd_rawmidi,snd_seq,snd_tim er,snd_seq_device
soundcore 13088 1 snd
serio_raw 11652 0
3c59x 50996 0
floppy 66984 0
snd_page_alloc 15120 1 snd_pcm
k8temp 10624 0
i2c_viapro 13976 0
pcspkr 7808 0
psmouse 45724 0
i2c_core 30752 1 i2c_viapro
ehci_hcd 40076 0
ide_pci_generic 9476 0 [permanent]
uhci_hcd 29472 0
ide_core 138160 4 ide_cd_mod,ide_disk,via82cxxx,ide_pci_generic
atl1 39436 0
mii 10240 2 3c59x,atl1
shpchp 38300 0
pci_hotplug 35512 1 shpchp
button 13856 0
evdev 17408 4
ext3 139280 9
jbd 55336 1 ext3
mbcache 13956 1 ext3
dm_mirror 31748 0
dm_snapshot 22472 0
dm_mod 68536 7 dm_mirror,dm_snapshot
raid10 27392 0
raid456 129824 0
async_xor 7424 1 raid456
async_memcpy 6400 1 raid456
async_tx 7168 1 raid456
xor 10128 2 raid456,async_xor
raid1 28032 0
raid0 12032 0
multipath 13440 0
linear 10112 0
md_mod 87204 6 raid10,raid456,raid1,raid0,multipath,linear
sd_mod 33728 10
thermal 26656 0
processor 49388 1 thermal
fan 10760 0
sata_via 17412 9
libata 165808 2 ata_generic,sata_via
scsi_mod 170360 2 sd_mod,libata
dock 16288 1 libata

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = yes
do_bootfloppy = no
do_initrd = yes
link_in_boot = no

-- /etc/initramfs-tools/initramfs.conf
MODULES=dep
ROOT="UUID=76188785-a331-44de-a9b8-12f07ce5172d"
BUSYBOX=y
KEYMAP=y
BOOT=local
DEVICE=eth0
NFSROOT=auto

-- /sys/block
dm-0
dm-1
hda
hdd
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
ram0
ram1
ram10
ram11
ram12
ram13
ram14
ram15
ram2
ram3
ram4
ram5
ram6
ram7
ram8
ram9
sda


-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

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

# 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}}')"
+ 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

maximilian attems 05-26-2008 10:41 PM

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


> -- Package-specific info:
> -- /proc/cmdline
> BOOT_IMAGE=Linux ro root=UUID=76188785-a331-44de-a9b8-12f07ce5172d profile=64 noisapnp

nice.

> --- /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

Glennie Vignarajah 05-27-2008 07:17 AM

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

The files are attached.

> > root=UUID=76188785-a331-44de-a9b8-12f07ce5172d profile=64
> > noisapnp
>
> nice.

In first place, while trying get 2.6.25-1 up, I moved to UUID on a
machine to make clear that the issue isn't due to device naming
scheme.

> + 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
== "/")'.
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


/dev/sda5 / ext3 defaults 0 1
/dev/sda1 /boot ext3 data=writeback,errors=remount-ro 0 1
/dev/sda6 /usr ext3 data=writeback,errors=remount-ro 0 1
/dev/sda7 /var ext3 data=writeback,errors=remount-ro 0 1
/dev/sda8 /tmp ext3 data=writeback,errors=remount-ro 0 1
/dev/sda9 /home ext3 data=writeback,errors=remount-ro 0 1
/dev/sda10 /miscs ext3 data=writeback,errors=remount-ro 0 1
/dev/data/data /data ext3 data=writeback,errors=remount-ro 0 1

/dev/saves/saves /saves ext3 data=writeback,errors=remount-ro 0 1


/dev/sda2 none swap sw 0 0
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0

# =================
#*= /dev/sda5 / =
# =================
UUID=76188785-a331-44de-a9b8-12f07ce5172d / ext3 errors=remount-ro 0 1

# =====================
#*= /dev/sda1 /boot =
# =====================
UUID=b213dcfb-307e-4ac2-9c26-d270aac1c0e4 /boot ext3 data=writeback 0 2


# ====================
#*= /dev/sda7 /opt =
# ====================
UUID=ba97d770-14c0-4bea-9866-392f03c99a6d /opt ext3 data=writeback 0 2


# ======================
#*= /dev/sda10 /tmp =
# ======================
UUID=5993f298-f525-4af5-abe9-2924edc09e60 /tmp ext3 data=writeback 0 2


# ====================
#*= /dev/sda6 /usr =
# ====================
UUID=22022fa6-aab8-4430-a63e-c39a7840f3bb /usr ext3 data=writeback 0 2



# ====================
#*= /dev/sda8 /var =
# ====================
UUID=82f7287a-b956-4d66-80c6-674033e09278 /var ext3 data=writeback 0 2



# =====================
#*= /dev/sda9 /home =
# =====================
UUID=9d6e19a3-0f38-4b2c-a4a6-59270c09a5df /home ext3 data=writeback 0 2



# =======
# = LVM =
# =======
/dev/data/data /data ext3 data=writeback 0 2
UUID=13a8ed92-34b4-4637-9671-1d920467c995 /data/miscs ext3 data=writeback 0 2



/dev/sda2 none swap sw 0 0
/dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0

maximilian attems 05-27-2008 01:58 PM

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

Glennie Vignarajah 05-28-2008 05:24 AM

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.


All times are GMT. The time now is 05:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.