wok-next diff syslinux/stuff/iso2exe/init @ rev 14264
syslinux/iso2exe: fix initrd offset
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Apr 01 09:45:40 2013 +0200 (2013-04-01) |
parents | 692d9593f959 |
children | ff85ea851c53 |
line diff
1.1 --- a/syslinux/stuff/iso2exe/init Sun Mar 31 22:55:34 2013 +0100 1.2 +++ b/syslinux/stuff/iso2exe/init Mon Apr 01 09:45:40 2013 +0200 1.3 @@ -5,8 +5,7 @@ 1.4 get() 1.5 { 1.6 od -j $1 -N ${3:-2} -t u${3:-2} -An $2 2> /dev/null || 1.7 - dd if=$2 bs=1 skip=$1 count=${3:-2} 2> /dev/null | \ 1.8 - hexdump -e "\"\" 1/${3:-2} \"%d\"" 1.9 + hexdump -s $1 -n ${3:-2} -e "\"\" 1/${3:-2} \"%d\"" $2 1.10 } 1.11 1.12 getarg() 1.13 @@ -296,7 +295,7 @@ 1.14 1.15 fdbootstrap() 1.16 { 1.17 - sz=$(echo $(od -j 28 -N 1 -t u1 -An /mnt/$ISO)) 1.18 + sz=$(echo $(get 28 /mnt/$ISO 1)) 1.19 if [ 0$sz -eq 0 ]; then 1.20 $DIALOG --clear \ 1.21 --title " No floppy bootstrap available " \ 1.22 @@ -314,7 +313,7 @@ 1.23 " 10 70 1.24 [ $? -eq 0 ] || return 1.25 dd if=/mnt/$ISO of=/dev/fd0 bs=1 count=$(($sz * 512)) \ 1.26 - skip=$(( $(od -j 60 -N 4 -t u4 -An) - ($sz * 512) )) 1.27 + skip=$(( $(get 66 /mnt/$ISO) - ($sz * 512) )) 1.28 echo "$ISO" | dd of=/dev/fd0 bs=512 seek=1 1.29 fi 1.30 }