wok annotate ipxe/receipt @ rev 23972
ipxe: add isgt command
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 21 13:33:36 2020 +0000 (2020-10-21) |
parents | aa2fff9a1b85 |
children | c1a1d1f23e07 |
rev | line source |
---|---|
pascal@13422 | 1 # SliTaz package receipt. |
pascal@13422 | 2 |
pascal@13422 | 3 PACKAGE="ipxe" |
pascal@22683 | 4 VERSION="1.20.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@13422 | 13 DEPENDS="" |
pascal@20039 | 14 BUILD_DEPENDS="perl wget liblzma-dev syslinux" |
pascal@13422 | 15 |
pascal@13422 | 16 # Rules to configure and make the package. |
pascal@13422 | 17 compile_rules() |
pascal@13422 | 18 { |
pascal@13422 | 19 cd $src/src |
pascal@23972 | 20 patch -p1 < $stuff/cmd_isgt.u |
pascal@19922 | 21 sed -i 's|SIZEOF_LOW_4GB / SIZEOF_2MB_PAGE|1 << (SIZEOF_LOW_4GB_LOG2 - SIZEOF_2MB_PAGE_LOG2)|' arch/x86/transitions/librm.S |
pascal@18836 | 22 sed -i 's/-llzma/& -lpthread/' Makefile.* |
pascal@18836 | 23 sed -i 's|//\(#define.*CONSOLE_FRAMEBUFFER\)|\1|' config/console.h |
pascal@18901 | 24 sed -i 's|//\(#define.*CONSOLE_SERIAL\)|\1|' config/console.h |
pascal@23890 | 25 sed -e 's|//\(#define.*IMAGE_PNG\)|\1|' \ |
pascal@21440 | 26 -e 's|.*\(NET_PROTO_IPV6\)|#define \1|' \ |
pascal@22694 | 27 -e 's|undef \(DOWNLOAD_PROTO_HTTPS\)|define \1|' \ |
pascal@22694 | 28 -e 's|.*\(VLAN_CMD\)|#define \1|' \ |
pascal@22694 | 29 -e 's|.*\(CERT_CMD\)|#define \1|' \ |
pascal@18836 | 30 -e 's|//\(#define.*CONSOLE_CMD\)|\1|' \ |
pascal@23890 | 31 -e 's|//\(#define.*REBOOT_CMD\)|\1|' -i config/general.h |
pascal@21440 | 32 sed -i "s|\(TAG_LINE \"\)|\1${VERSION#*-} -- |" config/branding.h |
pascal@23940 | 33 sed -i 's|//\(#define.*CPUID_SETTINGS\)|\1|' config/settings.h |
pascal@20039 | 34 pxelinux="$(ls $WOK/syslinux/source/*/core/pxelinux.0)" |
pascal@23940 | 35 make bin-i386-efi/snponly.efi EMBED=$stuff/ipxelinux.ipxe,$pxelinux && |
pascal@23940 | 36 mv bin-i386-efi/snponly.efi bin-i386-efi/ipxelinux.efi |
pascal@23940 | 37 make bin-i386-efi/ipxe.efi bin-i386-efi/snponly.efi EMBED=$stuff/ipxe.cmd |
pascal@23940 | 38 |
pascal@23940 | 39 sed -i 's|//\(#define.*MEMMAP_SETTINGS\)|\1|' config/settings.h |
pascal@20039 | 40 make bin/undionly.kkkpxe EMBED=$stuff/ipxelinux.ipxe,$pxelinux && |
pascal@20039 | 41 mv bin/undionly.kkkpxe bin/ipxelinux.0 |
pascal@19333 | 42 make bin/undionly.pxe bin/undionly.kpxe bin/undionly.kkpxe \ |
pascal@19333 | 43 bin/undionly.kkkpxe bin/ipxe.pxe bin/ipxe.kpxe bin/ipxe.kkpxe \ |
pascal@23940 | 44 bin/ipxe.kkkpxe bin/ipxe.nbi bin/ipxe.lkrn \ |
pascal@23940 | 45 bin/ipxe.exe EMBED=$stuff/ipxe.cmd |
pascal@20179 | 46 cp $stuff/bootloader.S . |
pascal@20179 | 47 cc -o bootloader.o -Wa,-a=bootloader.lst -c bootloader.S |
pascal@20179 | 48 objcopy -O binary bootloader.o bootloader.bin |
pascal@20179 | 49 size=$(stat -c %s bin/ipxe.lkrn) |
pascal@20179 | 50 while read ofs val ; do |
pascal@20179 | 51 printf '\\\\x%02X\\\\x%02X' $(($val & 255)) $(($val / 256)) | \ |
pascal@20179 | 52 xargs echo -en|dd bs=1 conv=notrunc of=bootloader.bin seek=$ofs |
pascal@20179 | 53 done 2> /dev/null <<EOT |
pascal@20179 | 54 4 $((($size+511)/512)) |
pascal@20179 | 55 14 $((($size+15)/16)) |
pascal@20179 | 56 EOT |
pascal@13422 | 57 } |
pascal@13422 | 58 |
pascal@13422 | 59 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@13422 | 60 genpkg_rules() |
pascal@13422 | 61 { |
pascal@20043 | 62 mkdir -p $fs/boot $install/usr/share |
pascal@20042 | 63 cp -a $src/src/doc $install/usr/share |
pascal@20210 | 64 cp -a $src/src/bin/ipxe.lkrn $fs/boot/ipxe.exe |
pascal@20210 | 65 dd if=$src/src/bootloader.bin of=$fs/boot/ipxe.exe conv=notrunc |
pascal@13422 | 66 } |
pascal@20210 | 67 |
pascal@20210 | 68 # Pre and post install commands for Tazpkg. |
pascal@20210 | 69 post_install() |
pascal@20210 | 70 { |
pascal@20210 | 71 [ -s $1/boot/isolinux/isolinux.cfg ] && |
pascal@20210 | 72 ! grep -qs 'Web Boot' $1/boot/isolinux/isolinux.cfg && |
pascal@20210 | 73 sed -i 's|i18n.cfg|&\n\ |
pascal@20210 | 74 LABEL web zeb\ |
pascal@20210 | 75 MENU LABEL Web Boot\ |
pascal@20210 | 76 KERNEL /boot/ipxe.exe|' $1/boot/isolinux/isolinux.cfg |
pascal@20219 | 77 true |
pascal@20210 | 78 } |