wok view memtest64/receipt @ rev 25598
Update some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 16 12:03:07 2023 +0000 (17 months ago) |
parents | ad9d4c35c08b |
children | cb71c3a76f5a |
line source
1 # SliTaz package receipt.
3 PACKAGE="memtest64"
4 VERSION="6.20"
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 BUILD_DEPENDS="xz lz4 lzsa"
15 # What is the latest version available today?
16 current_version()
17 {
18 wget -O - $WEB_SITE 2>/dev/null | \
19 sed '/binaries.zip/!d;s|.*mt86plus_||;s|.binaries.zip.*||;q'
20 }
22 asm()
23 {
24 cc -o $1.o -Wa,-a=$1.lst -c $1.S
25 objcopy --only-section=.text -O binary $1.o $1.bin
26 }
28 tune_lzma()
29 {
30 file=$1
31 shift
32 for i in lzma lz4x2 lzsa1x2 lzsa2x2 ; do
33 cp $stuff/*.S $stuff/pack .
34 sed "s/VERSION/$VERSION/;s|lzma1=|&nice=${1:-64},|" -i pack
35 while [ -n "$2" ]; do
36 sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
37 shift 2
38 done
39 sed -i "s|uncompress|un${i%x2}|" unpack.S
40 asm bootloader
41 asm unpack
42 cp pack pack.bak
43 ./pack --build bootloader.bin unpack.bin
44 PACKER=${i%x2} ./pack $file $file.${i%x2}
45 if [ $(stat -c %s $file.${i%x2}) -ge $((0x101F0)) ]; then
46 rm $file.${i%x2}
47 cp pack.bak pack
48 sed -e "s|^#define FLAT16.*// lzma case|#define FLAT16 0 // ${i%x2}|" -i unpack.S
49 asm unpack
50 ./pack --build bootloader.bin unpack.bin
51 PACKER=${i%x2} ./pack $file $file.${i%x2}
52 fi
53 mv unpack.lst unpack.lst.${i%x2}
54 if [ "${i#*x}" = "2" ]; then
55 cp pack.bak pack
56 sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED 1 // $i|" -i unpack.S
57 asm unpack
58 ./pack --build bootloader.bin unpack.bin
59 PACKER=${i%x2} ./pack $file $file.$i
60 mv unpack.lst unpack.lst.$i
61 fi
62 done
63 }
65 # Rules to configure and make the package.
66 compile_rules()
67 {
68 tune_lzma memtest64.bin 144,mf=bt3 LC 3 PB 2
70 }
72 # Rules to gen a SliTaz package suitable for Tazpkg.
73 genpkg_rules()
74 {
75 mkdir $fs/boot
76 cp $src/memtest64.bin.lzma $fs/boot/memtest64.exe
77 }
79 # Pre and post install commands for Tazpkg.
80 post_install()
81 {
82 [ -s $1/boot/isolinux/isolinux.cfg ] &&
83 ! grep -qs 'Check 64 bits memory' $1/boot/isolinux/isolinux.cfg && sed -i \
84 's|LABEL md5|LABEL memtest64 mem64 ram64\
85 MENU LABEL Check 64 bits memory\
86 KERNEL /boot/memtest64.exe\
87 \n&|' $1/boot/isolinux/isolinux.cfg
88 true
89 }