# HG changeset patch # User Pascal Bellard # Date 1398072646 0 # Node ID 2bed449c8905ef5d0686952116ca34125a7fd693 # Parent 89c21345e633137288b3a82af98055cef9aa3600 rpiboot: add russian dolls support diff -r 89c21345e633 -r 2bed449c8905 rpi/piboot --- a/rpi/piboot Mon Apr 21 09:13:53 2014 +0000 +++ b/rpi/piboot Mon Apr 21 09:30:46 2014 +0000 @@ -232,13 +232,26 @@ if [ "$webprefix" ]; then cd /root wget $webprefix/$KEYWORD/$KERNEL - wget $webprefix/$KEYWORD/$INITRD + for i in ${INITRD//,/ }; do + wget -O - $webprefix/$KEYWORD/$i >> /root/rootfs.gz + n=$(stat -c %s /root/rootfs.gz) + n=$(($n % 4)) + [ $n -eq 0 ] && continue + dd if=/dev/zero bs=1 count=$((4 - $n)) >> /root/rootfs.gz + done else cd $mnt/$KEYWORD - cp $KERNEL $INITRD /root + cp $KERNEL /root + for i in ${INITRD//,/ }; do + cat $i >> /root/rootfs.gz + n=$(stat -c %s /root/rootfs.gz) + n=$(($n % 4)) + [ $n -eq 0 ] && continue + dd if=/dev/zero bs=1 count=$((4 - $n)) >> /root/rootfs.gz + done cd /root fi - [ "$INITRD" ] && INITRD="--initrd $(basename $INITRD)" + [ "$INITRD" ] && INITRD="--initrd rootfs.gz" [ "$CMDLINE" ] && CMDLINE="--command-line \"$CMDLINE\"" kexec -l $(basename $KERNEL) $INITRD $CMDLINE --atags