1
1
mirror of https://github.com/OpenVoiceOS/OpenVoiceOS synced 2024-12-26 08:42:57 +01:00
OpenVoiceOS/buildroot-external/board/ovos/ova/post-image.sh

35 lines
891 B
Bash
Raw Normal View History

2023-04-13 13:53:47 +02:00
#!/bin/bash
set -e
BOARD_DIR="$(dirname $0)"
BOARD_NAME="$(basename ${BOARD_DIR})"
GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
2023-08-21 10:05:43 +02:00
SWUPDATE_FILES="sw-description rootfs.squashfs"
2023-04-13 13:53:47 +02:00
# Pass an empty rootpath. genimage makes a full copy of the given rootpath to
# ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk
# space. We don't rely on genimage to build the rootfs image, just to insert a
# pre-built one in the disk image.
trap 'rm -rf "${ROOTPATH_TMP}"' EXIT
ROOTPATH_TMP="$(mktemp -d)"
rm -rf "${GENIMAGE_TMP}"
genimage \
--rootpath "${ROOTPATH_TMP}" \
--tmppath "${GENIMAGE_TMP}" \
--inputpath "${BINARIES_DIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${GENIMAGE_CFG}"
2023-08-21 10:05:43 +02:00
pushd ${BINARIES_DIR}
for f in ${SWUPDATE_FILES} ; do
echo ${f}
done | cpio -ov -H crc > rootfs.swu
popd
2023-04-13 13:53:47 +02:00
exit $?