2018-10-26 19:51:01 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -u
|
|
|
|
set -e
|
|
|
|
|
2020-12-25 12:47:35 +01:00
|
|
|
BOARD_DIR="$(dirname $0)"
|
|
|
|
|
2022-01-19 15:50:19 +01:00
|
|
|
. "${BR2_EXTERNAL_OPENVOICEOS_PATH}/meta"
|
|
|
|
. "${BOARD_DIR}/meta"
|
|
|
|
|
|
|
|
# Write os-release
|
|
|
|
{
|
|
|
|
echo "NAME=\"${OVOS_NAME}\""
|
|
|
|
echo "VERSION=\"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD} ${BOARD_NAME}\""
|
|
|
|
echo "ID=${OVOS_ID}"
|
|
|
|
echo "VERSION_ID=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}"
|
|
|
|
echo "PRETTY_NAME=\"${OVOS_NAME} ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD} ${BOARD_NAME}\""
|
|
|
|
echo "CPE_NAME=cpe:2.3:o:openvoiceos:${OVOS_ID}:${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}:*:${DEPLOYMENT}:*:*:*:${BOARD_ID}:*"
|
|
|
|
echo "HOME_URL=https://github.com/OpenVoiceOS/OpenVoiceOS"
|
|
|
|
echo "DOCUMENTATION_URL=https://github.com/OpenVoiceOS/OpenVoiceOS/tree/develop/documentation"
|
|
|
|
echo "SUPPORT_URL=https://github.com/OpenVoiceOS/OpenVoiceOS/issues"
|
2023-08-31 21:03:59 +02:00
|
|
|
echo "VARIANT=\"${OVOS_NAME} - Buildroot Edition\""
|
|
|
|
echo "VARIANT_ID=${OVOS_ID}-${BOARD_ID}-buildroot"
|
2022-01-19 15:50:19 +01:00
|
|
|
} > "${TARGET_DIR}/usr/lib/os-release"
|
|
|
|
|
|
|
|
# Write machine-info
|
|
|
|
{
|
|
|
|
echo "CHASSIS=${CHASSIS}"
|
|
|
|
echo "DEPLOYMENT=${DEPLOYMENT}"
|
|
|
|
} > "${TARGET_DIR}/etc/machine-info"
|
2018-10-30 15:55:12 +01:00
|
|
|
|
2023-04-11 11:16:39 +02:00
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/cmdline.txt ${BINARIES_DIR}/rpi-firmware/cmdline.txt
|
2023-08-21 10:05:43 +02:00
|
|
|
grub-editenv "${BINARIES_DIR}/efi-part/EFI/BOOT/grubenv" create
|
|
|
|
|
|
|
|
echo "Check for kernel in ${TARGET_DIR}"
|
|
|
|
if [ -f "${TARGET_DIR}/boot/Image" ]; then
|
|
|
|
echo "Found Image, renaming to kernel"
|
|
|
|
mv ${TARGET_DIR}/boot/Image ${TARGET_DIR}/boot/kernel
|
|
|
|
fi
|
2022-05-12 10:46:41 +02:00
|
|
|
|
|
|
|
# Copy the right config.txt file
|
|
|
|
for arg in "$@"
|
|
|
|
do
|
|
|
|
case "${arg}" in
|
|
|
|
--rpi3)
|
2023-04-11 11:16:39 +02:00
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi3/config.txt ${BINARIES_DIR}/rpi-firmware/config.txt
|
2023-08-21 10:05:43 +02:00
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi3/RPI_EFI.fd ${BINARIES_DIR}/rpi-firmware/RPI_EFI.fd
|
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/grub-efi.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
|
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi3/sw-description ${BINARIES_DIR}
|
2022-05-12 10:46:41 +02:00
|
|
|
;;
|
|
|
|
--rpi4)
|
2023-04-11 11:16:39 +02:00
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi4/config.txt ${BINARIES_DIR}/rpi-firmware/config.txt
|
2023-08-21 10:05:43 +02:00
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi4/RPI_EFI.fd ${BINARIES_DIR}/rpi-firmware/RPI_EFI.fd
|
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/grub-efi.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
|
|
|
|
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi4/sw-description ${BINARIES_DIR}
|
2022-05-12 10:46:41 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2023-11-30 19:24:34 +01:00
|
|
|
|
|
|
|
# Prepare home data
|
|
|
|
rm -f ${BINARIES_DIR}/homefs.ext4
|
2023-12-27 17:11:15 +01:00
|
|
|
truncate --size="6890M" ${BINARIES_DIR}/homefs.ext4
|
2023-11-30 19:24:34 +01:00
|
|
|
mkfs.ext4 -L "homefs" -E lazy_itable_init=0,lazy_journal_init=0 ${BINARIES_DIR}/homefs.ext4
|
|
|
|
|
|
|
|
# Mount home image
|
|
|
|
mkdir -p ${BINARIES_DIR}/home
|
|
|
|
sudo mount -o loop,discard ${BINARIES_DIR}/homefs.ext4 ${BINARIES_DIR}/home
|
|
|
|
|
|
|
|
# sync home folder
|
|
|
|
sudo rsync -ah --progress ${TARGET_DIR}/home/* ${BINARIES_DIR}/home/
|
|
|
|
|
|
|
|
# Unmount home image
|
|
|
|
sudo umount ${BINARIES_DIR}/homefs.ext4
|