From: Javier Martinez Canillas Date: Fri, 9 Mar 2018 17:54:49 +0000 (+0100) Subject: 51-dracut-rescue.install: fix initramfs not generated in /boot case X-Git-Tag: 048~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8c24964cdde2b8c1569ab33225108573682d3b7;p=thirdparty%2Fdracut.git 51-dracut-rescue.install: fix initramfs not generated in /boot case Commit 5e574046e76e ("5?-dracut*.install: Allow scripts to install the initramfs in /boot dir") added support to generate initramfs images in the /boot directory and copy the respective BLS files. Unfortunately, it broke the rescue initramfs generation when it's not installed on /boot due not checking for the correct condition. It checks for the 0-rescue sub-dir to exist, but this is created so instead if the parent sub-dir exists has to be checked. Also, check if the destination directory is /boot or not, instead if it exists. Signed-off-by: Javier Martinez Canillas --- diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install index 3f07a698f..679e94b1b 100755 --- a/51-dracut-rescue.install +++ b/51-dracut-rescue.install @@ -63,7 +63,7 @@ if ! [[ ${BOOT_OPTIONS[*]} ]]; then exit 1 fi -if [[ -d "$BOOT_DIR_ABS" ]]; then +if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then BOOT_DIR="/${MACHINE_ID}/0-rescue" BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR} LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf" @@ -106,7 +106,7 @@ case "$COMMAND" in ((ret+=$?)) fi - if [[ -d "$BOOT_DIR" ]]; then + if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then { echo "title $PRETTY_NAME - Rescue Image" echo "version $KERNEL_VERSION"