wok view memtest/receipt @ rev 25487

Up exiftool (12.50), foomatic-db (4.0-20221111), lzsa (1.4.0), zlib (1.2.13)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 15 16:20:54 2022 +0000 (17 months ago)
parents b0069c845544
children 608a017317a8
line source
1 # SliTaz package receipt.
3 PACKAGE="memtest"
4 VERSION="5.01"
5 CATEGORY="base-system"
6 SHORT_DESC="Memory failures detection tool."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 SOURCE="memtest86+"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="https://www.memtest.org/"
12 WGET_URL="${WEB_SITE}download/archives/$VERSION/$TARBALL"
14 BUILD_DEPENDS="xz lz4 lzsa"
16 # What is the latest version available today?
17 current_version()
18 {
19 wget -O - $WEB_SITE 2>/dev/null | \
20 sed '/tar.gz"/!d;s|.*memtest86.-||;s|.tar.*||;q'
21 }
23 asm()
24 {
25 cc -o $1.o -Wa,-a=$1.lst -c $1.S
26 objcopy --only-section=.text -O binary $1.o $1.bin
27 }
29 tune_lzma()
30 {
31 file=$1
32 shift
33 for i in lzma lz4 lzsa1 ; do
34 cp $stuff/*.S $stuff/packx .
35 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=${1:-64},|" -i packx
36 while [ -n "$2" ]; do
37 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
38 shift 2
39 done
40 sed -i "s|uncompress|un$i|" unpackx.S
41 asm bootloader
42 asm unpackx
43 cp packx packx.bak
44 ./packx --build bootloader.bin unpackx.bin
45 PACKER=$i ./packx $file $file.$i
46 if [ $(stat -c %s $file.$i) -ge $((0x101F0)) ]; then
47 rm $file.$i
48 cp packx.bak packx
49 sed -e "s|^#define FLAT16.*// lzma case|#define FLAT16 0 // $i|" -i unpackx.S
50 asm unpackx
51 ./packx --build bootloader.bin unpackx.bin
52 PACKER=$i ./packx $file $file.$i
53 fi
54 done
55 }
57 # Rules to configure and make the package.
58 compile_rules()
59 {
60 # binutils 2.37 support
61 sed -i 's|\t}|&\n\t/DISCARD/ : { *(*) }|' memtest.bin.lds
63 ls $stuff/memtest*-$VERSION-*.patch &&
64 for i in $stuff/memtest*-$VERSION-*.patch ; do
65 patch -p1 < $i
66 done
67 make
68 mv memtest.bin memtest.bin.console
69 tune_lzma memtest.bin.console 218,mf=bt2 LC 2
70 sed -i -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
71 -e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
72 make clean
73 make
74 mv memtest.bin memtest.bin.serial
75 tune_lzma memtest.bin.serial 179,mf=bt3 LC 2
76 cp memtest.bin.serial.lzma memtest.packed-115200
77 }
80 # Rules to gen a SliTaz package suitable for Tazpkg.
81 genpkg_rules()
82 {
83 mkdir -p $fs/boot $install/usr/share/doc
84 cp $src/README* $install/usr/share/doc
85 cp $src/FAQ $install/usr/share/doc
86 cp $src/memtest.bin.console.lzma $fs/boot/memtest.exe
87 }
89 # Pre and post install commands for Tazpkg.
90 post_install()
91 {
92 [ -s $1/boot/isolinux/isolinux.cfg ] &&
93 ! grep -qs 'Check memory' $1/boot/isolinux/isolinux.cfg && sed -i \
94 's|LABEL md5|LABEL memtest mem ram\
95 MENU LABEL Check memory\
96 KERNEL /boot/memtest.exe\
97 \n&|' $1/boot/isolinux/isolinux.cfg
98 true
99 }