wok rev 24045

memtest,plop: tune lzma compression
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 06 12:50:46 2021 +0000 (5 weeks ago)
parents 0a67bf248823
children 8d938c826a9b
files coturn/receipt ipxe/stuff/bootloader.S memtest/receipt memtest/stuff/bootloader.S memtest/stuff/pack plop/stuff/pack plop/stuff/unlzma.S
line diff
     1.1 --- a/coturn/receipt	Sat May 01 09:28:58 2021 +0100
     1.2 +++ b/coturn/receipt	Thu May 06 12:50:46 2021 +0000
     1.3 @@ -14,6 +14,12 @@
     1.4  DEPENDS="libssl libsqlite zlib libevent"
     1.5  BUILD_DEPENDS="openssl-dev sqlite-dev zlib-dev libevent-dev"
     1.6  
     1.7 +current_version()
     1.8 +{
     1.9 +	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    1.10 +	sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
    1.11 +}
    1.12 +
    1.13  # Rules to configure and make the package.
    1.14  compile_rules()
    1.15  {
     2.1 --- a/ipxe/stuff/bootloader.S	Sat May 01 09:28:58 2021 +0100
     2.2 +++ b/ipxe/stuff/bootloader.S	Thu May 06 12:50:46 2021 +0000
     2.3 @@ -31,7 +31,7 @@
     2.4  //#define NO_DOTS		show progression dots ?		-5
     2.5  #ifndef BZIMAGE
     2.6  //#define TINY_ZIMAGE		system < 64Kb ?			-11
     2.7 -//#defime NO_MINSETUP		default setup (dos only) ?	-4
     2.8 +//#define NO_MINSETUP		default setup (dos only) ?	-4
     2.9  //#define NO_CURSOR_DEFINITION					-8
    2.10  #endif
    2.11  
    2.12 @@ -300,7 +300,7 @@
    2.13  	xorw	%si, %si
    2.14  	xorw	%di, %di
    2.15  	cmpw	%ax, %bx
    2.16 -	jc	forward
    2.17 +	jnc	forward
    2.18  	decw	%si
    2.19  	decw	%di
    2.20  	std
    2.21 @@ -313,8 +313,8 @@
    2.22  #else
    2.23  	subw	%ax, %bx
    2.24  	jnc	forward
    2.25 +	//movw	$0x8FFF, %ax
    2.26  	movb	$0x90, %ah
    2.27 -	;decw	%ax
    2.28  forward:
    2.29  	movw	%ax, %es
    2.30  	movw	%ax, %di
    2.31 @@ -467,7 +467,9 @@
    2.32  # Assume no error on first track.
    2.33  
    2.34  #ifdef FLOPPY_1440K_ONLY
    2.35 +#ifndef FLOPPY_HAS_2_SIDES
    2.36  #define FLOPPY_HAS_2_SIDES	hardcore heads count to 2
    2.37 +#endif
    2.38  #define FLOPPY_SECTORS		18	/* 18 sectors */
    2.39  #else
    2.40  #define FLOPPY_HEADS		2	/* 2 heads minimum */
     3.1 --- a/memtest/receipt	Sat May 01 09:28:58 2021 +0100
     3.2 +++ b/memtest/receipt	Thu May 06 12:50:46 2021 +0000
     3.3 @@ -13,6 +13,21 @@
     3.4  
     3.5  BUILD_DEPENDS="xz"
     3.6  
     3.7 +tune_lzma()
     3.8 +{
     3.9 +	cp $stuff/*.S $stuff/pack .
    3.10 +	sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$1,|" -i pack
    3.11 +	while [ -n "$2" ]; do
    3.12 +		sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
    3.13 +		shift 2
    3.14 +	done
    3.15 +	for i in bootloader unpack ; do
    3.16 +		cc -o $i.o -Wa,-a=$i.lst -c $i.S
    3.17 +		objcopy -O binary $i.o $i.bin
    3.18 +	done
    3.19 +	./pack --build bootloader.bin unpack.bin
    3.20 +}
    3.21 +
    3.22  # Rules to configure and make the package.
    3.23  compile_rules()
    3.24  {
    3.25 @@ -21,19 +36,14 @@
    3.26  		patch -p1 < $i
    3.27  	done
    3.28  	make
    3.29 -	cp $stuff/*.S $stuff/pack .
    3.30 -	for i in bootloader unpack ; do
    3.31 -		cc -o $i.o -Wa,-a=$i.lst -c $i.S
    3.32 -		objcopy -O binary $i.o $i.bin
    3.33 -	done
    3.34 -	sed -i "s/VERSION/$VERSION/" pack
    3.35 -	./pack --build bootloader.bin unpack.bin
    3.36 +	tune_lzma 211 PB 3
    3.37  	./pack memtest.bin memtest.packed
    3.38  	mv memtest.bin memtest.bin.console
    3.39  	sed -i  -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
    3.40  		-e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
    3.41  	make clean
    3.42  	make
    3.43 +	tune_lzma 147 LC 2
    3.44  	./pack memtest.bin memtest.packed-115200
    3.45  	mv memtest.bin memtest.bin.serial
    3.46  } 
     4.1 --- a/memtest/stuff/bootloader.S	Sat May 01 09:28:58 2021 +0100
     4.2 +++ b/memtest/stuff/bootloader.S	Thu May 06 12:50:46 2021 +0000
     4.3 @@ -313,8 +313,8 @@
     4.4  #else
     4.5  	subw	%ax, %bx
     4.6  	jnc	forward
     4.7 +	//movw	$0x8FFF, %ax
     4.8  	movb	$0x90, %ah
     4.9 -	;decw	%ax
    4.10  forward:
    4.11  	movw	%ax, %es
    4.12  	movw	%ax, %di
     5.1 --- a/memtest/stuff/pack	Sat May 01 09:28:58 2021 +0100
     5.2 +++ b/memtest/stuff/pack	Thu May 06 12:50:46 2021 +0000
     5.3 @@ -38,9 +38,14 @@
     5.4  	done | xargs echo -en | dd conv=notrunc bs=1 of=$2 seek=$3
     5.5  }
     5.6  
     5.7 +bits()
     5.8 +{
     5.9 +	sed "/define PROP_$1/!d;s|.*PROP_...||" unlzma.S
    5.10 +}
    5.11 +
    5.12  compress()
    5.13  {
    5.14 -	xz -z -e --format=lzma --lzma1=mf=bt2 --stdout | dd bs=1 skip=13
    5.15 +	xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
    5.16  }
    5.17  
    5.18  main()
     6.1 --- a/plop/stuff/pack	Sat May 01 09:28:58 2021 +0100
     6.2 +++ b/plop/stuff/pack	Thu May 06 12:50:46 2021 +0000
     6.3 @@ -42,9 +42,14 @@
     6.4  	done | xargs echo -en | dd conv=notrunc bs=1 of=$2 seek=$3
     6.5  }
     6.6  
     6.7 +bits()
     6.8 +{
     6.9 +	sed "/^#define PROP_$1/!d;s|.*PROP_...||" unlzma.S
    6.10 +}
    6.11 +
    6.12  compress()
    6.13  {
    6.14 -	xz -z -e --format=lzma --lzma1=mf=bt2 --stdout | dd bs=1 skip=13
    6.15 +	xz -z -e --format=raw --lzma1=mf=bt2,lc=$(bits LC),lp=$(bits LP),pb=$(bits PB),nice=84 --stdout 
    6.16  }
    6.17  
    6.18  main()
     7.1 --- a/plop/stuff/unlzma.S	Sat May 01 09:28:58 2021 +0100
     7.2 +++ b/plop/stuff/unlzma.S	Thu May 06 12:50:46 2021 +0000
     7.3 @@ -18,9 +18,11 @@
     7.4   * Compression with : lzma e src dst -eos -pb2 -lp0 -lc3
     7.5   */
     7.6  
     7.7 -#define PROP_PB 2
     7.8 +//#define PROP_PB 2
     7.9 +#define PROP_PB 0
    7.10  #define PROP_LP 0
    7.11 -#define PROP_LC 3
    7.12 +//#define PROP_LC 3
    7.13 +#define PROP_LC 0
    7.14  #define PROPS (PROP_LC+(PROP_LP*9)+(PROP_PB*45))
    7.15  
    7.16  // static const Byte *Buffer;