Definition of add_mountroot_fail_hook doesnt match lvm2's usage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools |
New
|
Undecided
|
Unassigned | ||
initramfs-tools (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Package lvm2 contains a init-premount script named /usr/share/
In this script there is the function call:
add_mountroot_
Which is defined in /usr/share/
In focal's 0.136ubuntu6 , this is defined as:
add_mountroot_
{
mkdir -p /tmp/mountroot-
ln -s "$0" /tmp/mountroot-
}
The final line of the function will execute as
ln -s "/scripts/lvm2" /tmp/mountroot-
And fail, because directory /tmp/mountroot-
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_
{
mkdir -p /tmp/mountroot-
ln -s "$0" /tmp/mountroot-
}
focal's version needs to be updated to either support the "$1" argument or strip the directory from "$0".
Forgot to mention, in the current bugged state the following message is shown during boot:
ln: /tmp/mountroot- fail-hooks. d//scripts/ init-premount/ lvm2: No such file or directory
Presumedly the fail hook will not be invoked either.