[ALL] First try-out on pre loading the podman containers at buildtime

This commit is contained in:
j1nx 2023-11-30 18:24:34 +00:00
parent 446aecb4da
commit 9da8f7a580
11 changed files with 62 additions and 26 deletions

@ -1 +1 @@
Subproject commit fa179b6a0755fbb8591f1782080c2bcdd5069d40
Subproject commit 8d3a8bfd1a561f15dae900eb6da81f9718208f46

View File

@ -19,14 +19,6 @@ image overlayfs.ext4 {
size = 256M
}
image homefs.ext4 {
name = "homefs"
ext4 {
use-mke2fs = "true"
}
size = 64M
}
image disk.img {
hdimage {
partition-table-type = "gpt"

View File

@ -40,3 +40,18 @@ 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="5G" ${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

@ -56,3 +56,18 @@ do
;;
esac
done
# Prepare home data
rm -f ${BINARIES_DIR}/homefs.ext4
truncate --size="5G" ${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

@ -31,14 +31,6 @@ image overlayfs.ext4 {
size = 256M
}
image homefs.ext4 {
name = "homefs"
ext4 {
use-mke2fs = "true"
}
size = 64M
}
image disk.img {
hdimage {
partition-table-type = "hybrid"

View File

@ -28,14 +28,6 @@ image overlayfs.ext4 {
size = 256M
}
image homefs.ext4 {
name = "homefs"
ext4 {
use-mke2fs = "true"
}
size = 64M
}
image disk.img {
hdimage {
partition-table-type = "gpt"

View File

@ -320,4 +320,7 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_PKGCONF=y
BR2_PACKAGE_HOSTNAME_SERVICE=y
BR2_PACKAGE_NCPAMIXER=y
BR2_PACKAGE_OVOS_CONTAINERS=y
BR2_PACKAGE_OVOS_CONTAINERS_ARCH="x86_64"
BR2_PACKAGE_OVOS_CONTAINERS_IMAGES="ovos-messagebus"
BR2_PACKAGE_OVOS_SPLASH=y

View File

@ -305,6 +305,9 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_PKGCONF=y
BR2_PACKAGE_HOSTNAME_SERVICE=y
BR2_PACKAGE_NCPAMIXER=y
BR2_PACKAGE_OVOS_CONTAINERS=y
BR2_PACKAGE_OVOS_CONTAINERS_ARCH="aarch64"
BR2_PACKAGE_OVOS_CONTAINERS_IMAGES="ovos-messagebus"
BR2_PACKAGE_OVOS_SPLASH=y
BR2_PACKAGE_RESPEAKER=y
BR2_PACKAGE_RPI_EEPROM=y

View File

@ -304,6 +304,9 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_PKGCONF=y
BR2_PACKAGE_HOSTNAME_SERVICE=y
BR2_PACKAGE_NCPAMIXER=y
BR2_PACKAGE_OVOS_CONTAINERS=y
BR2_PACKAGE_OVOS_CONTAINERS_ARCH="aarch64"
BR2_PACKAGE_OVOS_CONTAINERS_IMAGES="ovos-messagebus"
BR2_PACKAGE_OVOS_SPLASH=y
BR2_PACKAGE_RESPEAKER=y
BR2_PACKAGE_RPI_EEPROM=y

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
build_dir=$1
dst_dir=$2
# shellcheck disable=SC2045
for image in $(ls -S ${build_dir}/images/*.tar); do
podman --root "${dst_dir}" load --input "${image}"
done

View File

@ -10,7 +10,8 @@ OVOS_CONTAINERS_LICENSE_FILES = $(BR2_EXTERNAL_OPENVOICEOS_PATH)/../LICENSE
OVOS_CONTAINERS_SITE = $(BR2_EXTERNAL_OPENVOICEOS_PATH)/package/ovos-containers
OVOS_CONTAINERS_SITE_METHOD = local
OVOS_CONTAINERS_IMAGES = $(call qstrip,$(BR2_PACKAGE_OVOS_CONTAINERS))
#OVOS_CONTAINERS_IMAGES = $(call qstrip, $(BR2_PACKAGE_OVOS_CONTAINERS))
OVOS_CONTAINERS_IMAGES = ovos-messagebus ovos-phal ovos-phal-admin ovos-listener-dinkum ovos-audio ovos-core ovos-cli ovos-gui-websocket ovos-gui-shell
define OVOS_CONTAINERS_BUILD_CMDS
$(Q)mkdir -p $(@D)/images
@ -21,4 +22,13 @@ define OVOS_CONTAINERS_BUILD_CMDS
)
endef
OVOS_CONTAINERS_INSTALL_IMAGES = YES
define OVOS_CONTAINERS_INSTALL_IMAGES_CMDS
$(BR2_EXTERNAL_OPENVOICEOS_PATH)/package/ovos-containers/install-container-image.sh "$(@D)" "$(TARGET_DIR)/home/ovos/.local/share/containers/storage"
rm -rf $(TARGET_DIR)/home/ovos/.local/share/containers/storage/storage.lock
rm -rf $(TARGET_DIR)/home/ovos/.local/share/containers/storage/userns.lock
rm -rf $(TARGET_DIR)/home/ovos/.local/share/containers/storage/libpod
endef
$(eval $(generic-package))