1
0
mirror of https://github.com/systemd/systemd.git synced 2025-05-27 21:05:55 +03:00

kernel-insteall: do not remove the first slash in $ENTRY_DIR

Follow-up for cd0d230e7bf87f979722de7e364619dfa71bd6a2.

Fixes #19456.
This commit is contained in:
Yu Watanabe 2021-04-29 03:07:47 +09:00
parent 65a245c3ef
commit 2ff739a6ac

View 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"