wok view ipxe/receipt @ rev 25632

Up gtklife (5.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 23 14:06:29 2023 +0000 (11 months ago)
parents ecd613707114
children
line source
1 # SliTaz package receipt.
3 PACKAGE="ipxe"
4 VERSION="1.21.1"
5 CATEGORY="system-tools"
6 SHORT_DESC="Open source network boot firmware."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://ipxe.org/"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WGET_URL="https://github.com/ipxe/ipxe/archive/v$VERSION.tar.gz"
13 SPLIT="ipxe-pxe ipxelinux"
14 DEPENDS=""
15 BUILD_DEPENDS="perl wget liblzma-dev syslinux"
17 current_version()
18 {
19 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
20 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
21 }
23 # Rules to configure and make the package.
24 compile_rules()
25 {
26 cd $src/src
27 patch -p1 < $stuff/cmd_isgt.u
28 sed -i 's|SIZEOF_LOW_4GB / SIZEOF_2MB_PAGE|1 << (SIZEOF_LOW_4GB_LOG2 - SIZEOF_2MB_PAGE_LOG2)|' arch/x86/transitions/librm.S
29 sed -i 's|i.86|i386|;s|bswapl\t%eax|xchgb\t%al, %ah\n\troll\t$16, %eax\n\txchgb\t%al, %ah|' arch/x86/prefix/unlzma.S
30 sed -i 's/-llzma/& -lpthread/' Makefile.*
31 sed -i 's|//\(#define.*CONSOLE_FRAMEBUFFER\)|\1|' config/console.h
32 sed -i 's|//\(#define.*CONSOLE_SERIAL\)|\1|' config/console.h
33 sed -e 's|//\(#define.*IMAGE_PNG\)|\1|' \
34 -e 's|.*\(NET_PROTO_IPV6\)|#define \1|' \
35 -e 's|undef \(DOWNLOAD_PROTO_HTTPS\)|define \1|' \
36 -e 's|.*\(VLAN_CMD\)|#define \1|' \
37 -e 's|.*\(CERT_CMD\)|#define \1|' \
38 -e 's|//\(#define.*CONSOLE_CMD\)|\1|' \
39 -e 's|//\(#define.*REBOOT_CMD\)|\1|' -i config/general.h
40 sed -i "s|\(TAG_LINE \"\)|\1${VERSION#*-} -- |" config/branding.h
41 sed -i 's|//\(#define.*CPUID_SETTINGS\)|\1|' config/settings.h
42 pxelinux="$(ls $WOK/syslinux/source/*/core/pxelinux.0)"
43 make bin-i386-efi/snponly.efi EMBED=$stuff/ipxelinux.ipxe,$pxelinux &&
44 mv bin-i386-efi/snponly.efi bin-i386-efi/ipxelinux.efi
45 make bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv bin-i386-efi/snponly.efi \
46 EMBED=$stuff/ipxe.cmd
48 sed -i 's|//\(#define.*MEMMAP_SETTINGS\)|\1|' config/settings.h
49 make bin/undionly.kkkpxe EMBED=$stuff/ipxelinux.ipxe,$pxelinux &&
50 mv bin/undionly.kkkpxe bin/ipxelinux.0
51 make bin/undionly.pxe bin/undionly.kpxe bin/undionly.kkpxe \
52 bin/undionly.kkkpxe bin/undionly.lkrn \
53 bin/ipxe.pxe bin/ipxe.kpxe bin/ipxe.kkpxe \
54 bin/ipxe.kkkpxe bin/ipxe.nbi bin/ipxe.lkrn \
55 EMBED=$stuff/ipxe.cmd
56 cp $stuff/bootloader.S .
57 cc -o bootloader.o -Wa,-a=bootloader.lst -c bootloader.S
58 objcopy --only-section=.text -O binary bootloader.o bootloader.bin
59 for bin in ipxe undionly ; do
60 size=$(stat -c %s bin/$bin.lkrn)
61 cp -a bin/$bin.lkrn bin/$bin.fd
62 dd if=bootloader.bin of=bin/$bin.fd conv=notrunc
63 while read ofs val ; do
64 printf '\\\\x%02X\\\\x%02X' $(($val & 255)) $(($val / 256)) | \
65 xargs echo -en|dd bs=1 conv=notrunc of=bin/$bin.fd seek=$ofs
66 done 2> /dev/null <<EOT
67 4 $((($size+511)/512))
68 14 $((($size+15)/16))
69 EOT
70 done
71 }
73 # Rules to gen a SliTaz package suitable for Tazpkg.
74 genpkg_rules()
75 {
76 mkdir -p $fs/boot $install/usr/share
77 cp -a $src/src/doc $install/usr/share
78 cp -a $src/src/bin/ipxe.fd $fs/boot/ipxe.exe
79 }
81 # Pre and post install commands for Tazpkg.
82 post_install()
83 {
84 [ -s $1/boot/isolinux/isolinux.cfg ] &&
85 ! grep -qs 'Web Boot' $1/boot/isolinux/isolinux.cfg &&
86 sed -i 's|i18n.cfg|&\n\
87 LABEL web zeb\
88 MENU LABEL Web Boot\
89 KERNEL /boot/ipxe.exe|' $1/boot/isolinux/isolinux.cfg
90 true
91 }