wok diff syslinux/stuff/iso2exe/iso2exe.sh @ rev 18909

Add gnubg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 22 21:29:18 2016 +0100 (2016-02-22)
parents f937073af512
children dbf4eeed945f
line diff
     1.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Sun Feb 14 22:06:06 2016 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Mon Feb 22 21:29:18 2016 +0100
     1.3 @@ -46,7 +46,8 @@
     1.4  #		2> /dev/null && echo "Store mount.posixovl ($(wc -c \
     1.5  #			< /usr/sbin/mount.posixovl) bytes) ..."
     1.6  	find $TMP -type f -print0 | xargs -0 chmod +x
     1.7 -	( cd $TMP ; find * | cpio -o -H newc ) | compress $TMP/rootfs.gz
     1.8 +	( cd $TMP ; find * | grep -v rootfs.gz | cpio -o -H newc ) | \
     1.9 +		compress $TMP/rootfs.gz
    1.10  	SIZE=$(wc -c < $TMP/rootfs.gz)
    1.11  	store 24 $SIZE $1
    1.12  	OFS=$(( $OFS - $SIZE ))
    1.13 @@ -245,9 +246,9 @@
    1.14  #ifndef __MSDOS__
    1.15  static char $name[] = {
    1.16  /* head */
    1.17 -$(hexdump -v -n $HSZ -e '"    " 16/1 "0x%02X, "' -e '"  // %04.4_ax |" 16/1 "%_p" "| \n"' $DATA | sed 's/ 0x  ,/      /g')
    1.18 +$(hexdump -v -n $HSZ -e '"    " 16/1 "0x%02X, "' -e '"  /* %04.4_ax */ \n"' $DATA | sed 's/ 0x  ,/      /g')
    1.19  /* tail */
    1.20 -$(hexdump -v -s $OFS -e '"    " 16/1 "0x%02X, "' -e '"  // %04.4_ax |" 16/1 "%_p" "| \n"' $DATA | sed 's/ 0x  ,/      /g')
    1.21 +$(hexdump -v -s $OFS -e '"    " 16/1 "0x%02X, "' -e '"  /* %04.4_ax */ \n"' $DATA | sed 's/ 0x  ,/      /g')
    1.22  
    1.23  /* These strange constants are defined in RFC 1321 as
    1.24     T[i] = (int)(4294967296.0 * fabs(sin(i))), i=1..64
    1.25 @@ -294,14 +295,12 @@
    1.26  	while read tag str; do
    1.27  		if [ "$mode" == "data" ]; then
    1.28  			echo -en "$str\0" | hexdump -v -e '"    " 16/1 "0x%02X, "' \
    1.29 -				-e '"  // %04.4_ax |" 16/1 "%_p" "| \n"' | \
    1.30 +				-e '"  /* %04.4_ax */ \n"' | \
    1.31  				sed 's/ 0x  ,/      /g'
    1.32  		else
    1.33  			if [ $ofs -eq 0 ]; then
    1.34  				cat <<EOT
    1.35  };
    1.36 -#else
    1.37 -static char *$name;
    1.38  #endif
    1.39  
    1.40  #define C_array (uint32_t *) ($name + $(($BOOTISOSZ)))
    1.41 @@ -316,7 +315,7 @@
    1.42  	done <<EOT
    1.43  READSECTORERR	Read sector failure.
    1.44  USAGE		Usage: isohybrid.exe [--list|--read] [--append cmdline] [--initrd file] file.iso [--forced|--undo|--quick|filename...]
    1.45 -OPENERR		Can't open r/w the iso file.
    1.46 +OPENERR		Can't open the iso file.
    1.47  ELTORITOERR	No EL TORITO SPECIFICATION signature.
    1.48  CATALOGERR	Invalid boot catalog.
    1.49  HYBRIDERR	No isolinux.bin hybrid signature.
    1.50 @@ -338,8 +337,51 @@
    1.51  CUSTOM_MAGIC	custom.magic
    1.52  CUSTOM_APPEND	custom.append
    1.53  CUSTOM_INITRD	custom.initrd
    1.54 +CUSTOM_HEADER	#!boot 00000000000000000000000000000000\\\\n
    1.55 +FREE_FORMAT	%ld free bytes in %04lX..%04lX\\\\n
    1.56 +USED_FORMAT	%s at %04lX (%ld bytes).\\\\n
    1.57 +CMDLINE_TAG	append=
    1.58 +INITRD_TAG	initrd:
    1.59  EOT
    1.60  done
    1.61 +	cat <<EOT
    1.62 +#ifdef __MSDOS__
    1.63 +#define BOOTISOFULLSIZE	$(($BOOTISOSZ+(64*4)+64+16+$ofs))
    1.64 +static char bootiso[BOOTISOFULLSIZE];
    1.65 +static data_fixup(void)
    1.66 +{
    1.67 +#asm
    1.68 +	push	ds
    1.69 +	push	ds
    1.70 +	pop	es
    1.71 +	mov	ax,ds
    1.72 +	sub	ax,#0x1000
    1.73 +	mov	ds,ax
    1.74 +	xor	si,si
    1.75 +scanlp:
    1.76 +	dec	si
    1.77 +	jz	copydone
    1.78 +	cmp	byte ptr [si+2],#0xEB
    1.79 +	jne	scanlp
    1.80 +	cmp	word ptr [si],#0x5A4D
    1.81 +	jne	scanlp
    1.82 +	mov	cx,#BOOTISOFULLSIZE
    1.83 +	mov	di,#_bootiso
    1.84 +	cld
    1.85 +	rep
    1.86 +	  movsb
    1.87 +copydone:
    1.88 +	pop	ds	
    1.89 +#endasm
    1.90 +	if (!bootiso[0]) {
    1.91 +		puts("No bootiso data");
    1.92 +		exit(-1);
    1.93 +	}
    1.94 +}
    1.95 +#else
    1.96 +#define data_fixup()
    1.97 +#endif
    1.98 +EOT
    1.99  	rm -rf $DATA
   1.100  	exit ;;
   1.101  --exe)