prep-release.sh 1.5 KB

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