mkimage-profiles/features.in/grub/scripts.d/20-propagator-ramdisk-grub

21 lines
531 B
Plaintext
Raw Normal View History

2019-10-30 20:36:22 +03:00
#!/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 EFI/BOOT -name '*.cfg')"
[ -n "$cfgs" ] || {
echo "${0##*/}: did not find any config under EFI/BOOT " >&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