fix after merge

This commit is contained in:
Bohdan Buinich 2024-01-27 02:33:31 +02:00
parent d1ac3d4be1
commit 4b092feb65
4 changed files with 4 additions and 168 deletions

View File

@ -1,57 +0,0 @@
#!/bin/sh
set -u
set -e
BOARD_DIR="$(dirname $0)"
. "${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"
echo "VARIANT=\"${OVOS_NAME} - Buildroot Edition\""
echo "VARIANT_ID=${OVOS_ID}-${BOARD_ID}-buildroot"
} > "${TARGET_DIR}/usr/lib/os-release"
# Write machine-info
{
echo "CHASSIS=${CHASSIS}"
echo "DEPLOYMENT=${DEPLOYMENT}"
} > "${TARGET_DIR}/etc/machine-info"
cp -f ../buildroot-external/board/ovos/ova/grub-efi.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
cp -f ../buildroot-external/board/ovos/ova/cmdline.txt ${BINARIES_DIR}
cp -f ../buildroot-external/board/ovos/ova/sw-description ${BINARIES_DIR}
grub-editenv "${BINARIES_DIR}/efi-part/EFI/BOOT/grubenv" create
echo "Check for compressed kernel in ${TARGET_DIR}"
if [ -f "${TARGET_DIR}/boot/bzImage" ]; then
echo "Found bzImage, renaming to kernel"
mv ${TARGET_DIR}/boot/bzImage ${TARGET_DIR}/boot/kernel
fi
# Prepare home data
rm -f ${BINARIES_DIR}/homefs.ext4
truncate --size="6890M" ${BINARIES_DIR}/homefs.ext4
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

View File

@ -1,34 +0,0 @@
#!/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"
SWUPDATE_FILES="sw-description rootfs.squashfs"
# 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}"
pushd ${BINARIES_DIR}
for f in ${SWUPDATE_FILES} ; do
echo ${f}
done | cpio -ov -H crc > rootfs.swu
popd
exit $?

View File

@ -1,73 +0,0 @@
#!/bin/sh
set -u
set -e
BOARD_DIR="$(dirname $0)"
. "${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"
echo "VARIANT=\"${OVOS_NAME} - Buildroot Edition\""
echo "VARIANT_ID=${OVOS_ID}-${BOARD_ID}-buildroot"
} > "${TARGET_DIR}/usr/lib/os-release"
# Write machine-info
{
echo "CHASSIS=${CHASSIS}"
echo "DEPLOYMENT=${DEPLOYMENT}"
} > "${TARGET_DIR}/etc/machine-info"
cp -f ../buildroot-external/board/ovos/raspberrypi/cmdline.txt ${BINARIES_DIR}/rpi-firmware/cmdline.txt
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
# Copy the right config.txt file
for arg in "$@"
do
case "${arg}" in
--rpi3)
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi3/config.txt ${BINARIES_DIR}/rpi-firmware/config.txt
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}
;;
--rpi4)
cp -f ../buildroot-external/board/ovos/raspberrypi/rpi4/config.txt ${BINARIES_DIR}/rpi-firmware/config.txt
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}
;;
esac
done
# Prepare home data
rm -f ${BINARIES_DIR}/homefs.ext4
truncate --size="6890M" ${BINARIES_DIR}/homefs.ext4
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 -avPHSX ${TARGET_DIR}/home/* ${BINARIES_DIR}/home/
# Unmount home image
sudo umount ${BINARIES_DIR}/homefs.ext4

View File

@ -82,8 +82,8 @@ handle_kernel_renaming() {
mv "${TARGET_DIR}/boot/bzImage" "${TARGET_DIR}/boot/kernel"
fi
;;
"x86_64")
# No kernel renaming logic needed for x86_64
"pc")
# No kernel renaming logic needed for pc(x86_64)
;;
esac
}
@ -105,7 +105,7 @@ main() {
local home_mount_point="${BINARIES_DIR}/home"
mkdir -p "${home_mount_point}"
sudo mount -o loop,discard "${home_img}" "${home_mount_point}"
sudo rsync -ah --progress "${TARGET_DIR}/home/"* "${home_mount_point}/"
sudo rsync -avPHSX "${TARGET_DIR}/home/"* "${home_mount_point}/"
sudo umount "${home_img}"
}
@ -116,4 +116,4 @@ if [ "$#" -ne 2 ]; then
fi
# Call the main function
main
main