]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-insteall: do not remove the first slash in $ENTRY_DIR
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Apr 2021 18:07:47 +0000 (03:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 30 Apr 2021 06:37:34 +0000 (15:37 +0900)
Follow-up for cd0d230e7bf87f979722de7e364619dfa71bd6a2.

Fixes #19456.

src/kernel-install/90-loaderentry.install

index e6c7e99e650e975b9151174619120a47ef2e6f46..75218d0deea87010eaaf1cf7809efec6a1e06e4c 100644 (file)
@@ -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"