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