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

Re: Bug#291362: installation-reports: LVM install failed due to missing dmsetup



severity 291362 serious
reassign 291362 initrd-tools
thanks

Lupe Christoph wrote:
> Kernel installation (2.4.27) failed because the initrd could not be
> generated. dmsetup is missing.
> 
> Root is on a DM device, but dmsetup not installed
> Failed to create initrd image.
> 
> Same happens with 2.6.8.
> 
> Manually installing dmsetup as /target/sbin/dmsetup before installing
> the base system cures the problem. The dmsetup package must be part of
> the base system to solve this permanently.

initrd-tools 0.1.76 changed to abort on install to LVM if dmsetup was
not installed. I think this was a mistake. I'm ccing tbm, who made the
change.

Here's the diff:

 dm() {
-       if command -v lvmiopversion > /dev/null 2>&1; then
+       local dmname
+       
+       if ! command -v dmsetup > /dev/null 2>&1; then
+               echo Root is on a DM device, but dmsetup not installed >&2
+               exit 1
+       fi
+       
+       dmdev=$(printf "(%d, %d)" $major $minor)
+       
+       if ! dmsetup ls | grep -q "$dmdev\$"; then
+               echo Unknown DM device $major:$minor >&2
+               exit 1
+       fi
+       
+       dmname=$(dmsetup ls | grep "$dmdev\$" | sed 's/^\([^[:space:]]*\).*$/\1
/')
+       if dmsetup table $dmname | grep -q crypt; then
+               dmcrypt
+       elif command -v lvmiopversion > /dev/null 2>&1; then
                lvm
        elif [ ! -x /etc/mkinitrd/scripts/evms ]; then
                echo Unknown DM device $major:$minor >&2

This was apparently added as part of a patch to support encrypted root
filesystems, which is not supported by d-i at all; silently adding a
requirement that dmsetup be installed for lvm systems when previously it
was not needed is not a good thing to have done.

It seems to me that the above code could easily be rewritten to skip
calling dmsetup if it was not installed, and run the lvm function. This
might be a little less robust on systems that do use encrypted root
filesystems, but at least it wouldn't require us to make last-minute changes
to d-i and debian-cd to add dmsetup everywhere.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: