wok diff linld/stuff/src/TAZBOOT.CPP @ rev 21628

linld: more ram for zImage (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 27 23:23:13 2019 +0200 (2019-05-27)
parents 66530154b12f
children c19368210c2b
line diff
     1.1 --- a/linld/stuff/src/TAZBOOT.CPP	Sun May 19 13:14:32 2019 +0200
     1.2 +++ b/linld/stuff/src/TAZBOOT.CPP	Mon May 27 23:23:13 2019 +0200
     1.3 @@ -72,29 +72,29 @@
     1.4  	unsigned long magic;
     1.5  	struct isostate *x=&isostate;
     1.6  	
     1.7 -	if (!*iso || isoreset(*iso) < 0) return;
     1.8 +	if (isoreset(*iso) == -1) return;
     1.9  	skip_alloc++;
    1.10  	base_himem = memtop() /2;
    1.11  	//if (base_himem >= _64m) base_himem = _64m;
    1.12  	if (* ((char *) &base_himem +3) >= 4) base_himem = _64m;
    1.13 -	isoopen("boot") >= 0 ||
    1.14 -	isoopen("live") >= 0 ||	// debian
    1.15 -	isoopen("casper") >= 0;	// ubuntu
    1.16 +	isoopen("boot") != -1 ||
    1.17 +	isoopen("live") != -1 ||	// debian
    1.18 +	isoopen("casper") != -1;	// ubuntu
    1.19  	if (iso[1] && !strcmp(mode = iso[1], "text"))
    1.20  		init = "";
    1.21  	do {
    1.22 -		if ((isoopen(mode) >= 0 && ++noauto != 0) ||	// custom
    1.23 -		    isoopen("bzImage") >= 0		|| 	// SliTaz
    1.24 -		    isoopen("vmlinuz") >= 0		||	// misc
    1.25 -		    (isoopen("linux") >= 0 && ++isknoppix != 0)) {
    1.26 +		if ((isoopen(mode) != -1 && ++noauto != 0) ||	// custom
    1.27 +		    isoopen("bzImage") != -1		|| 	// SliTaz
    1.28 +		    isoopen("vmlinuz") != -1		||	// misc
    1.29 +		    (isoopen("linux") != -1 && ++isknoppix != 0)) {
    1.30  			magic = kver2ul(isokernel());
    1.31  			break;
    1.32  		}
    1.33 -	} while (isoopen("isolinux") >= 0);		// Knoppix
    1.34 +	} while (isoopen("isolinux") != -1);		// Knoppix
    1.35  	for (c = 0, x->curdirsize = 0xFFFF; isoreaddir() != -1;) {
    1.36  		if (strstr(x->filename, ".gz"))
    1.37  			strcpy(fallback, x->filename);
    1.38 -		if (strhead(x->filename, "rootfs") 
    1.39 +		if (strhead(x->filename, "rootfs") == -1
    1.40  			|| c > x->filename[6]) continue;
    1.41  		strcpy(rootfs, x->filename);
    1.42  		c = x->filename[6];
    1.43 @@ -110,9 +110,9 @@
    1.44  		* (int *) buf_cmdline = 0;
    1.45  		iso++;
    1.46  		while ((s = *++iso) != NULL) {
    1.47 -			if (strhead(s,"initrd=")) 
    1.48 +			if (strhead(s,"initrd=") == -1) 
    1.49  				strcatb(buf_cmdline,s);
    1.50 -			else if (isoopen(s+7) >= 0)
    1.51 +			else if (isoopen(s+7) != -1)
    1.52  				addinitrd();
    1.53  		}
    1.54  	}
    1.55 @@ -122,10 +122,10 @@
    1.56  
    1.57  		if (rootfs[0]) {
    1.58  			initrdfilename = rootfs;
    1.59 -			if (rootfs[6] != '.' && isoopen("rootfs.gz") >= 0)
    1.60 +			if (rootfs[6] != '.' && isoopen("rootfs.gz") != -1)
    1.61  				addinitrd();	// for loram
    1.62  		}
    1.63 -		if (isoopen(initrdfilename) >= 0) {
    1.64 +		if (isoopen(initrdfilename) != -1) {
    1.65  			addinitrd();
    1.66  		}
    1.67  		if (*init && isolseek(&initrddesc) != 0) {
    1.68 @@ -202,30 +202,30 @@
    1.69  		else strcatb(buf_cmdline,*argv);	// FIXME mem ?
    1.70  	}
    1.71  #else
    1.72 -		if (strhead(s,"kernel=") == 0) {
    1.73 +		if (strhead(s,"kernel=") != -1) {
    1.74  			s++;
    1.75  	set_kernel:
    1.76  			s += 6;
    1.77  	set_kernelz:
    1.78  			kernel_name = s;
    1.79  		}
    1.80 -		else if (strhead(s,"image=") == 0) {
    1.81 +		else if (strhead(s,"image=") != -1) {
    1.82  			goto set_kernel;
    1.83  		}
    1.84 -		else if (strhead(s,"initrd=") == 0) {
    1.85 +		else if (strhead(s,"initrd=") != -1) {
    1.86  			s += 7;
    1.87  			initrd_name = s;
    1.88  		}
    1.89 -		else if (strhead(s,"bootfrom=") == 0) {
    1.90 +		else if (strhead(s,"bootfrom=") != -1) {
    1.91  			s += 9;
    1.92  	set_iso:
    1.93  			iso = s;
    1.94  		}
    1.95 -		else if (strhead(s,"iso=") == 0) {
    1.96 +		else if (strhead(s,"iso=") != -1) {
    1.97  			s += 4;
    1.98  			goto set_iso;
    1.99  		}
   1.100 -		else if(strhead(s,"vga=") == 0) {
   1.101 +		else if(strhead(s,"vga=") != -1) {
   1.102  			*(u16*)&vid_mode = (u16)strtol(s+4);	// support normal, extended & ask
   1.103  		}
   1.104  	        else switch (*(u16 *)s|0x2002) {
   1.105 @@ -245,10 +245,10 @@
   1.106  		}
   1.107  		else {
   1.108  			strcatb(buf_cmdline,*argv);
   1.109 -			if(strhead(s,"root=") == 0) {
   1.110 +			if(strhead(s,"root=") != -1) {
   1.111  				*(u16*)&root_dev = (u16)strtol(s+5);
   1.112  			}
   1.113 -			if(strhead(s,"mem=") == 0) {
   1.114 +			if(strhead(s,"mem=") != -1) {
   1.115  				s += 4;
   1.116  			set_topmem:
   1.117  				((u16 *)&topmem)[1] = (u16)(strtol(s)>>16);
   1.118 @@ -256,9 +256,9 @@
   1.119  		}}
   1.120  	}
   1.121  #endif
   1.122 -	if (iso && isoreset(iso) >= 0) {
   1.123 +	if (isoreset(iso) != -1) {
   1.124  		char *s = (char *) initrd_name;
   1.125 -		if (isoopen((char *) kernel_name) >= 0) {
   1.126 +		if (isoopen((char *) kernel_name) != -1) {
   1.127  			isokernel();
   1.128  		}
   1.129  		if (s) {
   1.130 @@ -266,7 +266,7 @@
   1.131  				char *p, c;
   1.132  				for (p = s; *s && *s != ','; s++);
   1.133  				c = *s; *s = 0;
   1.134 -				if (isoopen(p) >= 0) {
   1.135 +				if (isoopen(p) != -1) {
   1.136  					addinitrd();
   1.137  				}
   1.138  				*s = c;