wok rev 5564

linux/bootloader.sh: coreutils compatible
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 14 13:34:05 2010 +0200 (2010-05-14)
parents a11358feced4
children 64045763d7ff
files linux/stuff/bootloader.sh
line diff
     1.1 --- a/linux/stuff/bootloader.sh	Fri May 14 11:03:45 2010 +0200
     1.2 +++ b/linux/stuff/bootloader.sh	Fri May 14 13:34:05 2010 +0200
     1.3 @@ -39,10 +39,9 @@
     1.4  # usage: storelong offset data32 file
     1.5  storelong()
     1.6  {
     1.7 -	printf "00000  %02X %02X %02X %02X \n" \
     1.8 -		$(( $2 & 255 )) $(( ($2>>8) & 255 )) \
     1.9 -		$(( ($2>>16) & 255 )) $(( ($2>>24) & 255 )) | \
    1.10 -	hexdump -R | dd bs=1 conv=notrunc of=$3 seek=$(( $1 )) 2> /dev/null
    1.11 +	echo $2 | awk '{ printf "%c%c%c%c",$1%256,($1/256)%256,($1/256/256)%256,
    1.12 +					   ($1/256/256/256)%256 }' | \
    1.13 +	dd bs=1 conv=notrunc of=$3 seek=$(( $1 )) 2> /dev/null
    1.14  }
    1.15  
    1.16  # read a 32 bits data
    1.17 @@ -71,6 +70,7 @@
    1.18  	bs=/tmp/bs$$
    1.19  
    1.20  	# Get and patch boot sector
    1.21 +	# See http://hg.slitaz.org/wok/raw-file/tip/linux/stuff/linux-header-2.6.30.6.u
    1.22  	dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null
    1.23  	uudecode <<EOT | dd of=$bs conv=notrunc 2> /dev/null
    1.24  begin-base64 644 -