wok-current rev 19323
syslinux: fix isofs checksum
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jul 14 10:16:48 2016 +0200 (2016-07-14) |
parents | 4a7993e37b8d |
children | ec6aef1425c3 |
files | ipxe/stuff/ipxe.cmd syslinux/stuff/extra/md5sum.c syslinux/stuff/iso2exe/init syslinux/stuff/iso2exe/iso2exe.c syslinux/stuff/iso2exe/iso2exe.sh syslinux/stuff/iso2exe/taziso |
line diff
1.1 --- a/ipxe/stuff/ipxe.cmd Wed Jul 13 20:37:50 2016 -0400 1.2 +++ b/ipxe/stuff/ipxe.cmd Thu Jul 14 10:16:48 2016 +0200 1.3 @@ -1,18 +1,20 @@ 1.4 #!ipxe 1.5 1.6 set menu-timeout 3000 1.7 -dhcp || 1.8 +dhcp || echo No DHCP 1.9 1.10 :menu 1.11 -menu SliTaz net boot menu 1.12 +menu SliTaz net boot menu ${ip} ${gateway} ${dns} 1.13 item --key b boot Local boot 1.14 -item --key l lan Your PXE boot 1.15 +item --key l lan Your PXE boot ${filename} 1.16 item --key w web SliTaz WEB boot 1.17 item --key r rolling SliTaz development version 1.18 item --key c config iPXE configuration 1.19 item --key e exit iPXE command line 1.20 choose --timeout ${menu-timeout} --default web target || goto exit 1.21 set menu-timeout 0 1.22 +isset $(ip} || dhcp || echo No DHCP again 1.23 +isset ${dns} || set dns 8.8.8.8 1.24 goto ${target} 1.25 1.26 :boot
2.1 --- a/syslinux/stuff/extra/md5sum.c Wed Jul 13 20:37:50 2016 -0400 2.2 +++ b/syslinux/stuff/extra/md5sum.c Thu Jul 14 10:16:48 2016 +0200 2.3 @@ -739,6 +739,7 @@ 2.4 static int has_custom_config(void) 2.5 { 2.6 const union syslinux_derivative_info *sdi; 2.7 + int retry=0; 2.8 2.9 if (got_config) 2.10 goto done; 2.11 @@ -747,24 +748,27 @@ 2.12 goto fail; 2.13 disk_get_params(sdi->iso.drive_number, &diskinfo); 2.14 custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1); 2.15 - got_config = (16 + *(unsigned long *) (custom_buffer + 80)) 2.16 - * 2048 / diskinfo.bps; 2.17 - free(custom_buffer); 2.18 - custom_buffer = disk_read_sectors(&diskinfo, got_config, 1); 2.19 - if (!memcmp(custom_buffer,"#!boot ",7)) { 2.20 - char *p = custom_buffer+7+32+1; 2.21 + got_config = (*(unsigned long *) (custom_buffer + 80) * 2048) / diskinfo.bps; 2.22 + do { 2.23 + free(custom_buffer); 2.24 + custom_buffer = disk_read_sectors(&diskinfo, got_config, 1); 2.25 + if (!memcmp(custom_buffer,"#!boot ",7)) { 2.26 + char *p = custom_buffer+7+32+1; 2.27 2.28 - if (!memcmp(p,"append=",7)) { 2.29 - custom_cmdline = p + 7; 2.30 - p = strchr(p,'\n'); 2.31 - *p++ = 0; 2.32 - } 2.33 - if (!memcmp(p,"initrd:",7)) { 2.34 - custom_initrdlen = strtoul(p + 7, &custom_initrdbase, 10); 2.35 - custom_initrdbase++; 2.36 - } 2.37 - return 1; 2.38 - } 2.39 + if (!memcmp(p,"append=",7)) { 2.40 + custom_cmdline = p + 7; 2.41 + p = strchr(p,'\n'); 2.42 + *p++ = 0; 2.43 + } 2.44 + if (!memcmp(p,"initrd:",7)) { 2.45 + custom_initrdlen = strtoul(p + 7, &custom_initrdbase, 10); 2.46 + custom_initrdbase++; 2.47 + } 2.48 + return 1; 2.49 + } 2.50 + got_config += 16UL; 2.51 + retry = 1 - retry; 2.52 + } while (retry); 2.53 fail: 2.54 got_config = -1; 2.55 done:
3.1 --- a/syslinux/stuff/iso2exe/init Wed Jul 13 20:37:50 2016 -0400 3.2 +++ b/syslinux/stuff/iso2exe/init Thu Jul 14 10:16:48 2016 +0200 3.3 @@ -724,7 +724,7 @@ 3.4 { 3.5 dotwait "Checking iso image" 3.6 [ "$(ddq if=/mnt/$ISO bs=2k skip=16 \ 3.7 - count=$(echo $(get 32848 /mnt/$ISO 4)) | md5sum)" == \ 3.8 + count=$(($(get 32848 /mnt/$ISO 4)-16)) | md5sum)" == \ 3.9 "$(ddq if=/mnt/$ISO bs=16 count=1 skip=2047 | od -N 16 -t x1 -An | \ 3.10 sed 's/ //g') -" ] && echo "OK" || echo "ERROR" 3.11 echo -en "\rChecking iso hybrid boot..."
4.1 --- a/syslinux/stuff/iso2exe/iso2exe.c Wed Jul 13 20:37:50 2016 -0400 4.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c Thu Jul 14 10:16:48 2016 +0200 4.3 @@ -237,7 +237,7 @@ 4.4 md5_begin(); 4.5 while ((count = read(fd, buffer, BUFFERSZ)) > 0) { 4.6 if (sectors == 0) 4.7 - sectors = LONG(buffer + 80); 4.8 + sectors = LONG(buffer + 80) - 16UL; 4.9 md5_hash(buffer, count); 4.10 if (--sectors == 0) 4.11 break;
5.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh Wed Jul 13 20:37:50 2016 -0400 5.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Thu Jul 14 10:16:48 2016 +0200 5.3 @@ -470,7 +470,7 @@ 5.4 ddq bs=1 seek=$((0x7FDE)) count=15 conv=notrunc of=$1 5.5 if [ $(stat -c %s $1) -gt 34816 ]; then 5.6 echo "Adding ISO image md5 at 7FF0 (16 bytes) ..." 5.7 - echo -en "$(ddq if=$1 bs=2k skip=16 count=$(get 32848 $1 4) | \ 5.8 + echo -en "$(ddq if=$1 bs=2k skip=16 count=$(($(get 32848 "$1" 4)-16)) | \ 5.9 md5sum | cut -c-32 | sed 's/\(..\)/\\x\1/g')" | \ 5.10 ddq bs=16 seek=2047 conv=notrunc of=$1 5.11 fi
6.1 --- a/syslinux/stuff/iso2exe/taziso Wed Jul 13 20:37:50 2016 -0400 6.2 +++ b/syslinux/stuff/iso2exe/taziso Thu Jul 14 10:16:48 2016 +0200 6.3 @@ -898,7 +898,7 @@ 6.4 { 6.5 dotwait "Checking iso image" 6.6 [ "$(ddq if="$ISO" bs=2k skip=16 \ 6.7 - count=$(echo $(get 32848 "$ISO" 4)) | md5sum)" == \ 6.8 + count=$(($(get 32848 "$ISO" 4)-16)) | md5sum)" == \ 6.9 "$(ddq if="$ISO" bs=16 count=1 skip=2047 | od -N 16 -t x1 -An | \ 6.10 sed 's/ //g') -" ] && echo "OK" || echo "ERROR" 6.11 echo -en "\rChecking iso hybrid boot..."