wok-next diff syslinux/stuff/iso2exe/iso2exe.c @ rev 17813
syslinux/iso2exe: update partition table (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 21 15:26:13 2015 +0100 (2015-03-21) |
parents | 24b07aa2fafd |
children | ea9f391548cf |
line diff
1.1 --- a/syslinux/stuff/iso2exe/iso2exe.c Tue Feb 10 13:31:26 2015 +0100 1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c Sat Mar 21 15:26:13 2015 +0100 1.3 @@ -29,7 +29,7 @@ 1.4 } 1.5 } 1.6 1.7 -static int domd5 = 0; 1.8 +static int skipmd5 = 0; 1.9 #define ALIGN1 1.10 1.11 typedef struct { 1.12 @@ -268,7 +268,7 @@ 1.13 readsector(0UL); 1.14 n = BUFFERSZ; 1.15 if (WORD(buffer) == 23117) { 1.16 - readsector((unsigned long) buffer[69]); 1.17 + readsector((unsigned long) buffer[417]); 1.18 n = 0; 1.19 } 1.20 lseek(fd, 0UL, SEEK_SET); 1.21 @@ -294,7 +294,7 @@ 1.22 readsector(lba); 1.23 if (LONG(buffer + 64) != 1886961915UL) 1.24 return HYBRIDERR; 1.25 - isohybrid = bootiso[69] * 512; 1.26 + isohybrid = bootiso[417] * 512; 1.27 LONG(bootiso + isohybrid + 432) = lba * 4; 1.28 LONG(bootiso + isohybrid + 440) = rand(); 1.29 LONG(bootiso + isohybrid + partition) = 0x10080UL; 1.30 @@ -322,35 +322,30 @@ 1.31 } 1.32 1.33 /* Install iso2exe boot sector */ 1.34 - WORD(bootiso + 26) = rand(); 1.35 + LONG(bootiso + 440) = time(NULL); 1.36 1.37 /* read tazlito flavor data */ 1.38 lseek(fd, 1024UL, SEEK_SET); 1.39 read(fd, tazlitoinfo, sizeof(tazlitoinfo)); 1.40 1.41 /* Update iso image */ 1.42 - n = (bootiso[69] + 1) * 512; 1.43 + n = (bootiso[417] + 1) * 512; 1.44 lseek(fd, 0UL, SEEK_SET); 1.45 write(fd, bootiso, n); /* EXE/PE + isohybrid mbr */ 1.46 write(fd, tazlitoinfo, sizeof(tazlitoinfo)); 1.47 write(fd, bootiso + n, BOOTISOSZ - n); /* COM + rootfs + EXE/DOS */ 1.48 1.49 - if (domd5) { 1.50 + /* Compute the boot checksums */ 1.51 + if (!skipmd5) { 1.52 puts(bootiso + MD5MSG); 1.53 md5sum(); 1.54 - } 1.55 - 1.56 - /* Compute the boot checksums */ 1.57 - if ((WORD(bootiso + 64) = chksum(66, 32768)) != 0) { 1.58 - if (domd5) { 1.59 - lseek(fd, 0UL, SEEK_SET); 1.60 - write(fd, bootiso, 512); 1.61 - n = WORD(bootiso + 2) - 512*(WORD(bootiso + 4) - 1); 1.62 - WORD(bootiso + 18) = chksum(0, (unsigned short) n) - 1; 1.63 - } 1.64 lseek(fd, 0UL, SEEK_SET); 1.65 write(fd, bootiso, 512); 1.66 + n = WORD(bootiso + 2) - 512*(WORD(bootiso + 4) - 1); 1.67 + WORD(bootiso + 18) = chksum(0, (unsigned short) n) - 1; 1.68 } 1.69 + lseek(fd, 0UL, SEEK_SET); 1.70 + write(fd, bootiso, 512); 1.71 close(fd); 1.72 status = 0; 1.73 return SUCCESSMSG; 1.74 @@ -364,7 +359,7 @@ 1.75 while ((unsigned)(*s - '-') <= ('/' - '-')) s++; 1.76 switch (*s | 0x20) { 1.77 case 'f' : forced++; break; 1.78 - case 'm' : domd5++; break; 1.79 + case 'q' : skipmd5++; break; 1.80 case 'u' : uninstall++; break; 1.81 } 1.82 }