Commit a2fcc601 authored by Michael Shigorin's avatar Michael Shigorin

syslinux: process @rescue_hash@ (forensic mode)

This value is used to authenticate rescue rootfs image by verifying the squashfs file's sha256sum before use (propagator-20140419+). Looks like this check might be useful for other stage2 images as well but let's get started with this one. Thanks Maxim Suhanov <suhanov/group-ib.ru> for both http://www.forensicswiki.org/wiki/Forensic_Live_CD_issues and propagator patches.
parent 635018aa
label rescue_forensic
menu label ^Forensic mode (leave disks alone)
kernel alt0/vmlinuz
append initrd=alt0/full.cz fastboot live showopts automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue forensic
append initrd=alt0/full.cz fastboot live showopts automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue forensic hash=@rescue_hash@
#!/bin/sh
# postprocess isolinux configuration
# to add rescue image hash, if any
# (for propagator in forensic mode)
cd "$WORKDIR"
grep -qs "@rescue_hash@" syslinux/*.cfg || exit 0
find -maxdepth 1 -type f -name rescue \
| while read image; do
rescue_hash="$(sha256sum -b "$image" | cut -f1 -d' ')"
sed -i "s,@rescue_hash@,$rescue_hash," syslinux/*.cfg
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment