diff --git a/buildroot-external/barebox-env/bin/init b/buildroot-external/barebox-env/bin/init new file mode 100644 index 000000000..ea3252115 --- /dev/null +++ b/buildroot-external/barebox-env/bin/init @@ -0,0 +1,32 @@ +#!/bin/sh + +export PATH=/env/bin + +global autoboot_timeout +global boot.default +global linux.bootargs.base +global linux.bootargs.console +#linux.bootargs.dyn.* will be cleared at the beginning of boot +global linux.bootargs.dyn.root +global editcmd + +[ -z "${global.autoboot_timeout}" ] && global.autoboot_timeout=3 +magicvar -a global.autoboot_timeout "timeout in seconds before automatic booting" +[ -z "${global.boot.default}" ] && global.boot.default="system0" +[ -z "${global.editcmd}" ] && global.editcmd=sedit + +[ -e /env/config-board ] && /env/config-board + +# Autostart +for i in /env/init/*; do + . $i +done + +echo -e -n "\nHit any key to stop autoboot: " +timeout -a $global.autoboot_timeout +autoboot="$?" + +if [ "$autoboot" = 0 ]; then + boot +fi + diff --git a/buildroot-external/barebox-env/init/bootchooser b/buildroot-external/barebox-env/init/bootchooser new file mode 100644 index 000000000..39dd9ab03 --- /dev/null +++ b/buildroot-external/barebox-env/init/bootchooser @@ -0,0 +1,9 @@ +#!/bin/sh + +global bootchooser.targets +global bootchooser.system0.boot +global bootchooser.system1.boot + +[ -z "${global.bootchooser.targets}" ] && global.bootchooser.targets="system0 system1" +[ -z "${global.bootchooser.system0.boot}" ] && global.bootchooser.system0.boot="system0" +[ -z "${global.bootchooser.system1.boot}" ] && global.bootchooser.system1.boot="system1" diff --git a/buildroot-external/barebox-env/nv/autoboot_timeout b/buildroot-external/barebox-env/nv/autoboot_timeout new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/buildroot-external/barebox-env/nv/autoboot_timeout @@ -0,0 +1 @@ +2 diff --git a/buildroot-external/barebox-env/nv/boot.default b/buildroot-external/barebox-env/nv/boot.default new file mode 100644 index 000000000..fe1a363da --- /dev/null +++ b/buildroot-external/barebox-env/nv/boot.default @@ -0,0 +1 @@ +bootchooser diff --git a/buildroot-external/barebox-env/nv/bootchooser.system0.boot b/buildroot-external/barebox-env/nv/bootchooser.system0.boot new file mode 100644 index 000000000..cf27226bd --- /dev/null +++ b/buildroot-external/barebox-env/nv/bootchooser.system0.boot @@ -0,0 +1 @@ +system0 diff --git a/buildroot-external/barebox-env/nv/bootchooser.system0.priority b/buildroot-external/barebox-env/nv/bootchooser.system0.priority new file mode 100644 index 000000000..f599e28b8 --- /dev/null +++ b/buildroot-external/barebox-env/nv/bootchooser.system0.priority @@ -0,0 +1 @@ +10 diff --git a/buildroot-external/barebox-env/nv/bootchooser.system1.boot b/buildroot-external/barebox-env/nv/bootchooser.system1.boot new file mode 100644 index 000000000..3c81949c4 --- /dev/null +++ b/buildroot-external/barebox-env/nv/bootchooser.system1.boot @@ -0,0 +1 @@ +system1 diff --git a/buildroot-external/barebox-env/nv/bootchooser.system1.priority b/buildroot-external/barebox-env/nv/bootchooser.system1.priority new file mode 100644 index 000000000..209e3ef4b --- /dev/null +++ b/buildroot-external/barebox-env/nv/bootchooser.system1.priority @@ -0,0 +1 @@ +20 diff --git a/buildroot-external/barebox-env/nv/bootchooser.targets b/buildroot-external/barebox-env/nv/bootchooser.targets new file mode 100644 index 000000000..f0fb14eea --- /dev/null +++ b/buildroot-external/barebox-env/nv/bootchooser.targets @@ -0,0 +1 @@ +system0 system1 diff --git a/buildroot-external/board/ova/barebox.config b/buildroot-external/board/ova/barebox.config index 3696195ab..5f126034d 100644 --- a/buildroot-external/board/ova/barebox.config +++ b/buildroot-external/board/ova/barebox.config @@ -13,7 +13,7 @@ CONFIG_FLEXIBLE_BOOTARGS=y CONFIG_PARTITION_DISK_EFI=y # CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE is not set # CONFIG_PARTITION_DISK_EFI_GPT_COMPARE is not set -CONFIG_DEFAULT_ENVIRONMENT_PATH="/build/buildroot-external/board/ova/barebox-env" +CONFIG_DEFAULT_ENVIRONMENT_PATH="/build/buildroot-external/board/ova/barebox-env /build/buildroot-external/barebox-env" CONFIG_STATE=y CONFIG_BOOTCHOOSER=y CONFIG_CMD_BOOT=y @@ -40,7 +40,6 @@ CONFIG_USB_HOST=y CONFIG_VIDEO=y CONFIG_DRIVER_VIDEO_EFI_GOP=y CONFIG_CLOCKSOURCE_EFI=y -CONFIG_FS_EXT4=y CONFIG_FS_EFI=y CONFIG_FS_EFIVARFS=y CONFIG_FS_FAT=y diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index 9341e8a92..2af895b05 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -53,7 +53,7 @@ BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y BR2_TARGET_BAREBOX=y BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG=y BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSIO_PATH)/board/ova/barebox.config" -BR2_TARGET_BAREBOX_CUSTOM_EMBEDDED_ENV_PATH="$(BR2_EXTERNAL_HASSIO_PATH)/board/ova/barebox-env" +BR2_TARGET_BAREBOX_CUSTOM_EMBEDDED_ENV_PATH="$(BR2_EXTERNAL_HASSIO_PATH)/board/ova/barebox-env $(BR2_EXTERNAL_HASSIO_PATH)/barebox-env" BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_GENIMAGE=y