add_mountroot_fail_hook uses wrong target name

Bug #1878378 reported by Roland Kaufmann
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

Upon boot of a system that uses LVM2 you get the message:

ln: /tmp/mountroot-fail-hooks.d//scripts/init-premount/lvm2: No such file or directory

This is because the script /usr/share/initramfs-tools/scripts/init-premount/lvm2 uses the add_mountroot_fail_hook function from /usr/share/initramfs-tools/scripts/functions (which is sources right before), but this function contains a bug that takes the full path of the source script instead of the given argument as name for the target.

Version of Ubuntu: 20.04 LTS
Version of initramfs-tools: 0.136ubuntu6

For a live installation, this may be fixed with (all on one line):

sudo sed -i 's,\(ln -s "\$0" /tmp/mountroot-fail-hooks\.d/\)"\$0",\1"\$1",' /usr/share/initramfs-tools/scripts/functions && sudo update-initramfs -u

and verified by checking that this message now disappears on next boot:

sudo journalctl -b | grep mountroot-fail-hooks

A proposed patch for the source distribution is attached.

Tags: patch
Revision history for this message
Roland Kaufmann (rlndkfmn+launchpad) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Proposed fix" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Benjamin Drung (bdrung) wrote :

This particular bug has already been reported and is a duplicate of bug #1871154, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.