add_mountroot_fail_hook is either buggy or not used properly, causes boot problems

Bug #1873797 reported by Psy[H[]
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
initramfs-tools-ubuntu-core (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

ln -s "$0" /tmp/mountroot-fail-hooks.d/"$0" makes no sense when $0 is a full path.

in /usr/share/initramfs-tools/scripts/init-premount/lvm2 there is this line:

  add_mountroot_fail_hook "20-lvm2"

It tries to link /scripts/init-premount/lvm2 to /tmp/mountroot-fail-hooks.d//scripts/init-premount/lvm2, and the argument "20-lvm2" is discarded.

This causes boot problems.

Solution?

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

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Hi, can you explain more what the problem is that you see with this and more details on how to reproduce the issue?

Changed in initramfs-tools-ubuntu-core (Ubuntu):
status: New → Incomplete
Revision history for this message
Oliver Grawert (ogra) wrote :

also ... i highly doubt that support for lvm2 is planned in UbuntuCore 20, this bug might rather be for the initramfs-tools package itself ...

Revision history for this message
Roland Kaufmann (rlndkfmn+launchpad) wrote :

I also get this problem, on a minimal Ubuntu installed on an LVM-managed disk. However, I believe that the fix should be:

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

i.e, that the path in /tmp/mountroot-fail-hooks should be given by the parameter to the funcion. Apply this fix with (notice that bug 1835660 may now occur):

sudo update-initramfs -u

You can verify that the message goes away with

sudo journalctl -b | grep mountroot-fail-hooks

after next reboot.

Revision history for this message
Roland Kaufmann (rlndkfmn+launchpad) wrote :

I have reported this to the initramfs-tools package: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1878378

Revision history for this message
Oliver Grawert (ogra) wrote :

pleas use 1878378 for further discussion of that issue, there is no relation at all to initramfs-tools-ubuntu-core

Changed in initramfs-tools-ubuntu-core (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Compiler (pranav.bhattarai) wrote :

I just decided to do some update/upgrade in Ubuntu 20.04, and this is what I get. What's wrong here?

#help

(Meanwhile, I can only log in to my computer only in CLI mode.)

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Hi Pranav, the bug you are experiencing seems to be the same as this one: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1878378

Can you please comment there instead? This current bug report will not be looked at by anyone as it is invalid.

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.