wok rev 16002
syslinux/iso2exe: fix 16M hole
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Mar 04 09:23:30 2014 +0000 (2014-03-04) |
parents | 9fdf99385a95 |
children | 109be9bea982 |
files | syslinux-tools/receipt syslinux/stuff/iso2exe/README syslinux/stuff/iso2exe/boot.c syslinux/stuff/iso2exe/bootlinux.c |
line diff
1.1 --- a/syslinux-tools/receipt Sun Mar 02 19:13:19 2014 +0100 1.2 +++ b/syslinux-tools/receipt Tue Mar 04 09:23:30 2014 +0000 1.3 @@ -20,4 +20,5 @@ 1.4 done 1.5 cp -a $src/iso2exe/isohybrid.exe $fs/usr/share/boot 1.6 cp -a $src/iso2exe/meminfo.exe $fs/usr/share/boot 1.7 + find $fs/usr -exec chown root.root {} \; 1.8 }
2.1 --- a/syslinux/stuff/iso2exe/README Sun Mar 02 19:13:19 2014 +0100 2.2 +++ b/syslinux/stuff/iso2exe/README Tue Mar 04 09:23:30 2014 +0000 2.3 @@ -79,15 +79,12 @@ 2.4 Limitations: 2.5 2.6 - Only DOS 3, 4 and 6 boot supported. Checked with http://www.allbootdisks.com/ 2.7 - NT support via boot device creation. 2.8 + NT/XP support via boot device creation. 2.9 2.10 - Real mode support only. VM86 is not supported. Will not boot directly, but 2.11 a removable boot media is created. 2.12 2.13 -- Image/zImage format not supported, bzImage only. Can't boot memtest or gpxe. 2.14 - 2.15 -- The tiny Linux loader can't load more than 15Mb of files. (not really a 2.16 - problem since many-in-1 ISO format). 2.17 +- Image/zImage format not supported, bzImage only. Can't boot memtest or ipxe. 2.18 2.19 - The DOS Linux loader and the ISO initramfs must fit in ~30Kb. 2.20
3.1 --- a/syslinux/stuff/iso2exe/boot.c Sun Mar 02 19:13:19 2014 +0100 3.2 +++ b/syslinux/stuff/iso2exe/boot.c Tue Mar 04 09:23:30 2014 +0000 3.3 @@ -25,7 +25,7 @@ 3.4 static void bootiso(char **iso) 3.5 { 3.6 char *init = "rdinit=/init.exe", *mode="menu"; 3.7 - char c, *s, rootfs[16], cmdline[256]; 3.8 + char c, rootfs[16], cmdline[256]; 3.9 int fd, restart; 3.10 unsigned long magic; 3.11 3.12 @@ -33,9 +33,10 @@ 3.13 if (iso[1] && !strcmp(mode = iso[1], "text")) 3.14 init = ""; 3.15 for (c = 0, restart = 1; isoreaddir(restart) == 0; restart = 0) { 3.16 - if (strncmp(isofilename, "rootfs", 6) || c > s[6]) continue; 3.17 + if (strncmp(isofilename, "rootfs", 6) 3.18 + || c > isofilename[6]) continue; 3.19 strcpy(rootfs, isofilename); 3.20 - c = s[6]; 3.21 + c = isofilename[6]; 3.22 } 3.23 if (isoopen(mode)) 3.24 isoopen("bzImage"); 3.25 @@ -69,6 +70,11 @@ 3.26 static char *iso; 3.27 static int fakeopen(char *file) 3.28 { 3.29 + if (file) { 3.30 + char *s = file; 3.31 + while (*s && *s != '\r' && *s != '\n') s++; 3.32 + *s = 0; 3.33 + } 3.34 if (iso) { 3.35 isoreset(iso); 3.36 return isoopen(file); 3.37 @@ -141,6 +147,12 @@ 3.38 while (*s && *s != ' ') s++; 3.39 *s = 0; 3.40 } 3.41 + if (cmdline) { 3.42 + char *last; 3.43 + for (s = cmdline; *s && *s != '\r' && *s != '\n'; s++) 3.44 + if (*s != ' ') last = s; 3.45 + *++last = 0; 3.46 + } 3.47 if (fakeopen(kernel) == -1) 3.48 usage(argv[0]); 3.49 loadkernel();
4.1 --- a/syslinux/stuff/iso2exe/bootlinux.c Sun Mar 02 19:13:19 2014 +0100 4.2 +++ b/syslinux/stuff/iso2exe/bootlinux.c Tue Mar 04 09:23:30 2014 +0000 4.3 @@ -128,9 +128,10 @@ 4.4 } 4.5 p->align = PAGE_SIZE; 4.6 break; 4.7 - case 4096: // first initrd : skip mapping hole before 16M 4.8 - initrd_addr = (extendedramsizeinkb() > 24000U) ? 4.9 - 0x1000000 : p->base; 4.10 + case PAGE_SIZE: // first initrd : skip mapping hole before 16M 4.11 + if (extendedramsizeinkb() > 24000U && p->base < 0x1000000) 4.12 + p->base = 0x1000000; 4.13 + initrd_addr = p->base; 4.14 p->align = 4; 4.15 } 4.16 while (size) {