wok-next rev 20760

Add memtest-bin.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jun 02 17:02:49 2018 +0300 (2018-06-02)
parents 20b16e3448fe
children 0c06401ec98f
files memtest-bin/receipt memtest/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/memtest-bin/receipt	Sat Jun 02 17:02:49 2018 +0300
     1.3 @@ -0,0 +1,21 @@
     1.4 +# SliTaz package receipt v2.
     1.5 +
     1.6 +PACKAGE="memtest-bin"
     1.7 +VERSION="5.01"
     1.8 +CATEGORY="base-system"
     1.9 +SHORT_DESC="Memory failures detection tool (pre-compiled bootable binary)"
    1.10 +MAINTAINER="al.bobylev@gmail.com"
    1.11 +LICENSE="GPL2"
    1.12 +WEB_SITE="http://www.memtest.org/"
    1.13 +
    1.14 +TARBALL="memtest86+-$VERSION.bin.gz"
    1.15 +WGET_URL="http://www.memtest.org/download/$VERSION/$TARBALL"
    1.16 +
    1.17 +compile_rules() {
    1.18 +	gzip -d $TARBALL
    1.19 +	install -Dm644 memtest86+-$VERSION.bin $install/boot/memtest
    1.20 +}
    1.21 +
    1.22 +genpkg_rules() {
    1.23 +	copy @std
    1.24 +}
     2.1 --- a/memtest/receipt	Sat Jun 02 15:06:48 2018 +0300
     2.2 +++ b/memtest/receipt	Sat Jun 02 17:02:49 2018 +0300
     2.3 @@ -7,60 +7,65 @@
     2.4  MAINTAINER="pascal.bellard@slitaz.org"
     2.5  LICENSE="GPL2"
     2.6  WEB_SITE="http://www.memtest.org/"
     2.7 +HOST_ARCH="i486"
     2.8  
     2.9 -SOURCE="memtest86+"
    2.10 -TARBALL="$SOURCE-$VERSION.tar.gz"
    2.11 +TARBALL="memtest86+-$VERSION.tar.gz"
    2.12  WGET_URL="${WEB_SITE}download/$VERSION/$TARBALL"
    2.13  
    2.14  BUILD_DEPENDS="xz gcc3"
    2.15 -SPLIT="memtest-serial"
    2.16 +SPLIT="memtest-serial:serial"
    2.17  
    2.18 -# Rules to configure and make the package.
    2.19 -compile_rules()
    2.20 -{
    2.21 -	sed -i  -e '/scp memtest.bin/d' -e 's/gcc/gcc-3/' \
    2.22 -		-e 's/-fno-stack-protector//' Makefile
    2.23 +compile_rules() {
    2.24 +	sed -i '/scp memtest.bin/d; s/gcc/gcc-3/; s/-fno-stack-protector//' Makefile
    2.25  	sed -i 's/0b10/2/' init.c
    2.26  
    2.27 -	make
    2.28 -	cp $stuff/*.S $stuff/pack .
    2.29 -	for i in bootloader unpack ; do
    2.30 -		cc -o $i.o -Wa,-a=$i.lst -c $i.S
    2.31 -		objcopy -O binary $i.o $i.bin
    2.32 -	done
    2.33 -	sed -i "s/VERSION/$VERSION/" pack
    2.34 -	./pack --build bootloader.bin unpack.bin
    2.35 -	./pack memtest.bin memtest.packed
    2.36 -	mv memtest.bin memtest.bin.console
    2.37 -	sed -i  -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
    2.38 -		-e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
    2.39 -	make clean
    2.40 -	make
    2.41 -	./pack memtest.bin memtest.packed-115200
    2.42 -	mv memtest.bin memtest.bin.serial
    2.43 -} 
    2.44 +	case $SET in
    2.45 +		'')
    2.46 +			make || return 1
    2.47 +			cp $stuff/*.S $stuff/pack .
    2.48 +			for i in bootloader unpack; do
    2.49 +				cc -o $i.o -Wa,-a=$i.lst -c $i.S
    2.50 +				objcopy -O binary $i.o $i.bin
    2.51 +			done
    2.52 +			sed -i "s/VERSION/$VERSION/" pack
    2.53 +			./pack --build bootloader.bin unpack.bin
    2.54 +			./pack memtest.bin memtest.packed
    2.55 +			mv memtest.bin memtest.bin.console
    2.56  
    2.57 +			install -Dm644 memtest.packed $install/boot/memtest
    2.58 +			;;
    2.59 +		serial)
    2.60 +			sed -i \
    2.61 +				-e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
    2.62 +				-e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
    2.63 +			make clean
    2.64 +			make || return 1
    2.65 +			./pack memtest.bin memtest.packed-115200
    2.66 +			mv memtest.bin memtest.bin.serial
    2.67  
    2.68 -# Rules to gen a SliTaz package suitable for Tazpkg.
    2.69 -genpkg_rules()
    2.70 -{
    2.71 -	case $PACKAGE in
    2.72 -	memtest)
    2.73 -		mkdir -p $fs/boot
    2.74 -		cp $src/memtest.packed $fs/boot/memtest
    2.75 -		;;
    2.76 -	memtest-serial)
    2.77 -		CAT="base-system|using serial port"
    2.78 -		mkdir -p $fs/boot
    2.79 -		cp $src/memtest.packed-115200 $fs/boot/memtest
    2.80 -		;;
    2.81 +			install -Dm644 memtest.packed-115200 $install/boot/memtest
    2.82 +			;;
    2.83  	esac
    2.84  }
    2.85  
    2.86 -# Pre and post install commands for Tazpkg.
    2.87 -post_install_memtest_serial()
    2.88 -{
    2.89 -	cat <<EOT
    2.90 -Output to vga and serial port. Default kernel cmdline: console=ttyS0,115200e8
    2.91 +genpkg_rules() {
    2.92 +	case $PACKAGE in
    2.93 +		memtest)
    2.94 +			copy @std
    2.95 +			;;
    2.96 +		memtest-serial)
    2.97 +			copy @std
    2.98 +			CAT="base-system|using serial port"
    2.99 +			;;
   2.100 +	esac
   2.101 +}
   2.102 +
   2.103 +post_install_memtest_serial() {
   2.104 +	[ -n "$quiet" ] || cat <<EOT
   2.105 +
   2.106 +	.------------------------------------------------.
   2.107 +	| Output to vga and serial port.                 |
   2.108 +	| Default kernel cmdline: console=ttyS0,115200e8 |
   2.109 +	'------------------------------------------------'
   2.110  EOT
   2.111  }