wok rev 24276
Up lzsa (1.3.10)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jan 03 17:58:48 2022 +0000 (2022-01-03) |
parents | c903329801b8 |
children | db3b4d40d037 |
files | lzsa/receipt syslinux/receipt syslinux/stuff/iso2exe/iso2exe.sh syslinux/stuff/iso2exe/taziso syslinux/stuff/tools/isohybrid.sh |
line diff
1.1 --- a/lzsa/receipt Mon Jan 03 10:32:43 2022 +0100 1.2 +++ b/lzsa/receipt Mon Jan 03 17:58:48 2022 +0000 1.3 @@ -1,7 +1,7 @@ 1.4 # SliTaz package receipt. 1.5 1.6 PACKAGE="lzsa" 1.7 -VERSION="1.3.9" 1.8 +VERSION="1.3.10" 1.9 CATEGORY="system-tools" 1.10 SHORT_DESC="Efficient packer optimized for fast decompression on 8-bit cpu." 1.11 MAINTAINER="pascal.bellard@slitaz.org"
2.1 --- a/syslinux/receipt Mon Jan 03 10:32:43 2022 +0100 2.2 +++ b/syslinux/receipt Mon Jan 03 17:58:48 2022 +0000 2.3 @@ -156,7 +156,8 @@ 2.4 for i in $(grep -ls boot/isolinux/isolinux.cfg \ 2.5 $1/var/lib/tazpkg/installed/*/receipt); do 2.6 pkg=$(basename ${i%/*}) 2.7 - [ "$pkg" = "$PACKAGE" ] || 2.8 + [ "$pkg" != "$PACKAGE" ] && 2.9 + echo "Reconfigue $pkg ..." && 2.10 root=/ chroot "$1/" tazpkg reconfigure $pkg 2.11 done 2.12 }
3.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh Mon Jan 03 10:32:43 2022 +0100 3.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Mon Jan 03 17:58:48 2022 +0000 3.3 @@ -68,13 +68,18 @@ 3.4 [ $(get 0 $2) -eq 35615 ] || return 3.5 zcat $2 | compress /tmp/rezipped$$.gz 3.6 n=$(stat -c %s /tmp/rezipped$$.gz) 3.7 - printf "Moving tazlito data record at %04X ($n bytes) ...\n" $OFS 3.8 - ddn if=/tmp/rezipped$$.gz bs=1 of=$1 seek=$OFS 3.9 - HOLE=$((HOLE+n)) 3.10 + if [ $(get 2048 $1) -eq 19792 -a $n -lt 412 ]; then ### Apple partitions 3.11 + o=$((0x1200-n)) 3.12 + else 3.13 + o=$OFS 3.14 + HOLE=$((HOLE+n)) 3.15 + fi 3.16 + printf "Moving tazlito data record at %04X ($n bytes) ...\n" $o 3.17 + ddn if=/tmp/rezipped$$.gz bs=1 of=$1 seek=$o 3.18 rm -f /tmp/rezipped$$.gz 3.19 if [ -n "$gpt" ]; then 3.20 store $((0x25E)) $n $1 3.21 - store $((0x25C)) $OFS $1 3.22 + store $((0x25C)) $o $1 3.23 fi 3.24 } 3.25 3.26 @@ -239,7 +244,7 @@ 3.27 $(get $((446+4+16*i)) "$1" 1) 3.28 done 3.29 if [ $(get 450 "$1") -eq 65262 ]; then 3.30 - echo "EFI partitions :" 3.31 + echo "EFI partitions :" ### https://en.wikipedia.org/wiki/GUID_Partition_Table 3.32 n=$(get 592 "$1") 3.33 s=$(get 596 "$1") 3.34 o=$(($(get 584 "$1")*512)) 3.35 @@ -258,7 +263,7 @@ 3.36 fi 3.37 o=2048 3.38 if [ $(get $o "$1") -eq 19792 ]; then 3.39 - echo "Apple partitions :" 3.40 + echo "Apple partitions :" ### https://en.wikipedia.org/wiki/Apple_Partition_Map 3.41 i=0 3.42 while [ $(get $o "$1") -eq 19792 ]; do 3.43 f=$((0x$(od -An -N 4 -j $((o+8)) -t x1 "$1" | sed 's/ //g')))
4.1 --- a/syslinux/stuff/iso2exe/taziso Mon Jan 03 10:32:43 2022 +0100 4.2 +++ b/syslinux/stuff/iso2exe/taziso Mon Jan 03 17:58:48 2022 +0000 4.3 @@ -1125,16 +1125,17 @@ 4.4 0 0 0 \ 4.5 $(for i in $DEV ; do 4.6 grep -qs 1 /sys/block/$i/ro || 4.7 + [ $(cat /sys/block/$i/size) -lt 100 ] || 4.8 echo -n "/dev/$i \"$(($(cat /sys/block/$i/size)/2048))MB $(cat /sys/block/$i/device/model 2> /dev/null)\" " 4.9 done) \ 4.10 4.11 EOT 4.12 exec 3>&1 4.13 - device=$(. /tmp/dialog$$ 2>&1 1>&3) 4.14 - rm -f /tmp/dialog$$ 4.15 + . /tmp/dialog$$ 2>&1 1>&3 2>/tmp/device$$ 4.16 retval=$? 4.17 + device=$(cat /tmp/device$$) 4.18 + rm -f /tmp/dialog$$ /tmp/device$$ 4.19 exec 3>&- 4.20 - rm -f /tmp/dialog$$ 4.21 [ $retval -eq 0 ] 4.22 } 4.23 4.24 @@ -1145,84 +1146,6 @@ 4.25 able to save the package updates or your own configuration and data files.\n\n" 4.26 } 4.27 4.28 -gpt_crc32() 4.29 -{ 4.30 - t0=00000000; t1=77073096; t2=EE0E612C; t3=990951BA; 4.31 - t4=076DC419; t5=706AF48F; t6=E963A535; t7=9E6495A3; 4.32 - t8=0EDB8832; t9=79DCB8A4; t10=E0D5E91E; t11=97D2D988; 4.33 - t12=09B64C2B; t13=7EB17CBD; t14=E7B82D07; t15=90BF1D91; 4.34 - t16=1DB71064; t17=6AB020F2; t18=F3B97148; t19=84BE41DE; 4.35 - t20=1ADAD47D; t21=6DDDE4EB; t22=F4D4B551; t23=83D385C7; 4.36 - t24=136C9856; t25=646BA8C0; t26=FD62F97A; t27=8A65C9EC; 4.37 - t28=14015C4F; t29=63066CD9; t30=FA0F3D63; t31=8D080DF5; 4.38 - t32=3B6E20C8; t33=4C69105E; t34=D56041E4; t35=A2677172; 4.39 - t36=3C03E4D1; t37=4B04D447; t38=D20D85FD; t39=A50AB56B; 4.40 - t40=35B5A8FA; t41=42B2986C; t42=DBBBC9D6; t43=ACBCF940; 4.41 - t44=32D86CE3; t45=45DF5C75; t46=DCD60DCF; t47=ABD13D59; 4.42 - t48=26D930AC; t49=51DE003A; t50=C8D75180; t51=BFD06116; 4.43 - t52=21B4F4B5; t53=56B3C423; t54=CFBA9599; t55=B8BDA50F; 4.44 - t56=2802B89E; t57=5F058808; t58=C60CD9B2; t59=B10BE924; 4.45 - t60=2F6F7C87; t61=58684C11; t62=C1611DAB; t63=B6662D3D; 4.46 - t64=76DC4190; t65=01DB7106; t66=98D220BC; t67=EFD5102A; 4.47 - t68=71B18589; t69=06B6B51F; t70=9FBFE4A5; t71=E8B8D433; 4.48 - t72=7807C9A2; t73=0F00F934; t74=9609A88E; t75=E10E9818; 4.49 - t76=7F6A0DBB; t77=086D3D2D; t78=91646C97; t79=E6635C01; 4.50 - t80=6B6B51F4; t81=1C6C6162; t82=856530D8; t83=F262004E; 4.51 - t84=6C0695ED; t85=1B01A57B; t86=8208F4C1; t87=F50FC457; 4.52 - t88=65B0D9C6; t89=12B7E950; t90=8BBEB8EA; t91=FCB9887C; 4.53 - t92=62DD1DDF; t93=15DA2D49; t94=8CD37CF3; t95=FBD44C65; 4.54 - t96=4DB26158; t97=3AB551CE; t98=A3BC0074; t99=D4BB30E2; 4.55 - t100=4ADFA541; t101=3DD895D7; t102=A4D1C46D; t103=D3D6F4FB; 4.56 - t104=4369E96A; t105=346ED9FC; t106=AD678846; t107=DA60B8D0; 4.57 - t108=44042D73; t109=33031DE5; t110=AA0A4C5F; t111=DD0D7CC9; 4.58 - t112=5005713C; t113=270241AA; t114=BE0B1010; t115=C90C2086; 4.59 - t116=5768B525; t117=206F85B3; t118=B966D409; t119=CE61E49F; 4.60 - t120=5EDEF90E; t121=29D9C998; t122=B0D09822; t123=C7D7A8B4; 4.61 - t124=59B33D17; t125=2EB40D81; t126=B7BD5C3B; t127=C0BA6CAD; 4.62 - t128=EDB88320; t129=9ABFB3B6; t130=03B6E20C; t131=74B1D29A; 4.63 - t132=EAD54739; t133=9DD277AF; t134=04DB2615; t135=73DC1683; 4.64 - t136=E3630B12; t137=94643B84; t138=0D6D6A3E; t139=7A6A5AA8; 4.65 - t140=E40ECF0B; t141=9309FF9D; t142=0A00AE27; t143=7D079EB1; 4.66 - t144=F00F9344; t145=8708A3D2; t146=1E01F268; t147=6906C2FE; 4.67 - t148=F762575D; t149=806567CB; t150=196C3671; t151=6E6B06E7; 4.68 - t152=FED41B76; t153=89D32BE0; t154=10DA7A5A; t155=67DD4ACC; 4.69 - t156=F9B9DF6F; t157=8EBEEFF9; t158=17B7BE43; t159=60B08ED5; 4.70 - t160=D6D6A3E8; t161=A1D1937E; t162=38D8C2C4; t163=4FDFF252; 4.71 - t164=D1BB67F1; t165=A6BC5767; t166=3FB506DD; t167=48B2364B; 4.72 - t168=D80D2BDA; t169=AF0A1B4C; t170=36034AF6; t171=41047A60; 4.73 - t172=DF60EFC3; t173=A867DF55; t174=316E8EEF; t175=4669BE79; 4.74 - t176=CB61B38C; t177=BC66831A; t178=256FD2A0; t179=5268E236; 4.75 - t180=CC0C7795; t181=BB0B4703; t182=220216B9; t183=5505262F; 4.76 - t184=C5BA3BBE; t185=B2BD0B28; t186=2BB45A92; t187=5CB36A04; 4.77 - t188=C2D7FFA7; t189=B5D0CF31; t190=2CD99E8B; t191=5BDEAE1D; 4.78 - t192=9B64C2B0; t193=EC63F226; t194=756AA39C; t195=026D930A; 4.79 - t196=9C0906A9; t197=EB0E363F; t198=72076785; t199=05005713; 4.80 - t200=95BF4A82; t201=E2B87A14; t202=7BB12BAE; t203=0CB61B38; 4.81 - t204=92D28E9B; t205=E5D5BE0D; t206=7CDCEFB7; t207=0BDBDF21; 4.82 - t208=86D3D2D4; t209=F1D4E242; t210=68DDB3F8; t211=1FDA836E; 4.83 - t212=81BE16CD; t213=F6B9265B; t214=6FB077E1; t215=18B74777; 4.84 - t216=88085AE6; t217=FF0F6A70; t218=66063BCA; t219=11010B5C; 4.85 - t220=8F659EFF; t221=F862AE69; t222=616BFFD3; t223=166CCF45; 4.86 - t224=A00AE278; t225=D70DD2EE; t226=4E048354; t227=3903B3C2; 4.87 - t228=A7672661; t229=D06016F7; t230=4969474D; t231=3E6E77DB; 4.88 - t232=AED16A4A; t233=D9D65ADC; t234=40DF0B66; t235=37D83BF0; 4.89 - t236=A9BCAE53; t237=DEBB9EC5; t238=47B2CF7F; t239=30B5FFE9; 4.90 - t240=BDBDF21C; t241=CABAC28A; t242=53B39330; t243=24B4A3A6; 4.91 - t244=BAD03605; t245=CDD70693; t246=54DE5729; t247=23D967BF; 4.92 - t248=B3667A2E; t249=C4614AB8; t250=5D681B02; t251=2A6F2B94; 4.93 - t252=B40BBE37; t253=C30C8EA1; t254=5A05DF1B; t255=2D02EF8D; 4.94 - crc=$((0xFFFFFFFF)) 4.95 - dd if=$device bs=1 skip=$(($1)) count=$(($2)) 2> /dev/null | \ 4.96 - od -v -w1 -t u1 -An | { 4.97 - while read n; do 4.98 - local x=$(((crc ^ n) & 255)) 4.99 - eval x=0x\$t$x 4.100 - crc=$((((crc >> 8) & 0x00FFFFFF) ^ x)) 4.101 - done 4.102 - echo $((crc ^ 0xFFFFFFFF)) 4.103 - } 4.104 -} 4.105 - 4.106 usbbootkey() 4.107 { 4.108 if [ -b "$1" ]; then 4.109 @@ -1267,7 +1190,7 @@ 4.110 [ $custom -gt $((last-4)) ] && last=$((custom+4)) # room for cmdline 4.111 quads2bin $last 0 | ddq bs=1 seek=$((1024+128+32)) of=$device # vfat first address 4.112 quads2bin $((sectors-2)) 0 | ddq bs=1 seek=$((1024+128+40)) of=$device # vfat last address 4.113 - quads2bin $(gpt_crc32 1024 $(($(get 596 $device 4)*$(get 592 $device 4)))) | \ 4.114 + quads2bin $(isohybrid --crc32 $device 1024 $(($(get 596 $device 4)*$(get 592 $device 4)))) | \ 4.115 ddq bs=1 seek=$((512+88)) of=$device # CRC32 partitions 4.116 ddn of=$device if=$device bs=512 skip=1 seek=$sectors count=1 4.117 ddn of=$device if=$device bs=512 skip=2 seek=$((sectors-1)) count=1 4.118 @@ -1275,9 +1198,9 @@ 4.119 quads2bin 1 0 $sectors 0 | ddq bs=1 seek=$((512+24)) of=$device # my gpt, alt gpt 4.120 quads2bin $((sectors-1)) 0 | ddq bs=1 seek=$((sectors*512+72)) of=$device 4.121 i=$(get 524 $device 4) 4.122 - quads2bin $(gpt_crc32 $((sectors*512)) $i) | \ 4.123 + quads2bin $(isohybrid --crc32 $device $((sectors*512)) $i) | \ 4.124 ddq bs=1 seek=$((sectors*512+16)) of=$device # CRC32 header 4.125 - quads2bin $(gpt_crc32 512 $i) | ddq bs=1 seek=$((512+16)) of=$device # CRC32 header 4.126 + quads2bin $(isohybrid --crc32 $device 512 $i) | ddq bs=1 seek=$((512+16)) of=$device # CRC32 header 4.127 partprobe $device 4.128 homedev=/dev/$(basename /sys/block/${device#/dev/}/${device#/dev/}*2) 4.129 mkdosfs -n 'SLITAZ HOME' $homedev
5.1 --- a/syslinux/stuff/tools/isohybrid.sh Mon Jan 03 10:32:43 2022 +0100 5.2 +++ b/syslinux/stuff/tools/isohybrid.sh Mon Jan 03 17:58:48 2022 +0000 5.3 @@ -10,90 +10,6 @@ 5.4 sed -i '/--build/,/^fi/d' $0 5.5 exit 5.6 fi 5.7 -iso= 5.8 -heads=64 # zipdrive-style geometry 5.9 -sectors=32 5.10 -partype=23 # "Windows hidden IFS" 5.11 -entry= 5.12 -id=$(( ($RANDOM <<16) + $RANDOM)) 5.13 -offset=0 5.14 -partok=0 5.15 -hd0=0 5.16 -always=0 5.17 - 5.18 -while [ -n "$1" ]; do 5.19 - case "${1/--/-}" in 5.20 - -a*) always=1;; 5.21 - -ct*) hd0=2;; 5.22 - -e*) entry=$2; shift;; 5.23 - -f*) hd0=1;; 5.24 - -h) heads=$2; shift;; 5.25 - -i*) id=$(($2)); shift;; 5.26 - -noh*) hd0=0;; 5.27 - -nop*) partok=0;; 5.28 - -o*) offset=$(($2)); shift;; 5.29 - -p*) partok=1;; 5.30 - -s) sectors=$2; shift;; 5.31 - -t*) partype=$(($2 & 255)); shift;; 5.32 - *) iso=$1;; 5.33 - esac 5.34 - shift 5.35 -done 5.36 - 5.37 -if [ ! -f "$iso" ]; then 5.38 - cat << EOT 5.39 -usage: $0 [options] isoimage 5.40 -options: 5.41 - -h <X> Number of default geometry heads 5.42 - -s <X> Number of default geometry sectors 5.43 - -e --entry Specify partition entry number (1-4) 5.44 - -o --offset Specify partition offset (default 0) 5.45 - -t --type Specify partition type (default 0x17) 5.46 - -i --id Specify MBR ID (default random) 5.47 - --forcehd0 Assume we are loaded as disk ID 0 5.48 - --ctrlhd0 Assume disk ID 0 if the Ctrl key is pressed 5.49 - --partok Allow booting from within a partition 5.50 - --always Do not abort on errors 5.51 -EOT 5.52 - exit 1 5.53 -fi 5.54 - 5.55 -ddq() 5.56 -{ 5.57 - dd "$@" 2> /dev/null 5.58 -} 5.59 - 5.60 -readiso() 5.61 -{ 5.62 - ddq bs=2k skip=$1 count=1 if=$iso | ddq bs=1 skip=$2 count=$3 5.63 -} 5.64 - 5.65 -# read a 32 bits data 5.66 -read32() 5.67 -{ 5.68 - readiso $1 $2 4 | od -N 4 -t u4 -An 5.69 -} 5.70 - 5.71 -# read a 16 bits data 5.72 -read16() 5.73 -{ 5.74 - readiso $1 $2 2 | od -N 2 -t u2 -An 5.75 -} 5.76 - 5.77 -# read a 8 bits data 5.78 -read8() 5.79 -{ 5.80 - readiso $1 $2 1 | od -N 1 -t u1 -An 5.81 -} 5.82 - 5.83 -# write a 32 bits data 5.84 -store32() 5.85 -{ 5.86 - n=$2; for i in 0 8 16 24; do 5.87 - printf '\\\\x%02X' $((($n >> $i) & 255)) 5.88 - done | xargs echo -en | ddq bs=1 conv=notrunc of=$iso seek=$(($1)) 5.89 -} 5.90 - 5.91 crc32() 5.92 { 5.93 t0=00000000; t1=77073096; t2=EE0E612C; t3=990951BA; 5.94 @@ -172,6 +88,91 @@ 5.95 } 5.96 } 5.97 5.98 +iso= 5.99 +heads=64 # zipdrive-style geometry 5.100 +sectors=32 5.101 +partype=23 # "Windows hidden IFS" 5.102 +entry= 5.103 +id=$(( ($RANDOM <<16) + $RANDOM)) 5.104 +offset=0 5.105 +partok=0 5.106 +hd0=0 5.107 +always=0 5.108 + 5.109 +while [ -n "$1" ]; do 5.110 + case "${1/--/-}" in 5.111 + -crc32) iso=$2; crc32 $3 $4; exit 0;; 5.112 + -a*) always=1;; 5.113 + -ct*) hd0=2;; 5.114 + -e*) entry=$2; shift;; 5.115 + -f*) hd0=1;; 5.116 + -h) heads=$2; shift;; 5.117 + -i*) id=$(($2)); shift;; 5.118 + -noh*) hd0=0;; 5.119 + -nop*) partok=0;; 5.120 + -o*) offset=$(($2)); shift;; 5.121 + -p*) partok=1;; 5.122 + -s) sectors=$2; shift;; 5.123 + -t*) partype=$(($2 & 255)); shift;; 5.124 + *) iso=$1;; 5.125 + esac 5.126 + shift 5.127 +done 5.128 + 5.129 +if [ ! -f "$iso" ]; then 5.130 + cat << EOT 5.131 +usage: $0 [options] isoimage 5.132 +options: 5.133 + -h <X> Number of default geometry heads 5.134 + -s <X> Number of default geometry sectors 5.135 + -e --entry Specify partition entry number (1-4) 5.136 + -o --offset Specify partition offset (default 0) 5.137 + -t --type Specify partition type (default 0x17) 5.138 + -i --id Specify MBR ID (default random) 5.139 + --forcehd0 Assume we are loaded as disk ID 0 5.140 + --ctrlhd0 Assume disk ID 0 if the Ctrl key is pressed 5.141 + --partok Allow booting from within a partition 5.142 + --always Do not abort on errors 5.143 +EOT 5.144 + exit 1 5.145 +fi 5.146 + 5.147 +ddq() 5.148 +{ 5.149 + dd "$@" 2> /dev/null 5.150 +} 5.151 + 5.152 +readiso() 5.153 +{ 5.154 + ddq bs=2k skip=$1 count=1 if=$iso | ddq bs=1 skip=$2 count=$3 5.155 +} 5.156 + 5.157 +# read a 32 bits data 5.158 +read32() 5.159 +{ 5.160 + readiso $1 $2 4 | od -N 4 -t u4 -An 5.161 +} 5.162 + 5.163 +# read a 16 bits data 5.164 +read16() 5.165 +{ 5.166 + readiso $1 $2 2 | od -N 2 -t u2 -An 5.167 +} 5.168 + 5.169 +# read a 8 bits data 5.170 +read8() 5.171 +{ 5.172 + readiso $1 $2 1 | od -N 1 -t u1 -An 5.173 +} 5.174 + 5.175 +# write a 32 bits data 5.176 +store32() 5.177 +{ 5.178 + n=$2; for i in 0 8 16 24; do 5.179 + printf '\\\\x%02X' $((($n >> $i) & 255)) 5.180 + done | xargs echo -en | ddq bs=1 conv=notrunc of=$iso seek=$(($1)) 5.181 +} 5.182 + 5.183 main() 5.184 { 5.185 uudecode | unlzma | ddq bs=512 count=1 of=$iso conv=notrunc \