wok-current view memtest64/receipt @ rev 25521
created recipes for unibilium and unibilium-dev 2.1.1
author | Hans-G?nter Theisgen |
---|---|
date | Fri Feb 24 17:05:40 2023 +0100 (21 months ago) |
parents | 8acc87b18a99 |
children | 000946205748 |
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 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 55,mf=bt2 LC 3 PB 2
69 }
71 # Rules to gen a SliTaz package suitable for Tazpkg.
72 genpkg_rules()
73 {
74 mkdir -p $fs/boot
75 cp $src/memtest64.bin.lzma $fs/boot/memtest64.exe
76 }
78 # Pre and post install commands for Tazpkg.
79 post_install()
80 {
81 [ -s $1/boot/isolinux/isolinux.cfg ] &&
82 ln $1/boot/memtest64.exe $1/boot/memtest.exe64 &&
83 ! grep -qs 'Check memory' $1/boot/isolinux/isolinux.cfg && sed -i \
84 's|LABEL md5|LABEL memtest mem ram\
85 MENU LABEL Check memory\
86 KERNEL /boot/memtest.exe\
87 \n&|' $1/boot/isolinux/isolinux.cfg
88 true
89 }