prep-release.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. mv bin/ipxe.dsk ../../build/ipxe/$ipxe_config.dsk
  18. mv bin/ipxe.iso ../../build/ipxe/$ipxe_config.iso
  19. mv bin/ipxe.lkrn ../../build/ipxe/$ipxe_config.lkrn
  20. mv bin/ipxe.usb ../../build/ipxe/$ipxe_config.usb
  21. mv bin/undionly.kpxe ../../build/ipxe/$ipxe_config-undionly.kpxe
  22. done
  23. cd ../..
  24. # generate header for sha256-checksums file
  25. cd build/ipxe
  26. CURRENT_TIME=`date`
  27. cat > netboot.xyz-sha256-checksums.txt <<EOF
  28. # netboot.xyz bootloaders generated at $CURRENT_TIME
  29. # iPXE Commit: https://github.com/ipxe/ipxe/commit/$IPXE_HASH
  30. # Travis-CI Job: https://travis-ci.org/antonym/netboot.xyz/builds/$TRAVIS_BUILD_ID
  31. EOF
  32. # generate sha256sums for iPXE disks
  33. for ipxe_disk in `ls .`
  34. do
  35. sha256sum $ipxe_disk >> netboot.xyz-sha256-checksums.txt
  36. done
  37. cd ../..
  38. # copy iPXE src code into build directory
  39. cp -R src/* build/