wok-tiny rev 106
linux: fix (un)bundle
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 08 23:56:26 2016 +0100 (2016-02-08) |
parents | a41610cab1ff |
children | 93ea2d4c06f3 |
files | linux/stuff/bundle |
line diff
1.1 --- a/linux/stuff/bundle Sun Feb 07 16:00:45 2016 +0100 1.2 +++ b/linux/stuff/bundle Mon Feb 08 23:56:26 2016 +0100 1.3 @@ -83,20 +83,18 @@ 1.4 else 1.5 if [ $(get 0x1F1 "$1" 1) -eq 0 ]; then 1.6 menu=$(get 0x1F2 "$1") 1.7 - [ $(get $(($menu - 3)) "$1") -eq 24937 ] && skip=4 || skip=0 1.8 + [ $(get $(($menu -3)) "$1" 2) -eq 24937 ] && skip=4 || skip=0 1.9 ddq bs=1 skip=$menu count=$((0x1F3 - $menu)) if="$1" | \ 1.10 od -v -t u1 -w1 -An | awk -vx=$skip 'BEGIN { state=0 } 1.11 { 1.12 - if (--bytes == 0) state++ 1.13 - if (state > 3) { state=1; bytes=2; sector=0; mul=1 } 1.14 - if (state == 0 || state == 2) { 1.15 + if (--skip >= 0) next 1.16 + if (--bytes < 0) { 1.17 if ($1 == 0) { 1.18 - if (state == 2) { 1.19 + if (mul > 0) { 1.20 if (sector == 0) exit 1.21 - print sector " " s 1.22 + skip=x; print sector " " s 1.23 } 1.24 - s=""; state++; sector=0; mul=1 1.25 - bytes= (state == 3) ? x+1 : 3 1.26 + s=""; sector=0; mul=1; bytes=2 1.27 } 1.28 else { c=sprintf("%c",$1); s=s c } 1.29 } 1.30 @@ -104,8 +102,15 @@ 1.31 }' | while read s name; do 1.32 cnt=$(get $(($s*512 + 0x1F4)) "$1") 1.33 cnt=$(($cnt+32*(1+$(get $(($s*512 + 0x1F1)) "$1" 1)))) 1.34 + x=0 1.35 + if [ $(get $(($s*512 + 0x202)) "$1" 2) -eq 25672 ]; then 1.36 + x=$(get $(($s*512 + 0x21C)) "$1") 1.37 + [ $x -ne 0 ] && x=$(((($cnt+31)/32)*512+$x)) && 1.38 + cnt=$((($x+15)/16)) 1.39 + fi 1.40 ddq bs=16 skip=$((32*$s)) count=$cnt if="$1" of="$name" 1.41 - ls -l "$name" 1.42 + [ $x -ne 0 ] && ddq bs=1 seek=$x count=0 of="$name" 1.43 + ls -l "$name" 1.44 done 1.45 else 1.46 base_initrd=$(get 0x218 "$1")