wok view memtest64/receipt @ rev 25514

Add memtest64
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Feb 16 14:18:05 2023 +0000 (15 months ago)
parents
children 8acc87b18a99
line source
1 # SliTaz package receipt.
3 PACKAGE="memtest64"
4 VERSION="6.10"
5 CATEGORY="base-system"
6 SHORT_DESC="Memory failures detection tool."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.zip"
10 WEB_SITE="https://www.memtest.org/" # https://github.com/memtest86plus/memtest86plus/
11 WGET_URL="https://memtest.org/download/v$VERSION/mt86plus_${VERSION}.binaries.zip"
13 # What is the latest version available today?
14 current_version()
15 {
16 wget -O - $WEB_SITE 2>/dev/null | \
17 sed '/binaries.zip/!d;s|.*mt86plus_||;s|.binaries.zip.*||;q'
18 }
20 asm()
21 {
22 cc -o $1.o -Wa,-a=$1.lst -c $1.S
23 objcopy --only-section=.text -O binary $1.o $1.bin
24 }
26 tune_lzma()
27 {
28 file=$1
29 shift
30 for i in lzma lz4x2 lzsa1x2 lzsa2x2 ; do
31 cp $stuff/*.S $stuff/pack .
32 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=${1:-64},|" -i pack
33 while [ -n "$2" ]; do
34 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
35 shift 2
36 done
37 sed -i "s|uncompress|un${i%x2}|" unpack.S
38 asm bootloader
39 asm unpack
40 cp pack pack.bak
41 ./pack --build bootloader.bin unpack.bin
42 PACKER=${i%x2} ./pack $file $file.${i%x2}
43 if [ $(stat -c %s $file.${i%x2}) -ge $((0x101F0)) ]; then
44 rm $file.${i%x2}
45 cp pack.bak pack
46 sed -e "s|^#define FLAT16.*// lzma case|#define FLAT16 0 // ${i%x2}|" -i unpack.S
47 asm unpack
48 ./pack --build bootloader.bin unpack.bin
49 PACKER=${i%x2} ./pack $file $file.${i%x2}
50 fi
51 mv unpack.lst unpack.lst.${i%x2}
52 if [ "${i#*x}" = "2" ]; then
53 cp pack.bak pack
54 sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED 1 // $i|" -i unpack.S
55 asm unpack
56 ./pack --build bootloader.bin unpack.bin
57 PACKER=${i%x2} ./pack $file $file.$i
58 mv unpack.lst unpack.lst.$i
59 fi
60 done
61 }
63 # Rules to configure and make the package.
64 compile_rules()
65 {
66 tune_lzma memtest64.bin 55,mf=bt2 LC 3 PB 2
67 }
69 # Rules to gen a SliTaz package suitable for Tazpkg.
70 genpkg_rules()
71 {
72 mkdir -p $fs/boot
73 cp $src/memtest64.bin.lzma $fs/boot/memtest64.exe
74 }
76 # Pre and post install commands for Tazpkg.
77 post_install()
78 {
79 [ -s $1/boot/isolinux/isolinux.cfg ] &&
80 ! grep -qs 'Check 64bits memory' $1/boot/isolinux/isolinux.cfg && sed -i \
81 's|LABEL md5|LABEL memtest64 mem64 ram64\
82 MENU LABEL Check 64bits memory\
83 KERNEL /boot/memtest64.exe\
84 \n&|' $1/boot/isolinux/isolinux.cfg
85 true
86 }