# HG changeset patch # User Pascal Bellard # Date 1273836845 -7200 # Node ID d1ef2016ba848349d72e0c2c434718e175740f28 # Parent a11358feced4985639400fe533c7e30153bfb5ca linux/bootloader.sh: coreutils compatible diff -r a11358feced4 -r d1ef2016ba84 linux/stuff/bootloader.sh --- a/linux/stuff/bootloader.sh Fri May 14 11:03:45 2010 +0200 +++ b/linux/stuff/bootloader.sh Fri May 14 13:34:05 2010 +0200 @@ -39,10 +39,9 @@ # usage: storelong offset data32 file storelong() { - printf "00000 %02X %02X %02X %02X \n" \ - $(( $2 & 255 )) $(( ($2>>8) & 255 )) \ - $(( ($2>>16) & 255 )) $(( ($2>>24) & 255 )) | \ - hexdump -R | dd bs=1 conv=notrunc of=$3 seek=$(( $1 )) 2> /dev/null + echo $2 | awk '{ printf "%c%c%c%c",$1%256,($1/256)%256,($1/256/256)%256, + ($1/256/256/256)%256 }' | \ + dd bs=1 conv=notrunc of=$3 seek=$(( $1 )) 2> /dev/null } # read a 32 bits data @@ -71,6 +70,7 @@ bs=/tmp/bs$$ # Get and patch boot sector + # See http://hg.slitaz.org/wok/raw-file/tip/linux/stuff/linux-header-2.6.30.6.u dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null uudecode < /dev/null begin-base64 644 -