wok diff memtest/stuff/pack @ rev 13289
memtest: optionnal linux header (disabled)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Aug 26 11:33:29 2012 +0200 (2012-08-26) |
parents | 3fd2f1836a8c |
children | 288cb68b9302 |
line diff
1.1 --- a/memtest/stuff/pack Sun Aug 26 00:21:22 2012 +0200 1.2 +++ b/memtest/stuff/pack Sun Aug 26 11:33:29 2012 +0200 1.3 @@ -1,9 +1,12 @@ 1.4 #!/bin/sh 1.5 if [ "$1" == "--build" ]; then 1.6 + bin=${2:-unpack.bin} 1.7 cat >> $0 <<EOM 1.8 -$(gzip -9 < ${2:-unpack.bin} | uuencode -m -) 1.9 +$(gzip -9 < $bin | uuencode -m -) 1.10 EOT 1.11 EOM 1.12 + getip=0x$(grep getip ${bin/.bin/.lst} | sed '$!d;s/.*t:\([^ ]*\).*/\1/') 1.13 + sed -i "s/XXX/$((515+$getip))/" $0 1.14 sed -i '/--build/,/^fi/d' $0 1.15 exit 1.16 fi 1.17 @@ -26,12 +29,12 @@ 1.18 { 1.19 dd if=$1 bs=512 count=1 >$2 1.20 uudecode | gunzip >>$2 1.21 - setup="$( echo $(od -j 497 -N 1 -dAn $1))" 1.22 + setup="$(echo $(od -j 497 -N 1 -dAn $1))" 1.23 syssize="$(echo $(od -j 500 -N 2 -dAn $1))" 1.24 dd if=$1 bs=512 count=$setup skip=1 | compress >>$2 1.25 dd if=$1 bs=16 count=$syssize skip=$((32*(1+$setup))) | compress >>$2 1.26 size=$(stat -c %s $2) 1.27 - store $((($size-512)/16)) $2 520 2 1.28 + store $((($size-512)/16)) $2 XXX 2 1.29 store $((($size-2560)/16)) $2 500 2 1.30 store 4 $2 497 1 1.31 }