wok-current annotate ipxe/receipt @ rev 25600

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