prep-release.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. # prep release for upload to production container
  3. # make ipxe directory to store ipxe disks
  4. mkdir -p build/ipxe
  5. # pull down upstream iPXE
  6. git clone --depth 1 https://github.com/ipxe/ipxe.git ipxe_build
  7. # copy iPXE config overrides into source tree
  8. cp ipxe/local/* ipxe_build/src/config/local/
  9. # build iPXE disks
  10. cd ipxe_build/src
  11. # get current iPXE hash
  12. IPXE_HASH=`git log -n 1 --pretty=format:"%H"`
  13. # generate iPXE disks
  14. for ipxe_config in `ls ../../ipxe/disks/`
  15. do
  16. make EMBED=../../ipxe/disks/$ipxe_config
  17. make bin/ipxe.kpxe EMBED=../../ipxe/disks/$ipxe_config
  18. # EFI doesn't like COMBOOT so turn it off before compile
  19. sed -i s/#define IMAGE_COMBOOT/#undef IMAGE_COMBOOT/g config/local/general.h
  20. make bin-x86_64-efi/ipxe.efi EMBED=../../ipxe/disks/$ipxe_config
  21. mv bin/ipxe.dsk ../../build/ipxe/$ipxe_config.dsk
  22. mv bin/ipxe.iso ../../build/ipxe/$ipxe_config.iso
  23. mv bin/ipxe.lkrn ../../build/ipxe/$ipxe_config.lkrn
  24. mv bin/ipxe.usb ../../build/ipxe/$ipxe_config.usb
  25. mv bin/ipxe.kpxe ../../build/ipxe/$ipxe_config.kpxe
  26. mv bin/undionly.kpxe ../../build/ipxe/$ipxe_config-undionly.kpxe
  27. mv bin/ipxe.efi ../../build/ipxe/$ipxe_config.efi
  28. done
  29. cd ../..
  30. # generate header for sha256-checksums file
  31. cd build/
  32. CURRENT_TIME=`date`
  33. cat > netboot.xyz-sha256-checksums.txt <<EOF
  34. # netboot.xyz bootloaders generated at $CURRENT_TIME
  35. # iPXE Commit: https://github.com/ipxe/ipxe/commit/$IPXE_HASH
  36. # Travis-CI Job: https://travis-ci.org/antonym/netboot.xyz/builds/$TRAVIS_BUILD_ID
  37. EOF
  38. # generate sha256sums for iPXE disks
  39. cd ipxe/
  40. for ipxe_disk in `ls .`
  41. do
  42. sha256sum $ipxe_disk >> ../netboot.xyz-sha256-checksums.txt
  43. done
  44. mv ../netboot.xyz-sha256-checksums.txt .
  45. cd ../..
  46. # copy iPXE src code into build directory
  47. cp -R src/* build/