post-image.sh 958 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # Detect boot strategy, EFI or BIOS
  3. if [ -f ${BINARIES_DIR}/efi-part/startup.nsh ]; then
  4. BOOT_TYPE=efi
  5. # grub.cfg needs customization for EFI since the root partition is
  6. # number 2, and bzImage is in the EFI partition (1)
  7. cat >${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg <<__EOF__
  8. set default="0"
  9. set timeout="5"
  10. menuentry "Buildroot" {
  11. linux /bzImage root=/dev/sda2 rootwait console=tty1
  12. }
  13. __EOF__
  14. else
  15. BOOT_TYPE=bios
  16. # Copy grub 1st stage to binaries, required for genimage
  17. cp -f ${HOST_DIR}/usr/lib/grub/i386-pc/boot.img ${BINARIES_DIR}
  18. fi
  19. BOARD_DIR="$(dirname $0)"
  20. GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOOT_TYPE}.cfg"
  21. GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
  22. rm -rf "${GENIMAGE_TMP}"
  23. genimage \
  24. --rootpath "${TARGET_DIR}" \
  25. --tmppath "${GENIMAGE_TMP}" \
  26. --inputpath "${BINARIES_DIR}" \
  27. --outputpath "${BINARIES_DIR}" \
  28. --config "${GENIMAGE_CFG}"
  29. exit $?