wok rev 19872

linld/tazboot: fix magic (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 30 18:01:42 2017 +0200 (2017-03-30)
parents 7144509c7473
children c9c88c0a2ae5
files linld/stuff/src/ISO9660.H linld/stuff/src/TAZBOOT.CPP syslinux/stuff/iso2exe/bootiso.S syslinux/stuff/iso2exe/init
line diff
     1.1 --- a/linld/stuff/src/ISO9660.H	Thu Mar 30 17:22:13 2017 +0200
     1.2 +++ b/linld/stuff/src/ISO9660.H	Thu Mar 30 18:01:42 2017 +0200
     1.3 @@ -8,9 +8,9 @@
     1.4  #define DIRSECTORSZ	(SECTORSZ/256)
     1.5  extern struct isostate {
     1.6  	int fd;
     1.7 +	unsigned short filemod;
     1.8  	unsigned long fileofs;
     1.9  	unsigned long filesize;
    1.10 -	unsigned short filemod;
    1.11  	char *filename;
    1.12  //private
    1.13  	dirsizetype curdirsize, dirsize;
     2.1 --- a/linld/stuff/src/TAZBOOT.CPP	Thu Mar 30 17:22:13 2017 +0200
     2.2 +++ b/linld/stuff/src/TAZBOOT.CPP	Thu Mar 30 18:01:42 2017 +0200
     2.3 @@ -118,7 +118,7 @@
     2.4  	}
     2.5  	else if (magic > 0) {
     2.6  		char *initrd = fallback;
     2.7 -		static const unsigned long initrddesc = 20L;
     2.8 +		static const unsigned long initrddesc = 18L;
     2.9  
    2.10  		if (rootfs[0]) {
    2.11  			initrd = rootfs;
    2.12 @@ -129,8 +129,8 @@
    2.13  			addinitrd();
    2.14  		}
    2.15  		if (*init && isolseek(&initrddesc) != -1) {
    2.16 -			read(x->fd, &x->fileofs, 8); // and x->filesize
    2.17 -			magic = x->filesize;
    2.18 +			read(x->fd, &x->filemod, 10); // + x->fileofs & x->filesize
    2.19 +			magic = x->filemod;
    2.20  			x->fileofs &= 0xFFFFL;
    2.21  			x->fileofs -= 0xC0L + (x->filesize &= 0xFFFF);
    2.22  			if (((short *) &x->fileofs)[1] == 0) addinitrd();
     3.1 --- a/syslinux/stuff/iso2exe/bootiso.S	Thu Mar 30 17:22:13 2017 +0200
     3.2 +++ b/syslinux/stuff/iso2exe/bootiso.S	Thu Mar 30 18:01:42 2017 +0200
     3.3 @@ -20,6 +20,7 @@
     3.4  	.word	4064-(CODESZ/16)	// Maximum extra paragraphs needed
     3.5  	.word	0xFFF0			// Initial (relative) SS value
     3.6  	.word	0xFFFE			// Initial SP value
     3.7 +magic:
     3.8  	.word	0			// Checksum
     3.9  	.word	EXEADRS(exestart)	// Initial IP value
    3.10  	.word	0xFFF0			// Initial (relative) CS value
     4.1 --- a/syslinux/stuff/iso2exe/init	Thu Mar 30 17:22:13 2017 +0200
     4.2 +++ b/syslinux/stuff/iso2exe/init	Thu Mar 30 18:01:42 2017 +0200
     4.3 @@ -138,7 +138,7 @@
     4.4  
     4.5  checkmagic()
     4.6  {
     4.7 -	[ -s $1 ] && [ $(getarg magic) == $(get 24 $1 4) ]
     4.8 +	[ -s $1 ] && [ $(getarg magic) == $(get 18 $1 2) ]
     4.9  }
    4.10  
    4.11  getiso()