mkimage-profiles/features.in/syslinux/scripts.d/20-propagator-rescue-hash-syslinux
Anton Midyukov 00283166b7 syslinux: fixed for using BOOTLOADER not equal syslinux
Do not create syslinux.cfg if EFI_BOOTLOADER is set to not equal grub-efi.
2020-04-03 22:56:58 +07:00

17 lines
393 B
Bash
Executable File

#!/bin/sh
# postprocess isolinux configuration
# to add rescue image hash, if any
# (for propagator in forensic mode)
cd "$WORKDIR"
[ -d "syslinux" ] || exit 0
grep -qs "@rescue_hash@" syslinux/*.cfg || exit 0
find -maxdepth 1 -type f -name rescue \
| while read image; do
rescue_hash="$(sha256sum -b "$image" | cut -f1 -d' ')"
sed -i "s,@rescue_hash@,$rescue_hash," syslinux/*.cfg
done