From b080079237ac0a343a52bfd0cb71637e1e67b17b Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 13 May 2020 11:32:19 +0200 Subject: [PATCH] Use specified target name for mountroot failure hook add_mountroot_fail_hook lets a script add itself to the list of hooks. However, the name of the hook (e.g. "20-lvm") is supposed to be given as an argument to the script. The previous version uses the source name of the script, which is a full path. This cause the ln command to fail, because the target directory, which now becomes /tmp/mountroot-fail-hooks.d//scripts/init-premount does not exist. This patch fixes the command to use its argument as target name. Hat tip to launchpad user vovik-wfa for finding this bug. --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 4c86db1..9c68477 100644 --- a/scripts/functions +++ b/scripts/functions @@ -36,7 +36,7 @@ log_end_msg() add_mountroot_fail_hook() { mkdir -p /tmp/mountroot-fail-hooks.d - ln -s "$0" /tmp/mountroot-fail-hooks.d/"$0" + ln -s "$0" /tmp/mountroot-fail-hooks.d/"$1" } # Run failure hooks. -- 2.26.2