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

Bug#756457: marked as done (initramfs-tools: fails when root filesystem has LABEL=/ (/dev/disk/by-label/\x2f))



Your message dated Sat, 04 Oct 2014 17:03:48 +0000
with message-id <E1XaSkG-0007FX-LG@franck.debian.org>
and subject line Bug#756457: fixed in initramfs-tools 0.118
has caused the Debian Bug report #756457,
regarding initramfs-tools: fails when root filesystem has LABEL=/ (/dev/disk/by-label/\x2f)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
756457: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756457
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: initramfs-tools
Version: 0.109.1
Severity: important
Tags: patch

Dear Maintainer,

My root filesystem has label "/". Since creating the filesystem, I have
realized that this is not the best choice of label, for it results in
device names like '/dev/disk/by-label/\x2f'. However, I used to use
labels only for convenience in my partition editor. (I believe this
naming scheme used to be the default in RedHat.[1])

Yesterday, I switched to using labels in my fstab (LABEL=/ for the root
filesystem). However, after rebooting, update-initramfs no longer works:

    $ sudo update-initramfs -u
    update-initramfs: Generating /boot/initrd.img-3.2.0-4-ixp4xx
    /dev/disk/by-label/x2f: No such file or directory
    mkinitramfs: for root /dev/disk/by-label/x2f missing disk/by-label/x
/sys/block/ entry
    mkinitramfs: workaround is MODULES=most
    mkinitramfs: Error please report the bug
    update-initramfs: failed for /boot/initrd.img-3.2.0-4-ixp4xx with 1.
    $

The problem is that the `dep_add_modules` function in
/usr/share/initramfs-tools/hook-functions uses the following routine to
identify the root block device and its filesystem type:

        eval "$( mount | while read dev foo mp foo fs opts rest ; do \
                [ "$mp" = "/" ] && [ "$fs" != "rootfs" ] \
                && printf "root=$dev\nFSTYPE=$fs" \
                && break; done)"

and when presented with the following line from mount,

    /dev/disk/by-label/\x2f on / type ext3
(rw,relatime,errors=remount-ro,barrier=1,data=ordered)

the routine fails for two reasons: 1) the call to read does not use the
-r option, so the backslash is stripped, and 2) the device name is
interpolated into the format string of printf (which turns \x2f into a
literal /).

I propose the following patch, which allows / to be used in disk labels
(enabling me to rebuild my own initrd). However, some other special
characters that could appear in disk labels, like apostrophe and space,
will remain problematic -- a more complete patch might be desirable. I
believe that version 0.115 is also susceptible to this problem, as it
uses the same code to identify the root block device, but I have not
tested it with non-alphanumeric disk labels.

Thanks,
-nandhp

--- hook-functions	2013-04-16 20:19:46.000000000 -0500
+++ hook-functions.patched	2014-07-29 19:24:04.000000000 -0500
@@ -231,9 +231,9 @@
 	fi

 	# findout root block device + fstype
-	eval "$( mount | while read dev foo mp foo fs opts rest ; do \
+	eval "$( mount | while read -r dev foo mp foo fs opts rest ; do \
         	[ "$mp" = "/" ] && [ "$fs" != "rootfs" ] \
-		&& printf "root=$dev\nFSTYPE=$fs" \
+		&& printf "root='%s'\nFSTYPE='%s'" "$dev" "$fs" \
 		&& break; done)"

 	# On failure fallback to /proc/mounts if readable

[1]
http://www.linuxforums.org/forum/red-hat-fedora-linux/root-label-grub-conf-print-23010.html

-- Package-specific info:
-- initramfs sizes
-- /proc/cmdline
console=ttyS0,115200 noirqdebug

-- resume
RESUME=/dev/sda5
-- /proc/filesystems
	ext3
	ext2

-- lsmod
Module                  Size  Used by
sha256_generic          8535  0
aes_generic            27588  0
cbc                     2252  0
ppp_async               6465  1
crc_ccitt               1125  1 ppp_async
ppp_generic            21863  5 ppp_async
slhc                    4415  1 ppp_generic
tun                    12349  4
nfsd                  226810  7
nfs                   339373  0
nfs_acl                 2205  2 nfs,nfsd
auth_rpcgss            33749  2 nfs,nfsd
fscache                39451  1 nfs
lockd                  66992  2 nfs,nfsd
sunrpc                182543  20 lockd,auth_rpcgss,nfs_acl,nfs,nfsd
ipv6                  262080  68
ipt_MASQUERADE          1396  3
iptable_nat             3350  1
nf_nat                 13067  2 iptable_nat,ipt_MASQUERADE
nf_conntrack_ipv4       9990  3 nf_nat,iptable_nat
nf_defrag_ipv4          1053  1 nf_conntrack_ipv4
nf_conntrack           53380  4
nf_conntrack_ipv4,nf_nat,iptable_nat,ipt_MASQUERADE
ip_tables               9560  1 iptable_nat
x_tables               11483  3 ip_tables,iptable_nat,ipt_MASQUERADE
ext2                   54932  2
dm_crypt               14122  0
dm_mod                 63271  1 dm_crypt
snd_usb_audio          74605  0
snd_usbmidi_lib        15415  1 snd_usb_audio
snd_hwdep               5165  1 snd_usb_audio
snd_seq_midi            3890  0
snd_seq_midi_event      4426  1 snd_seq_midi
snd_rawmidi            15758  2 snd_seq_midi,snd_usbmidi_lib
snd_pcm                57532  1 snd_usb_audio
snd_page_alloc          4675  1 snd_pcm
snd_seq                41501  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device          4683  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              15155  2 snd_seq,snd_pcm
snd                    44456  8
snd_timer,snd_seq_device,snd_seq,snd_pcm,snd_rawmidi,snd_hwdep,snd_usbmidi_lib,snd_usb_audio
evdev                   7488  0
soundcore               4752  1 snd
gspca_ov519            27772  0
gspca_main             17650  1 gspca_ov519
cdc_ether               3348  0
videodev               69813  1 gspca_main
usbnet                 13267  1 cdc_ether
media                   9171  1 videodev
cdc_acm                13586  2
mii                     3513  1 usbnet
ixp4xx_eth             13722  0
ixp4xx_qmgr             4701  6 ixp4xx_eth
ixp4xx_npe              5630  2 ixp4xx_eth
libphy                 14448  1 ixp4xx_eth
ixp4xx_beeper           1793  0
ohci_hcd               17936  0
ext3                  163483  4
mbcache                 4464  2 ext3,ext2
jbd                    57469  1 ext3
sd_mod                 29032  8
crc_t10dif              1110  1 sd_mod
usb_storage            35325  7
scsi_mod              109660  2 usb_storage,sd_mod
ehci_hcd               39605  0
usbcore               123599  12
ehci_hcd,usb_storage,ohci_hcd,cdc_acm,usbnet,cdc_ether,gspca_main,gspca_ov519,snd_usbmidi_lib,snd_usb_audio
usb_common               648  1 usbcore

-- /etc/initramfs-tools/modules

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

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- /etc/crypttab
# <target name>	<source device>		<key file>	<options>

-- /sys/block
mtdblock0
mtdblock1
mtdblock2
mtdblock3
mtdblock4
mtdblock5
sda
sdb

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
busybox
cryptgnupg
cryptkeyctl
cryptopenct
cryptopensc
cryptpassdev
cryptroot
dmsetup
flash_kernel_set_root
keymap
klibc
kmod
nslu2
thermal
udev


-- System Information:
Debian Release: 7.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: armel (armv5tel)

Kernel: Linux 3.2.0-4-ixp4xx
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages initramfs-tools depends on:
ii  cpio               2.11+dfsg-0.1
ii  klibc-utils        2.0.1-3.1
ii  kmod               9-3
ii  module-init-tools  9-3
ii  udev               175-7.2

Versions of packages initramfs-tools recommends:
ii  busybox-static  1:1.20.0-7

Versions of packages initramfs-tools suggests:
ii  bash-completion  1:2.0-1

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: initramfs-tools
Source-Version: 0.118

We believe that the bug you reported is fixed in the latest version of
initramfs-tools, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 756457@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ben Hutchings <ben@decadent.org.uk> (supplier of updated initramfs-tools package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 04 Oct 2014 17:19:10 +0100
Source: initramfs-tools
Binary: initramfs-tools
Architecture: all source
Version: 0.118
Distribution: unstable
Urgency: medium
Maintainer: Debian kernel team <debian-kernel@lists.debian.org>
Changed-By: Ben Hutchings <ben@decadent.org.uk>
Closes: 689942 717805 729800 756457 762870 763157 763777
Description: 
 initramfs-tools - generic modular initramfs generator
Changes:
 initramfs-tools (0.118) unstable; urgency=medium
 .
   [ Ben Hutchings ]
   * [70e371f] manual_add_modules: Set the kernel version when checking module
     firmware deps
   * [fdec1d3] lsinitramfs: Move the decompress | cpio pipeline into a function
   * [d5f4cd6] lsinitramfs: Parse and list files that include early microcode.
     Thanks to Brett Parker and Olivier Berger. (Closes: #717805)
   * [f868c43] lsinitramfs: Include -l option in usage message
   * [f4c512e] Add more sanity checks on root device name in dep_add_modules
   * [d58a65b] Support MODULES=dep usage when root was mounted from hidden
     /dev/root (Closes: #689942)
   * [ebf275a] Check for root device's module dependencies at all levels of
     device hierarchy
   * [52abbfb] init: Decide what the real init is immediately before mounting
     /usr
   * [25aa264] init: Fix validation of the real init program
   * [66a141e] init: Resolve both absolute and relative symlinks in
     validate_init
   * [042d7a3] init: Only mount /usr if the real init is systemd
     (Closes: #763157)
   * [d641934] debian/control: Add Breaks: systemd-sysv (<< 186)
   * [305489e] debian/control: Conflict with linux-initramfs-tool
     (Closes: #729800)
   * [fd83e8b] panic: Do not return if reboot fails
   * [c0579f5] hooks/fsck: Add hwclock, related configuration files and udev
     rules (Closes: #763777)
   * [a7bd088] debian/control: Add versioned Depends on util-linux to avoid
     adjusting clock twice
   * [6ae39eb] debian/control: Fix minimum version of util-linux
   * [67e53ea] init: Set and export PATH before running any external commands
   * [8ebce59] Require new klibc-utils or busybox, to get 'readlink -f' and
     'mount -o defaults' (Closes: #762870)
 .
   [ nandhp ]
   * [782d166] Fix handling of root filesystem with LABEL=/
     (/dev/disk/by-label/\x2f) (Closes: #756457)
Checksums-Sha1: 
 0b2b0aaaae061bb20fd3a35fd833a8fe7891ce37 1709 initramfs-tools_0.118.dsc
 bd57dee72e1b6af68312c4fc3a2bb14687657d26 78500 initramfs-tools_0.118.tar.xz
 a36cc1176d77838ba7a676d80f138fbed23136d7 93522 initramfs-tools_0.118_all.deb
Checksums-Sha256: 
 8c5997a477e3c03e5401c400987a1929927cbca8c15021aa835e7d8bdb788fb4 1709 initramfs-tools_0.118.dsc
 bde621a26d1e68dd43911cb569e5f06a17cd9a66575e8cf3f78676cf7c5a1bcf 78500 initramfs-tools_0.118.tar.xz
 56b6d989f09e12af9ef8b570bf849163caca3dbc47c48418aca13ab15acbd219 93522 initramfs-tools_0.118_all.deb
Files: 
 e6d816493589276a9c8156b9b14d0273 1709 utils optional initramfs-tools_0.118.dsc
 c785a9cc0722204495f13cb6dc3bb031 78500 utils optional initramfs-tools_0.118.tar.xz
 f0cee0250f15ef7d075a97cad28d628b 93522 utils optional initramfs-tools_0.118_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIVAwUBVDAkXue/yOyVhhEJAQrzDQ//duPrBt40xh3GOaqBA9TG3Z2dC+28SHY4
B1fPtmIInfRn2hVjxvGUKGCvJN+qZaRqWNCn30zdTZ4+66abYmtLyYWsFGJKjPKf
7tLBdLVgBU0mKKHdN1VGoUXb/qzqAM4vY0ovwJ1xcnSaRz5c6f7M2DrxUl7CiNqK
eTUVpp5MgW6UT3UCh0gXIVA42dO/gT0KJzE2xNC+sbFxgR/XSzTYBOFC5lvx1Hjl
uKJUJKhIwFrHkbI1Ba6Y8eB7T2V0UNJ7IzUIMd6bSlNYOC6xPOCphVVoYMvdIW8P
wluK33uRG58ghjfUYWf6VgNwuoBCHj+ilqPP5RJjvJB+Oek4zltP+MXuL+f+Adm/
891CS1LJjL/haNMMh62DiV05DRT7SNDKzRiLxFboQscaSJXEMyVeOXWjjG3VWmWh
Vd9XveOYL0UN3ypegcpmOo8JG+4gCfLPz6vXqdRcXWMVMT/Flih5a5RjdBeLYCrR
O7apV4Wo/MMKUaraR7rkMoiZd+QKj7gmft7kreNjQoqcboERvtZNOMgV38SUjE2H
Lvr2WNOXcXc+8fnxI3mykwlQB5Wjile7LW0fASQ/jgIj+pECImQs+6iSw4O6bCxW
R85YBvVILGsH84NGQsACFH+/BCKBUKgzmXNCpyax3Jyw0AIwTLYcK5iwKdo6Ow1h
nUl+6j1Ii88=
=EDjB
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: