Comment 0 for bug 1873614

Revision history for this message
Nathan O'Sullivan (nathan-mammoth) wrote :

Package lvm2 contains a init-premount script named /usr/share/initramfs-tools/scripts/init-premount/lvm2

In this script there is the function call:
add_mountroot_fail_hook "20-lvm2"

Which is defined in /usr/share/initramfs-tools/scripts/functions

In focal's 0.136ubuntu6 , this is defined as:

add_mountroot_fail_hook()
{
        mkdir -p /tmp/mountroot-fail-hooks.d
        ln -s "$0" /tmp/mountroot-fail-hooks.d/"$0"
}

The final line of the function will execute as
ln -s "/scripts/lvm2" /tmp/mountroot-fail-hooks.d/"/scripts/lvm2"

And fail, because directory /tmp/mountroot-fail-hooks.d/scripts does not exist.

It is clear from lvm2's invocation that it expects the symlink to be named "20-lvm2" , and if we look at bionic's 0.130ubuntu3.6 that is the case:

add_mountroot_fail_hook()
{
        mkdir -p /tmp/mountroot-fail-hooks.d
        ln -s "$0" /tmp/mountroot-fail-hooks.d/"$1"
}

----

A simple fix might be to alter focal's version so it supports both invocation styles , e.g.

        ln -s "$0" /tmp/mountroot-fail-hooks.d/"${1:-$0}"