prep-release.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. # prep release for upload to production container
  3. function error_check()
  4. {
  5. if [ $? -eq 1 ]
  6. then
  7. echo "Error encountered... failing..."
  8. exit 1
  9. fi
  10. }
  11. # make ipxe directory to store ipxe disks
  12. mkdir -p build/ipxe
  13. # pull down upstream iPXE
  14. git clone --depth 1 https://github.com/ipxe/ipxe.git ipxe_build
  15. # copy iPXE config overrides into source tree
  16. cp ipxe/local/* ipxe_build/src/config/local/
  17. # build iPXE disks
  18. cd ipxe_build/src
  19. # get current iPXE hash
  20. IPXE_HASH=`git log -n 1 --pretty=format:"%H"`
  21. # generate generic iPXE disks
  22. make bin/ipxe.dsk bin/ipxe.iso bin/ipxe.lkrn bin/ipxe.usb bin/ipxe.kpxe bin/undionly.kpxe
  23. mv bin/ipxe.dsk ../../build/ipxe/generic-ipxe.dsk
  24. mv bin/ipxe.iso ../../build/ipxe/generic-ipxe.iso
  25. mv bin/ipxe.lkrn ../../build/ipxe/generic-ipxe.lkrn
  26. mv bin/ipxe.usb ../../build/ipxe/generic-ipxe.usb
  27. mv bin/ipxe.kpxe ../../build/ipxe/generic-ipxe.kpxe
  28. mv bin/undionly.kpxe ../../build/ipxe/generic-undionly.kpxe
  29. # generate netboot.xyz iPXE disks
  30. for ipxe_config in `ls ../../ipxe/disks/`
  31. do
  32. make bin/ipxe.dsk bin/ipxe.iso bin/ipxe.lkrn bin/ipxe.usb bin/ipxe.kpxe bin/undionly.kpxe EMBED=../../ipxe/disks/$ipxe_config
  33. error_check
  34. mv bin/ipxe.dsk ../../build/ipxe/$ipxe_config.dsk
  35. mv bin/ipxe.iso ../../build/ipxe/$ipxe_config.iso
  36. mv bin/ipxe.lkrn ../../build/ipxe/$ipxe_config.lkrn
  37. mv bin/ipxe.usb ../../build/ipxe/$ipxe_config.usb
  38. mv bin/ipxe.kpxe ../../build/ipxe/$ipxe_config.kpxe
  39. mv bin/undionly.kpxe ../../build/ipxe/$ipxe_config-undionly.kpxe
  40. done
  41. # generate EFI iPXE disks
  42. #for ipxe_config in `ls ../../ipxe/disks/`
  43. #do
  44. # # Remove general.h options for testing, doesn't like COMBOOT
  45. # rm config/local/general.h
  46. # make bin-x86_64-efi/ipxe.efi EMBED=../../ipxe/disks/$ipxe_config
  47. # error_check
  48. # mv bin-x86_64-efi/ipxe.efi ../../build/ipxe/$ipxe_config.efi
  49. #done
  50. # return to root
  51. cd ../..
  52. # generate header for sha256-checksums file
  53. cd build/
  54. CURRENT_TIME=`date`
  55. cat > netboot.xyz-sha256-checksums.txt <<EOF
  56. # netboot.xyz bootloaders generated at $CURRENT_TIME
  57. # iPXE Commit: https://github.com/ipxe/ipxe/commit/$IPXE_HASH
  58. # Travis-CI Job: https://travis-ci.org/antonym/netboot.xyz/builds/$TRAVIS_BUILD_ID
  59. EOF
  60. # generate sha256sums for iPXE disks
  61. cd ipxe/
  62. for ipxe_disk in `ls .`
  63. do
  64. sha256sum $ipxe_disk >> ../netboot.xyz-sha256-checksums.txt
  65. done
  66. cat ../netboot.xyz-sha256-checksums.txt
  67. mv ../netboot.xyz-sha256-checksums.txt .
  68. cd ../..
  69. # delete index.html so that we don't overwrite existing content type
  70. rm src/index.html
  71. # copy iPXE src code into build directory
  72. cp -R src/* build/