slitaz-arm rev 124

rpiboot: add russian dolls support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 21 09:30:46 2014 +0000 (2014-04-21)
parents 89c21345e633
children 9eaec6507b65
files rpi/piboot
line diff
     1.1 --- a/rpi/piboot	Mon Apr 21 09:13:53 2014 +0000
     1.2 +++ b/rpi/piboot	Mon Apr 21 09:30:46 2014 +0000
     1.3 @@ -232,13 +232,26 @@
     1.4  	if [ "$webprefix" ]; then
     1.5  		cd /root
     1.6  		wget $webprefix/$KEYWORD/$KERNEL
     1.7 -		wget $webprefix/$KEYWORD/$INITRD
     1.8 +		for i in ${INITRD//,/ }; do
     1.9 +			wget -O - $webprefix/$KEYWORD/$i >> /root/rootfs.gz
    1.10 +			n=$(stat -c %s /root/rootfs.gz)
    1.11 +			n=$(($n % 4))
    1.12 +			[ $n -eq 0 ] && continue
    1.13 +			dd if=/dev/zero bs=1 count=$((4 - $n)) >> /root/rootfs.gz
    1.14 +		done
    1.15  	else
    1.16  		cd $mnt/$KEYWORD
    1.17 -		cp $KERNEL $INITRD /root
    1.18 +		cp $KERNEL /root
    1.19 +		for i in ${INITRD//,/ }; do
    1.20 +			cat $i >> /root/rootfs.gz
    1.21 +			n=$(stat -c %s /root/rootfs.gz)
    1.22 +			n=$(($n % 4))
    1.23 +			[ $n -eq 0 ] && continue
    1.24 +			dd if=/dev/zero bs=1 count=$((4 - $n)) >> /root/rootfs.gz
    1.25 +		done
    1.26  		cd /root
    1.27  	fi
    1.28 -	[ "$INITRD" ] && INITRD="--initrd $(basename $INITRD)"
    1.29 +	[ "$INITRD" ] && INITRD="--initrd rootfs.gz"
    1.30  	[ "$CMDLINE" ] && CMDLINE="--command-line \"$CMDLINE\""
    1.31  
    1.32  	kexec -l $(basename $KERNEL) $INITRD $CMDLINE --atags