wok-next diff syslinux/stuff/iso2exe/init @ rev 17635
syslinux-tools: add taziso
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 14 18:17:26 2015 +0100 (2015-02-14) |
parents | 52c9cc2da3c6 |
children | 17923f312c4e |
line diff
1.1 --- a/syslinux/stuff/iso2exe/init Tue Feb 10 08:53:27 2015 +0100 1.2 +++ b/syslinux/stuff/iso2exe/init Sat Feb 14 18:17:26 2015 +0100 1.3 @@ -298,12 +298,12 @@ 1.4 sleep 5 1.5 return 1 1.6 fi 1.7 - dowait "Install root filesystem in /slitaz.." 1.8 + dotwait "Install root filesystem in /slitaz.." 1.9 if [ "$1" ]; then 1.10 if [ -d /media/cdrom/fs ]; then 1.11 ( cd /mnt/slitaz/fs; find | cpio -o -H newc ) | gzip -9 1.12 else 1.13 - ls_r /media/cdrom/boot/rootfs* | xargs cat 1.14 + ls_r /media/cdrom/boot/rootfs*gz | xargs cat 1.15 fi > /mnt/slitaz/boot/rootfs.gz 1.16 tazusbinitfs /mnt/slitaz/boot/rootfs.gz 1.17 initrd=rootfs.gz 1.18 @@ -316,18 +316,18 @@ 1.19 [ -s $(basename $i) ] && continue 1.20 cpio -i $i 1.21 done 1.22 - for i in $(ls_r /media/cdrom/boot/rootfs*); do 1.23 + for i in $(ls_r /media/cdrom/boot/rootfs*gz); do 1.24 mount -o loop,ro $i /sqfs/mnt 1.25 cp -a /sqfs/mnt/. /mnt/slitaz 1.26 umount -d /sqfs/mnt 1.27 done 1.28 else 1.29 - for i in $(ls_r /media/cdrom/boot/rootfs*); do 1.30 + for i in $(ls_r /media/cdrom/boot/rootfs*gz); do 1.31 uncpio $i /mnt/slitaz 1.32 done 1.33 fi 1.34 - cp -a /etc/locale.conf /tmp/slitaz/etc 2> /dev/null 1.35 - cp -a /etc/keymap.conf /tmp/slitaz/etc 2> /dev/null 1.36 + cp -a /etc/locale.conf /mnt/slitaz/etc 2> /dev/null 1.37 + cp -a /etc/keymap.conf /mnt/slitaz/etc 2> /dev/null 1.38 mkinitrd /mnt/slitaz/boot/initrd 1.39 initrd=initrd 1.40 extraargs="mount=$(getuuid) subroot=slitaz" 1.41 @@ -413,7 +413,7 @@ 1.42 if [ -d /media/cdrom/fs ]; then 1.43 cp -a /media/cdrom/fs/. / 1.44 else 1.45 - for i in $(ls_r /media/cdrom/boot/rootfs*); do 1.46 + for i in $(ls_r /media/cdrom/boot/rootfs*gz); do 1.47 uncpio $i 1.48 done 1.49 fi 1.50 @@ -466,8 +466,8 @@ 1.51 1.52 gotcdfile() 1.53 { 1.54 - for i in /media/cdrom/$1 /media/cdrom/*/$1 \ 1.55 - /media/cdrom/*/isolinux/$1 ; do 1.56 + for i in "/media/cdrom/$1" "/media/cdrom/*/$1" \ 1.57 + "/media/cdrom/*/isolinux/$1" ; do 1.58 file=$(ls $i 2> /dev/null | sed q) 1.59 [ -s "$file" ] && break 1.60 done 1.61 @@ -475,14 +475,14 @@ 1.62 1.63 sha() 1.64 { 1.65 - gotcdfile sha*sum* 1.66 + gotcdfile "sha*sum*" 1.67 sha=$(basename $file) 1.68 md5 "${sha%sum*}sum -c ${file#/media/cdrom/}" 1.69 } 1.70 1.71 readme() 1.72 { 1.73 - gotcdfile README* 1.74 + gotcdfile "README*" 1.75 $DIALOG --clear \ 1.76 --title " Readme " \ 1.77 --textbox $file 24 78 1.78 @@ -518,7 +518,7 @@ 1.79 computers. BIOS based memory tests are a quick, cursory check and often 1.80 miss many of the failures that are detected by Memtest86.\n 1.81 " 12 70 1.82 - [ $? -eq 0 ] && gotcdfile memtest* && cp $file /mnt/memtest.exe 1.83 + [ $? -eq 0 ] && gotcdfile "memtest*" && cp $file /mnt/memtest.exe 1.84 } 1.85 1.86 mkfat12() 1.87 @@ -563,12 +563,12 @@ 1.88 miss many of the failures that are detected by Memtest86.\n\n 1.89 Please insert a blank disk in floppy drive.\n 1.90 " 12 70 1.91 - [ $? -eq 0 ] && gotcdfile memtest* && mkfloppy $file 1.92 + [ $? -eq 0 ] && gotcdfile "memtest*" && mkfloppy $file 1.93 } 1.94 1.95 pxe() 1.96 { 1.97 - gotcdfile ?pxe 1.98 + gotcdfile "?pxe" 1.99 $DIALOG --clear \ 1.100 --title " Create $(basename $file).exe ? " \ 1.101 --yes-label "Install" --yesno \ 1.102 @@ -592,7 +592,7 @@ 1.103 from the Web using PXE and HTTP protocols.\n\n 1.104 Please insert a blank disk in floppy drive.\n 1.105 " 12 70 1.106 - [ $? -eq 0 ] && gotcdfile ?pxe && mkfloppy $file 1.107 + [ $? -eq 0 ] && gotcdfile "?pxe" && mkfloppy $file 1.108 } 1.109 1.110 gotposixovl() 1.111 @@ -648,21 +648,24 @@ 1.112 gotisomd5() 1.113 { 1.114 [ "$(which md5sum 2> /dev/null)" ] && 1.115 - [ $(get 18 /dev/loop0) -ne 0 ] && echo -en "\"$1\" \"$2\"" 1.116 + [ $(get 0 /mnt/$ISO) -eq 23117 ] && 1.117 + [ $(get 18 /mnt/$ISO) -ne 0 ] && echo -en "\"$1\" \"$2\"" 1.118 } 1.119 1.120 isomd5() 1.121 { 1.122 dotwait "Checking iso image" 1.123 - [ "$(ddq if=/dev/loop0 bs=2k skip=16 \ 1.124 - count=$(echo $(get 32848 /dev/loop0 4)) | md5sum)" == \ 1.125 - "$(ddq if=/dev/loop0 bs=16 count=1 skip=2047 | od -N 16 -t x1 -An | \ 1.126 + [ "$(ddq if=/mnt/$ISO bs=2k skip=16 \ 1.127 + count=$(echo $(get 32848 /mnt/$ISO 4)) | md5sum)" == \ 1.128 + "$(ddq if=/mnt/$ISO bs=16 count=1 skip=2047 | od -N 16 -t x1 -An | \ 1.129 sed 's/ //g') -" ] && echo "OK" || echo "ERROR" 1.130 - echo -en "\rChecking iso hybrid boot" 1.131 - n=$(($(get 2 /dev/loop0)-1+($(get 4 /dev/loop0)-1)*512)) 1.132 - s=$(get 0 /dev/loop0 2 $n | awk '{ i+= $0 } END { print i }') 1.133 - [ $(((1+$s+$(get $(($n+1)) /dev/loop0 1)) % 65536)) -eq 0 ] && 1.134 - echo "OK" || echo "ERROR" 1.135 + echo -en "\rChecking iso hybrid boot..." 1.136 + n=$(($(get 2 /mnt/$ISO)-1+($(get 4 /mnt/$ISO)-1)*512)) 1.137 + if [ $n -lt 40000 -a $n -gt 32768 ]; then 1.138 + s=$(get 0 /mnt/$ISO 2 $n | awk '{ i+= $0 } END { print i }') 1.139 + [ $(((1+$s+$(get $(($n+1)) /mnt/$ISO 1)) % 65536)) -eq 0 ] && 1.140 + echo "OK" || echo "ERROR" 1.141 + fi 1.142 rm -f /tmp/wait 1.143 echo -e "\rPress RETURN to continue." 1.144 read n 1.145 @@ -878,12 +881,12 @@ 1.146 1.147 runmemtest() 1.148 { 1.149 - gotcdfile memtest* && dokexec 1.150 + gotcdfile "memtest*" && dokexec 1.151 } 1.152 1.153 runpxe() 1.154 { 1.155 - gotcdfile ?pxe && dokexec 1.156 + gotcdfile "?pxe" && dokexec 1.157 } 1.158 1.159 shell() 1.160 @@ -919,10 +922,10 @@ 1.161 $(xfile tazlocale "tazlocale" "Select locale (${locale:-none})") \ 1.162 $(cdfile boot/bzImage "live" "Linux RAM boot (full desktop)") \ 1.163 "text" "Linux RAM boot" \ 1.164 -$(cdfile README* "readme" "Show the README file") \ 1.165 +$(cdfile "README*" "readme" "Show the README file") \ 1.166 $(gotisomd5 "isomd5" "Check the ISO image") \ 1.167 -$(cdfile md5sum* "md5" "Check the ISO files") \ 1.168 -$(cdfile sha*sum* "sha" "Check the ISO files") \ 1.169 +$(cdfile "md5sum*" "md5" "Check the ISO files") \ 1.170 +$(cdfile "sha*sum*" "sha" "Check the ISO files") \ 1.171 $(gotposixovl "install" "Hard disk installation (UMSDOS way)") \ 1.172 $(gotposixovl "installtaz" "Hard disk installation (TAZUSB way)") \ 1.173 $(xfile tazusb "usbkey" "USB key read/write installation") \ 1.174 @@ -930,12 +933,12 @@ 1.175 $(fddata "fdbootstrap" "Create a floppy bootstrap") \ 1.176 "tazboot" "Get tazboot.exe Linux loader" \ 1.177 $(cdexe boot/bzImage "bzimage" "Get linux DOS/EXE file") \ 1.178 -$(cdexe memtest* "memtest" "Get Memtest86 DOS/EXE file") \ 1.179 -$(cdfilef memtest* "fdmemtest" "Create a Memtest86 boot floppy") \ 1.180 -$(cdfilex memtest* "runmemtest" "Start Memtest86") \ 1.181 -$(cdexe ?pxe "pxe" "Get SliTaz Web boot DOS/EXE utility") \ 1.182 -$(cdfilef ?pxe "fdpxe" "Create a SliTaz Web boot floppy") \ 1.183 -$(cdfilex ?pxe "runpxe" "Start the SliTaz Web boot utility") \ 1.184 +$(cdexe "memtest*" "memtest" "Get Memtest86 DOS/EXE file") \ 1.185 +$(cdfilef "memtest*" "fdmemtest" "Create a Memtest86 boot floppy") \ 1.186 +$(cdfilex "memtest*" "runmemtest" "Start Memtest86") \ 1.187 +$(cdexe "?pxe" "pxe" "Get SliTaz Web boot DOS/EXE utility") \ 1.188 +$(cdfilef "?pxe" "fdpxe" "Create a SliTaz Web boot floppy") \ 1.189 +$(cdfilex "?pxe" "runpxe" "Start the SliTaz Web boot utility") \ 1.190 $(xfile reboot "restart" "Restart the computer") \ 1.191 $(xfile poweroff "stop" "Power off") \ 1.192 "bootlog" "Linux boot messages" \