mkimage-profiles/features.in/syslinux/scripts.d/20-propagator-ramdisk-syslinux
Anton Midyukov df1d1f8a6c grub, syslynux: rename scripts
The scripts were named the same for syslinux and grub. Because of this,
scripts for syslinux were overwritten by grub scripts.
2020-04-03 22:16:55 +07:00

21 lines
564 B
Bash
Executable File

#!/bin/sh
# postprocess isolinux configuration
# when the image sizes are finally known
# NB: install2_size, live_size, rescue_size get defined here
cd "$WORKDIR"
cfgs="$(find syslinux boot/grub EFI/BOOT -name '*.cfg')"
[ -n "$cfgs" ] || {
echo "${0##*/}: did not find any config under /syslinux or /boot/grub" >&2
exit 1
}
# apply size census while looking for potential squashfs images
find -maxdepth 1 -type f -size +1M \
| sed 's,^\./,,' \
| while read image; do
size="$[ $(stat -c%s "$image") / 1024 + 1 ]"
sed -i "s,@${image}_size@,$size," $cfgs
done