prep-release.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. cat > "build/ipxe/netboot.xyz-sha256-checksums.txt" <<EOF
  26. # netboot.xyz bootloaders generated from https://github.com/ipxe/ipxe
  27. # Git Hash: $IPXE_HASH
  28. EOF
  29. # generate sha256sums for iPXE disks
  30. for ipxe_disk in `ls build/ipxe/`
  31. do
  32. sha256sum $ipxe_disk >> build/ipxe/netboot.xyz-sha256-checksums.txt
  33. done
  34. # copy iPXE src code into build directory
  35. cp -R src/* build/