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

Bug#281658: initrd-tools: "cat: getroot: No such file or directory" due to /etc/raidtab parse error

Package: initrd-tools
Version: 0.1.74
Severity: normal
File: /usr/sbin/mkinitrd

> root@Astalo:/var/tmp/kalle/debian# LC_ALL=C dpkg --configure -a
> Setting up kernel-image-2.6.8-1-k7 (2.6.8-4) ...
> cat: getroot: No such file or directory
> Failed to create initrd image.
> dpkg: error processing kernel-image-2.6.8-1-k7 (--configure):
>  subprocess post-installation script returned error exit status 9
> Errors were encountered while processing:
>  kernel-image-2.6.8-1-k7

With strace -f, I found it that the postinst runs this command:

  mkinitrd -o /boot/initrd.img-2.6.8-1-k7 /lib/modules/2.6.8-1-k7

I then ran that with "sh -x" and found that mkinitrd feeds
/etc/raidtab to awk and collects the raid-disk devices to a
"getroot" file:

		$1 == "device" {
			device = $2
		$1 == "raid-disk" {
			print device >> "getroot"

However, my /etc/raidtab has lines like this:

	device	/dev/hde1	raid-disk	0
	device	/dev/hdg1	raid-disk	1

That is, the "raid-disk" keyword is on the same line as "device".
The awk script then doesn't notice it, and fails to create the
"getroot" file, thus causing the error.  This syntax works just
fine with raidtools2, so I think mkinitrd should support it too.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.23-kon.astalo.1
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8

Versions of packages initrd-tools depends on:
ii  coreutils [fileutils]         5.2.1-2    The GNU core utilities
ii  cpio                          2.5-1      GNU cpio -- a program to manage ar
ii  cramfsprogs                   1.1-4      Tools for CramFs (Compressed ROM F
ii  dash                          0.5.1-3    The Debian Almquist Shell
ii  fileutils                     5.2.1-2    The GNU file management utilities 
ii  util-linux                    2.12-3     Miscellaneous system utilities

-- no debconf information

Reply to: