slitaz-arm rev 208

piboot: rpi2 support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 23 10:38:14 2016 +0100 (2016-03-23)
parents 1d2bad01f3d3
children fc34c01e1405
files rpi/piboot
line diff
     1.1 --- a/rpi/piboot	Sat Aug 08 23:42:01 2015 +0200
     1.2 +++ b/rpi/piboot	Wed Mar 23 10:38:14 2016 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4  #
     1.5  # /sbin/piboot: SliTaz Raspberry Pi bootloader and web boot!
     1.6  #
     1.7 -# (C) 2014 SliTaz GNU/Linux - ...
     1.8 +# (C) 2014-2016 SliTaz GNU/Linux - ...
     1.9  #
    1.10  # usage: insert 'rdinit=/sbin/piboot' (if you load an initramfs)
    1.11  # or 'init=/sbin/piboot' in the kernel command line /boot/cmdline.txt
    1.12 @@ -121,8 +121,9 @@
    1.13  	webpath=$(get webpath $mnt/menu.txt)
    1.14  	[ "$webpath" ] || webpath=http://mirror.slitaz.org/pxe/arm/boot.php
    1.15  	for url in ${webpath//,/ }; do
    1.16 -		wget -O /root/webboot.sh \
    1.17 -		  "$url?mac=$(cat /sys/class/net/eth0/address)" 2>&1 > /dev/null
    1.18 +		wget -O /root/webboot.sh "$url?mac=$(cat \
    1.19 +			/sys/class/net/eth0/address /sys/class/net/*/address \
    1.20 +			| sed q)" 2>&1 > /dev/null
    1.21  		[ -s /root/webboot.sh ] || continue
    1.22  		. /root/webboot.sh
    1.23  		webprefix=$(dirname $url)
    1.24 @@ -163,11 +164,6 @@
    1.25  BOOTDEV=$(cmdlinearg bootdev)
    1.26  mnt=/mnt
    1.27  mount -t devtmpfs /dev /dev
    1.28 -
    1.29 -# A dirty hack: why devtmpfs does not mount ? 
    1.30 -# pankso@20140421: It mount fine on my side
    1.31 -[ -b /dev/mmcblk0p1 ] || mknod -m 660 /dev/mmcblk0p1 b 179 1
    1.32 -
    1.33  mount -r /dev/${BOOTDEV:-mmcblk0p1} $mnt
    1.34  umount /dev
    1.35  
    1.36 @@ -214,6 +210,7 @@
    1.37  for i in $mnt/*/ ; do
    1.38  	KERNEL="$(get kernel $i/config.txt)"
    1.39  	[ -z "$KERNEL" ] && [ -s $i/kernel.img ] && KERNEL="kernel.img"
    1.40 +	[ -z "$KERNEL" ] && [ -s $i/menu.txt ] && KERNEL="../kernel.img"
    1.41  	[ "$KERNEL" ] || continue
    1.42  	n=$(($n+1))
    1.43  	eval KERNEL_$n="\$KERNEL"
    1.44 @@ -290,6 +287,11 @@
    1.45  	eval CMDLINE="\$CMDLINE_$n"
    1.46  	eval SAVEDEFAULT="\$SAVEDEFAULT_$n"
    1.47  
    1.48 +	grep -qs ARMv6 /proc/cpuinfo || case "$KERNEL" in
    1.49 +	*BCM*|*7*)	;;
    1.50 +	*)	KERNEL=${KERNEL/.img/7.img}
    1.51 +	esac
    1.52 +
    1.53  	if [ "$webprefix" ]; then
    1.54  		cd /root
    1.55  		web_get $webprefix/$KEYWORD/$KERNEL vmlinuz