wok-6.x rev 18779

syslinux/isohybrid.exe: fix config md5
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 01 19:26:32 2016 +0100 (2016-01-01)
parents d2513bef6240
children ec7b15533c2d
files syslinux/stuff/iso2exe/iso2exe.c
line diff
     1.1 --- a/syslinux/stuff/iso2exe/iso2exe.c	Fri Jan 01 16:02:21 2016 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c	Fri Jan 01 19:26:32 2016 +0100
     1.3 @@ -262,6 +262,14 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 +static void clear_config(unsigned i)
     1.8 +{
     1.9 +	for (;i % 512; i++) {
    1.10 +		/* clear custom config */
    1.11 +		write(fd, buffer + 2048, 2048);
    1.12 +	}
    1.13 +}
    1.14 +
    1.15  static unsigned install(char *filename)
    1.16  {
    1.17  #define heads 64
    1.18 @@ -300,10 +308,7 @@
    1.19  		}
    1.20  		i = getcustomsector();
    1.21  		lseek(fd, i * 2048UL, SEEK_SET);
    1.22 -		for (;i % 512; i++) {
    1.23 -			/* clear custom config */
    1.24 -			write(fd, buffer + 2048, 2048);
    1.25 -		}
    1.26 +		clear_config(i);
    1.27  		ftruncate(fd, i * 2048UL);
    1.28  		close(fd);
    1.29  		status = 0;
    1.30 @@ -313,6 +318,8 @@
    1.31  	if (append || initrd) {
    1.32  		unsigned long pos = getcustomsector() * 2048UL;
    1.33  		lseek(fd, pos, SEEK_SET);
    1.34 +		clear_config(pos);
    1.35 +		lseek(fd, pos, SEEK_SET);
    1.36  		write(fd, "#!boot 00000000000000000000000000000000\n", 40);
    1.37  		md5_begin();
    1.38  		if (append) {
    1.39 @@ -356,7 +363,7 @@
    1.40  		}
    1.41  		md5_end();
    1.42  		{
    1.43 -			static char h[] = "0123456789ABCDEF";
    1.44 +			static char h[] = "0123456789abcdef";
    1.45  			char string[32], *s = string + 30;
    1.46  			unsigned char *p = (void *) hash;
    1.47