mkimage-profiles/features.in/syslinux/scripts.d/20-propagator-ramdisk-syslinux
Anton Midyukov 83109b6bc4 syslinux: Add grub-pc compatibility
Directory syslinux can exist if using memtest feature.
2021-02-15 17:05:54 +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
# validate just in case (see also stage1 Makefile)
if [ -z "$(find $WORKDIR/syslinux/*.cfg)" ]; then
echo "Warning: syslinux/*.cfg not found"
exit 0
fi
cd "$WORKDIR"
# 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," syslinux/*.cfg
done