From: Yu Watanabe Date: Wed, 28 Apr 2021 18:07:47 +0000 (+0900) Subject: kernel-insteall: do not remove the first slash in $ENTRY_DIR X-Git-Tag: v249-rc1~320 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ff739a6ac4adb44f7ea0f534087ee7276302eee;p=thirdparty%2Fsystemd.git kernel-insteall: do not remove the first slash in $ENTRY_DIR Follow-up for cd0d230e7bf87f979722de7e364619dfa71bd6a2. Fixes #19456. --- diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install index e6c7e99e650..75218d0deea 100644 --- a/src/kernel-install/90-loaderentry.install +++ b/src/kernel-install/90-loaderentry.install @@ -36,7 +36,11 @@ MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID BOOT_ROOT=${ENTRY_DIR_ABS%/$MACHINE_ID/$KERNEL_VERSION} BOOT_MNT=$(stat -c %m $BOOT_ROOT) -ENTRY_DIR=${ENTRY_DIR_ABS#$BOOT_MNT} +if [[ $BOOT_MNT == '/' ]]; then + ENTRY_DIR=$ENTRY_DIR_ABS +else + ENTRY_DIR=${ENTRY_DIR_ABS#$BOOT_MNT} +fi if [[ $COMMAND == remove ]]; then rm -f "$BOOT_ROOT/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"