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)
This commit is contained in:
Michael Shigorin 2011-08-22 21:37:21 +03:00
parent 3a5b47e712
commit 3d10c59d2b
7 changed files with 43 additions and 6 deletions

View File

@ -15,3 +15,13 @@
+ если добавить какой-либо kernel-image в STAGE1_PACKAGES*,
результат может быть неожиданным
+ вероятная ошибка: незагрузка полученного squashfs
- features.in/install2/install2/stage2cfg.mk
- features.in/live/live/stage2cfg.mk
- features.in/rescue/rescue/stage2cfg.mk
- features.in/syslinux/cfg.in/15live.cfg
- features.in/syslinux/cfg.in/20install2.cfg
- features.in/syslinux/cfg.in/80rescue.cfg
- features.in/syslinux/scripts.d/20-propagator-ramdisk
+ ожидают, что названия squashfs-образов второй стадии инсталятора,
livecd и спасательной системы соответственно altinst, live и rescue

View File

@ -32,6 +32,19 @@ all:
fi; \
fi; \
done; \
for scripts in scripts.d image-scripts.d; do \
if test -d "$(BUILDDIR)/$$scripts" -a \
-d "$$dir/$$scripts"; then \
if rsync -qab "$$dir/$$scripts/" \
"$(BUILDDIR)/$$scripts/"; then \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/$$scripts/" && \
git add . && \
git commit -qam "$$dir feature (toplevel $$scripts)" ||:; \
popd; \
fi; \
fi; \
done; \
if test -x "$$dir/generate.sh"; then \
pushd "$$dir" && \
sh generate.sh; \

View File

@ -1,5 +1,4 @@
label live
menu label ^LiveCD (no hard disk needed)
kernel alt0/vmlinuz
append initrd=alt0/full.cz live ramdisk_size=72000 fastboot stagename=live showopts automatic=method:cdrom
### FIXME: see m-p-d::profiles/scripts.d/03-syslinux
append initrd=alt0/full.cz live ramdisk_size=@live_size@ fastboot stagename=live showopts automatic=method:cdrom

View File

@ -1,8 +1,8 @@
label linux
menu label ^Install ALT Linux
kernel alt0/vmlinuz
append initrd=alt0/full.cz changedisk vga=0x314 quiet=1 showopts automatic=method:cdrom
append initrd=alt0/full.cz ramdisk_size=@altinst_size@ changedisk vga=0x314 quiet=1 showopts automatic=method:cdrom
label noapic
menu label ^Failsafe install
kernel alt0/vmlinuz
append initrd=alt0/full.cz changedisk showopts nolapic noapic
append initrd=alt0/full.cz ramdisk_size=@altinst_size@ changedisk showopts nolapic noapic

View File

@ -1,5 +1,4 @@
label rescue
menu label ^Rescue LiveCD
kernel alt0/vmlinuz
append initrd=alt0/full.cz live ramdisk_size=72000 fastboot stagename=rescue showopts automatic=method:cdrom
### FIXME: see m-p-d::profiles/scripts.d/03-syslinux
append initrd=alt0/full.cz live ramdisk_size=@rescue_size@ fastboot stagename=rescue showopts automatic=method:cdrom

View File

@ -0,0 +1,13 @@
#!/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

View File

@ -34,3 +34,6 @@ grep -hv '^#' .in/[0-9][0-9]*.cfg > "$BOOTLOADER.cfg"
# snippets are not going into the actual image
if test "$DEBUG" != 2; then rm -r .in/; fi
# NB: there will be final macro expansion based on actual image sizes
# (done by ../../scripts.d/10-propagator-ramdisk)