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}"
Package lvm2 contains a init-premount script named /usr/share/ initramfs- tools/scripts/ init-premount/ lvm2
In this script there is the function call: fail_hook "20-lvm2"
add_mountroot_
Which is defined in /usr/share/ initramfs- tools/scripts/ functions
In focal's 0.136ubuntu6 , this is defined as:
add_mountroot_ fail_hook( ) fail-hooks. d fail-hooks. d/"$0"
{
mkdir -p /tmp/mountroot-
ln -s "$0" /tmp/mountroot-
}
The final line of the function will execute as fail-hooks. d/"/scripts/ lvm2"
ln -s "/scripts/lvm2" /tmp/mountroot-
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( ) fail-hooks. d fail-hooks. d/"$1"
{
mkdir -p /tmp/mountroot-
ln -s "$0" /tmp/mountroot-
}
----
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}"