post-image.sh 730 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -e
  3. BOARD_DIR="$(dirname $0)"
  4. BOARD_NAME="$(basename ${BOARD_DIR})"
  5. GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
  6. GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
  7. # Pass an empty rootpath. genimage makes a full copy of the given rootpath to
  8. # ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk
  9. # space. We don't rely on genimage to build the rootfs image, just to insert a
  10. # pre-built one in the disk image.
  11. trap 'rm -rf "${ROOTPATH_TMP}"' EXIT
  12. ROOTPATH_TMP="$(mktemp -d)"
  13. rm -rf "${GENIMAGE_TMP}"
  14. genimage \
  15. --rootpath "${ROOTPATH_TMP}" \
  16. --tmppath "${GENIMAGE_TMP}" \
  17. --inputpath "${BINARIES_DIR}" \
  18. --outputpath "${BINARIES_DIR}" \
  19. --config "${GENIMAGE_CFG}"
  20. exit $?