mkimage-profiles/features.in/syslinux/scripts.d/20-propagator-ramdisk
Michael Shigorin 3d10c59d2b test-based ramdisk size for live squashfs images
Implementation based on m-p-d::profiles/scripts.d/03-syslinux
(but heavily modified for m-p of course)
2011-11-04 16:15:30 +02:00

14 lines
351 B
Bash
Executable File

#!/bin/sh -x
# postprocess isolinux configuration
# when the image sizes are finally known
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