From 4424f5ab6b0376b5e7d16d513831f8552ceeef2b Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 10 May 2018 01:11:07 +0200 Subject: [PATCH] Barebox Update (#12) * Create hassio-rauc.service * Update hassio-supervisor.service * Update hassio-rauc.service * Update hassio-supervisor.service * Update and rename hassio-rauc.service to rauc-good.service * Update rauc-good.service * Create rauc-bad.service * Update rauc-bad.service * Update rauc-good.service * Update hassio-supervisor.service * Fix barebox recovery * Create title * Create title * Create action * Create title * Create action * Create 20-boot-system1 * Rename buildroot-external/barebox-env/menu/20-boot-system1/title to buildroot-external/barebox-env/menu/20-boot-system2title * Update and rename buildroot-external/barebox-env/menu/20-boot-system2title to buildroot-external/barebox-env/menu/20-boot-system1/title * Create title * Create action * Create action * Delete autoboot_timeout * Create editcmd * Update init * Update init * Fix barebox config * Update init * Update system0 * Update system1 * Barebox cleanups * Update init * Update init * Create 0001-get-devicetree-from-file.patch * Update ova_defconfig * Update system0 * Update system1 * Create 0001-add-i-argument-to.patch * Update barebox.config * Update rauc * Rename buildroot-external/board/ova/patches/dt-util/0001-get-devicetree-from-file.patch to buildroot-external/board/ova/patches/dt-utils/0001-get-devicetree-from-file.patch * Add script * fix barebox-state --- buildroot-external/barebox-env/bin/init | 22 +--- .../barebox-env/menu/00-boot-auto/action | 3 + .../barebox-env/menu/00-boot-auto/title | 1 + .../barebox-env/menu/10-boot-system0/action | 3 + .../barebox-env/menu/10-boot-system0/title | 1 + .../barebox-env/menu/20-boot-system1/action | 3 + .../barebox-env/menu/20-boot-system1/title | 1 + .../barebox-env/menu/30-shell/action | 5 + .../barebox-env/menu/30-shell/title | 1 + buildroot-external/barebox-env/menu/title | 1 + .../barebox-env/nv/autoboot_timeout | 1 - buildroot-external/barebox-env/nv/editcmd | 1 + .../board/ova/barebox-state.dtb | Bin 1085 -> 1097 bytes .../board/ova/barebox-state.dts | 3 +- buildroot-external/board/ova/barebox.config | 8 +- .../0001-get-devicetree-from-file.patch | 123 ++++++++++++++++++ ...-support-finding-devices-by-partuuid.patch | 33 +++++ .../patches/rauc/0001-add-i-argument-to.patch | 36 +++++ buildroot-external/configs/ova_defconfig | 2 +- .../multi-user.target.wants/rauc-good.service | 1 + .../systemd/system/hassio-supervisor.service | 5 +- .../usr/lib/systemd/system/rauc-bad.service | 14 ++ .../usr/lib/systemd/system/rauc-good.service | 14 ++ ...014-package-rauc-Version-bump-to-0.4.patch | 34 +++++ buildroot/package/rauc/rauc.hash | 4 +- buildroot/package/rauc/rauc.mk | 2 +- scripts/ovf-create.sh | 0 scripts/update-dtb.sh | 3 + 28 files changed, 298 insertions(+), 27 deletions(-) create mode 100644 buildroot-external/barebox-env/menu/00-boot-auto/action create mode 100644 buildroot-external/barebox-env/menu/00-boot-auto/title create mode 100644 buildroot-external/barebox-env/menu/10-boot-system0/action create mode 100644 buildroot-external/barebox-env/menu/10-boot-system0/title create mode 100644 buildroot-external/barebox-env/menu/20-boot-system1/action create mode 100644 buildroot-external/barebox-env/menu/20-boot-system1/title create mode 100644 buildroot-external/barebox-env/menu/30-shell/action create mode 100644 buildroot-external/barebox-env/menu/30-shell/title create mode 100644 buildroot-external/barebox-env/menu/title delete mode 100644 buildroot-external/barebox-env/nv/autoboot_timeout create mode 100644 buildroot-external/barebox-env/nv/editcmd create mode 100644 buildroot-external/board/ova/patches/dt-utils/0001-get-devicetree-from-file.patch create mode 100644 buildroot-external/board/ova/patches/dt-utils/0002-support-finding-devices-by-partuuid.patch create mode 100644 buildroot-external/board/ova/patches/rauc/0001-add-i-argument-to.patch create mode 120000 buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/rauc-good.service create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-bad.service create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-good.service create mode 100644 buildroot-patches/0014-package-rauc-Version-bump-to-0.4.patch mode change 100644 => 100755 scripts/ovf-create.sh create mode 100755 scripts/update-dtb.sh diff --git a/buildroot-external/barebox-env/bin/init b/buildroot-external/barebox-env/bin/init index ea3252115..7c3d67cde 100644 --- a/buildroot-external/barebox-env/bin/init +++ b/buildroot-external/barebox-env/bin/init @@ -2,19 +2,10 @@ 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 +# Init board specific stuff [ -e /env/config-board ] && /env/config-board # Autostart @@ -22,11 +13,12 @@ for i in /env/init/*; do . $i done -echo -e -n "\nHit any key to stop autoboot: " -timeout -a $global.autoboot_timeout -autoboot="$?" +echo "- Hit m for menu or wait for autoboot -" +timeout -a 1 -v key -if [ "$autoboot" = 0 ]; then - boot +# Run menu +if [ "${key}" != "m" ]; then + boot fi +menutree diff --git a/buildroot-external/barebox-env/menu/00-boot-auto/action b/buildroot-external/barebox-env/menu/00-boot-auto/action new file mode 100644 index 000000000..f640fce9d --- /dev/null +++ b/buildroot-external/barebox-env/menu/00-boot-auto/action @@ -0,0 +1,3 @@ +#!/bin/sh + +boot diff --git a/buildroot-external/barebox-env/menu/00-boot-auto/title b/buildroot-external/barebox-env/menu/00-boot-auto/title new file mode 100644 index 000000000..115f326f8 --- /dev/null +++ b/buildroot-external/barebox-env/menu/00-boot-auto/title @@ -0,0 +1 @@ +Autoboot diff --git a/buildroot-external/barebox-env/menu/10-boot-system0/action b/buildroot-external/barebox-env/menu/10-boot-system0/action new file mode 100644 index 000000000..a33069898 --- /dev/null +++ b/buildroot-external/barebox-env/menu/10-boot-system0/action @@ -0,0 +1,3 @@ +#!/bin/sh + +boot system0 diff --git a/buildroot-external/barebox-env/menu/10-boot-system0/title b/buildroot-external/barebox-env/menu/10-boot-system0/title new file mode 100644 index 000000000..f3e92d424 --- /dev/null +++ b/buildroot-external/barebox-env/menu/10-boot-system0/title @@ -0,0 +1 @@ +Boot System 0 diff --git a/buildroot-external/barebox-env/menu/20-boot-system1/action b/buildroot-external/barebox-env/menu/20-boot-system1/action new file mode 100644 index 000000000..3fe3b33a8 --- /dev/null +++ b/buildroot-external/barebox-env/menu/20-boot-system1/action @@ -0,0 +1,3 @@ +#!/bin/sh + +boot system1 diff --git a/buildroot-external/barebox-env/menu/20-boot-system1/title b/buildroot-external/barebox-env/menu/20-boot-system1/title new file mode 100644 index 000000000..746b6d21e --- /dev/null +++ b/buildroot-external/barebox-env/menu/20-boot-system1/title @@ -0,0 +1 @@ +Boot System 1 diff --git a/buildroot-external/barebox-env/menu/30-shell/action b/buildroot-external/barebox-env/menu/30-shell/action new file mode 100644 index 000000000..fd5bc2b0c --- /dev/null +++ b/buildroot-external/barebox-env/menu/30-shell/action @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Enter 'exit' to get back to the menu" + +sh diff --git a/buildroot-external/barebox-env/menu/30-shell/title b/buildroot-external/barebox-env/menu/30-shell/title new file mode 100644 index 000000000..6567bb2d9 --- /dev/null +++ b/buildroot-external/barebox-env/menu/30-shell/title @@ -0,0 +1 @@ +Shell diff --git a/buildroot-external/barebox-env/menu/title b/buildroot-external/barebox-env/menu/title new file mode 100644 index 000000000..c1f4371f8 --- /dev/null +++ b/buildroot-external/barebox-env/menu/title @@ -0,0 +1 @@ +Hass.io OS boot Menu: diff --git a/buildroot-external/barebox-env/nv/autoboot_timeout b/buildroot-external/barebox-env/nv/autoboot_timeout deleted file mode 100644 index 0cfbf0888..000000000 --- a/buildroot-external/barebox-env/nv/autoboot_timeout +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/buildroot-external/barebox-env/nv/editcmd b/buildroot-external/barebox-env/nv/editcmd new file mode 100644 index 000000000..50fc2e706 --- /dev/null +++ b/buildroot-external/barebox-env/nv/editcmd @@ -0,0 +1 @@ +sedit diff --git a/buildroot-external/board/ova/barebox-state.dtb b/buildroot-external/board/ova/barebox-state.dtb index 77db21b89bd06e57f04b8be1570df552e5067b91..bd29d50ae506b848f98e5babd786a857483789fd 100644 GIT binary patch delta 77 zcmdnXagsye0`I@K3=Axu3=9kw3=GU?CJKl%PMN52h>8Eg#5YAO4h9Silj9h@m>f(d guVQRraR4fstj7f8Cr_?o3S@CGG+@|#nyH8p0B0T*X#fBK delta 62 zcmX@fv6n;O0`I@K3=Ax`3=9kw3=GT%CJKl%c1+Yb#Kgfc@lDa>Bt|bL28PM&7+WTr QF@c#)Oo5xPGZirc062aT<^TWy diff --git a/buildroot-external/board/ova/barebox-state.dts b/buildroot-external/board/ova/barebox-state.dts index 43400b1a6..4938b03d8 100644 --- a/buildroot-external/board/ova/barebox-state.dts +++ b/buildroot-external/board/ova/barebox-state.dts @@ -12,8 +12,7 @@ compatible = "barebox,state"; backend = <&backend_state>; backend-type = "raw"; - backend-stridesize = <1024>; - backend-storage-type = "direct"; + backend-stridesize = <4048>; bootstate { #address-cells = <1>; diff --git a/buildroot-external/board/ova/barebox.config b/buildroot-external/board/ova/barebox.config index b90495680..e21b5997f 100644 --- a/buildroot-external/board/ova/barebox.config +++ b/buildroot-external/board/ova/barebox.config @@ -3,12 +3,11 @@ CONFIG_MMU=y CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_PROMPT="hassio-os:" -CONFIG_GLOB=y -CONFIG_GLOB_SORT=y CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +# CONFIG_TIMESTAMP is not set CONFIG_BOOTM_SHOW_TYPE=y -CONFIG_BOOTM_OFTREE=y CONFIG_FLEXIBLE_BOOTARGS=y # CONFIG_PARTITION_DISK_DOS is not set CONFIG_PARTITION_DISK_EFI=y @@ -17,17 +16,18 @@ CONFIG_PARTITION_DISK_EFI=y CONFIG_DEFAULT_ENVIRONMENT_PATH="/build/buildroot-external/board/ova/barebox-env /build/buildroot-external/barebox-env" CONFIG_STATE=y CONFIG_BOOTCHOOSER=y +# CONFIG_CMD_VERSION is not set CONFIG_CMD_BOOT=y CONFIG_CMD_UIMAGE=y CONFIG_CMD_AUTOMOUNT=y CONFIG_CMD_NV=y CONFIG_CMD_EXPORT=y CONFIG_CMD_GLOBAL=y -CONFIG_CMD_MAGICVAR=y CONFIG_CMD_BASENAME=y CONFIG_CMD_DIRNAME=y CONFIG_CMD_READLINK=y CONFIG_CMD_GETOPT=y +CONFIG_CMD_MENUTREE=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_DETECT=y CONFIG_CMD_STATE=y diff --git a/buildroot-external/board/ova/patches/dt-utils/0001-get-devicetree-from-file.patch b/buildroot-external/board/ova/patches/dt-utils/0001-get-devicetree-from-file.patch new file mode 100644 index 000000000..61f098523 --- /dev/null +++ b/buildroot-external/board/ova/patches/dt-utils/0001-get-devicetree-from-file.patch @@ -0,0 +1,123 @@ +From 405590bdb7ae434798010458e810c415e4e99db4 Mon Sep 17 00:00:00 2001 +From: Steffen Trumtrar +Date: Fri, 30 Jun 2017 16:53:34 +0200 +Subject: barebox-state: get devicetree from file + +Signed-off-by: Steffen Trumtrar + +diff --git a/src/barebox-state.c b/src/barebox-state.c +index e68b8cb..3622e76 100644 +--- a/src/barebox-state.c ++++ b/src/barebox-state.c +@@ -308,7 +308,7 @@ static int state_set_var(struct state *state, const char *var, const char *val) + } + + +-struct state *state_get(const char *name, bool readonly, bool auth) ++struct state *state_get(const char *name, const char *filename, bool readonly, bool auth) + { + struct device_node *root, *node, *partition_node; + char *path; +@@ -320,11 +320,19 @@ struct state *state_get(const char *name, bool readonly, bool auth) + off_t offset; + size_t size; + +- root = of_read_proc_devicetree(); +- if (IS_ERR(root)) { +- pr_err("Unable to read devicetree. %s\n", +- strerror(-PTR_ERR(root))); +- return ERR_CAST(root); ++ if (filename) { ++ void *fdt; ++ ++ fdt = read_file(filename, NULL); ++ if (fdt) ++ root = of_unflatten_dtb(fdt); ++ } else { ++ root = of_read_proc_devicetree(); ++ if (IS_ERR(root)) { ++ pr_err("Unable to read devicetree. %s\n", ++ strerror(-PTR_ERR(root))); ++ return ERR_CAST(root); ++ } + } + + of_set_root_node(root); +@@ -387,6 +395,7 @@ static struct option long_options[] = { + {"get", required_argument, 0, 'g' }, + {"set", required_argument, 0, 's' }, + {"name", required_argument, 0, 'n' }, ++ {"input", required_argument, 0, 'i' }, + {"dump", no_argument, 0, 'd' }, + {"dump-shell", no_argument, 0, OPT_DUMP_SHELL }, + {"verbose", no_argument, 0, 'v' }, +@@ -402,6 +411,7 @@ static void usage(char *name) + "-g, --get get the value of a variable\n" + "-s, --set = set the value of a variable\n" + "-n, --name specify the state to use (default=\"state\"). Multiple states are allowed.\n" ++"-i, --input load the devicetree from a file instead of using the system devicetree.\n" + "-d, --dump dump the state\n" + "--dump-shell dump the state suitable for shell sourcing\n" + "-v, --verbose increase verbosity\n" +@@ -439,12 +449,13 @@ int main(int argc, char *argv[]) + bool readonly = true; + int pr_level = 5; + int auth = 1; ++ const char *dtb = NULL; + + INIT_LIST_HEAD(&sg_list); + INIT_LIST_HEAD(&state_list.list); + + while (1) { +- c = getopt_long(argc, argv, "hg:s:dvn:qf", long_options, &option_index); ++ c = getopt_long(argc, argv, "hg:s:i:dvn:qf", long_options, &option_index); + if (c < 0) + break; + switch (c) { +@@ -490,6 +501,9 @@ int main(int argc, char *argv[]) + ++nr_states; + break; + } ++ case 'i': ++ dtb = strdup(optarg); ++ break; + case ':': + case '?': + default: +@@ -530,7 +544,7 @@ int main(int argc, char *argv[]) + } + + list_for_each_entry(state, &state_list.list, list) { +- state->state = state_get(state->name, readonly, auth); ++ state->state = state_get(state->name, dtb, readonly, auth); + if (!IS_ERR(state->state) && !state->name) + state->name = state->state->name; + if (IS_ERR(state->state)) { +diff --git a/src/barebox-state.h b/src/barebox-state.h +index bd89cf4..a0f49a5 100644 +--- a/src/barebox-state.h ++++ b/src/barebox-state.h +@@ -1,7 +1,7 @@ + #ifndef __BAREBOX_STATE__ + #define __BAREBOX_STATE__ + +-struct state *state_get(const char *name, bool readonly, bool auth); ++struct state *state_get(const char *name, const char *file, bool readonly, bool auth); + char *state_get_var(struct state *state, const char *var); + + #endif /* __BAREBOX_STATE__ */ +diff --git a/src/keystore-blob.c b/src/keystore-blob.c +index 028dd8b..4572431 100644 +--- a/src/keystore-blob.c ++++ b/src/keystore-blob.c +@@ -30,7 +30,7 @@ int keystore_get_secret(const char *name, const unsigned char **key, int *key_le + if (!state) { + struct state *tmp; + +- tmp = state_get(keystore_state_name, true, false); ++ tmp = state_get(keystore_state_name, NULL, true, false); + if (IS_ERR(tmp)) + return PTR_ERR(tmp); + state = tmp; +-- +cgit v0.10.2 diff --git a/buildroot-external/board/ova/patches/dt-utils/0002-support-finding-devices-by-partuuid.patch b/buildroot-external/board/ova/patches/dt-utils/0002-support-finding-devices-by-partuuid.patch new file mode 100644 index 000000000..31b8b2b6d --- /dev/null +++ b/buildroot-external/board/ova/patches/dt-utils/0002-support-finding-devices-by-partuuid.patch @@ -0,0 +1,33 @@ +From 26148417fab419a0c7f301fb8f2be015324d5374 Mon Sep 17 00:00:00 2001 +From: Steffen Trumtrar +Date: Fri, 30 Jun 2017 16:53:17 +0200 +Subject: libdt: support finding devices by partuuid + +Signed-off-by: Steffen Trumtrar + +diff --git a/src/libdt.c b/src/libdt.c +index 3adeed2..2bc6cc1 100644 +--- a/src/libdt.c ++++ b/src/libdt.c +@@ -2393,6 +2393,18 @@ int of_get_devicepath(struct device_node *partition_node, char **devpath, off_t + */ + node = partition_node->parent; + ++ if (of_device_is_compatible(node, "fixed-partitions")) { ++ const char *uuid; ++ ++ /* when partuuid is specified short-circuit the search for the cdev */ ++ ret = of_property_read_string(partition_node, "partuuid", &uuid); ++ if (!ret) { ++ *devpath = basprintf("/dev/disk/by-partuuid/%s", uuid); ++ ++ return 0; ++ } ++ } ++ + /* + * Respect flash "partitions" subnode. Use parent of parent in this + * case. +-- +cgit v0.10.2 + diff --git a/buildroot-external/board/ova/patches/rauc/0001-add-i-argument-to.patch b/buildroot-external/board/ova/patches/rauc/0001-add-i-argument-to.patch new file mode 100644 index 000000000..2337970a9 --- /dev/null +++ b/buildroot-external/board/ova/patches/rauc/0001-add-i-argument-to.patch @@ -0,0 +1,36 @@ +From c9d56ea8fccf72e1c5d1f224f965e1a8e84d1b7f Mon Sep 17 00:00:00 2001 +From: Pascal Vizeli +Date: Wed, 9 May 2018 21:54:58 +0200 +Subject: [PATCH 1/1] add -i argument to barebox-state call + +--- + src/bootchooser.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/bootchooser.c b/src/bootchooser.c +index d5efc0c..c57c2f7 100644 +--- a/src/bootchooser.c ++++ b/src/bootchooser.c +@@ -77,6 +77,9 @@ static gboolean barebox_state_get(const gchar* bootname, BareboxSlotState *bb_st + g_ptr_array_add(args, g_strdup_printf(BOOTSTATE_PREFIX ".%s.priority", bootname)); + g_ptr_array_add(args, g_strdup("-g")); + g_ptr_array_add(args, g_strdup_printf(BOOTSTATE_PREFIX ".%s.remaining_attempts", bootname)); ++ ++ g_ptr_array_add(args, g_strdup("-i")); ++ g_ptr_array_add(args, g_strdup("/mnt/boot/EFI/barebox/state.dtb")); + g_ptr_array_add(args, NULL); + + sub = g_subprocess_newv((const gchar * const *)args->pdata, +@@ -170,6 +173,9 @@ static gboolean barebox_state_set(GPtrArray *pairs, GError **error) + g_ptr_array_add(args, g_strdup("-s")); + g_ptr_array_add(args, g_strdup(pairs->pdata[i])); + } ++ ++ g_ptr_array_add(args, g_strdup("-i")); ++ g_ptr_array_add(args, g_strdup("/mnt/boot/EFI/barebox/state.dtb")); + g_ptr_array_add(args, NULL); + + sub = g_subprocess_newv((const gchar * const *)args->pdata, +-- +2.7.4 + diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index 06be6a5fa..17b914de8 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -1,7 +1,7 @@ BR2_x86_64=y BR2_CCACHE=y BR2_CCACHE_DIR="$(TOPDIR)/ccache" -BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSIO_PATH)/patches" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSIO_PATH)/patches $(BR2_EXTERNAL_HASSIO_PATH)/board/ova/patches" BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_GCC_VERSION_7_X=y BR2_TOOLCHAIN_BUILDROOT_CXX=y diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/rauc-good.service b/buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/rauc-good.service new file mode 120000 index 000000000..3ff40f746 --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/systemd/system/multi-user.target.wants/rauc-good.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/rauc-good.service \ No newline at end of file diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/hassio-supervisor.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/hassio-supervisor.service index 81dc66e42..373cb9b55 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/hassio-supervisor.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/hassio-supervisor.service @@ -1,8 +1,11 @@ [Unit] Description=Hass.io supervisor Requires=docker.service -After=docker.service +After=docker.service dbus.socket RequiresMountsFor=/mnt/data +StartLimitIntervalSec=60 +StartLimitBurst=5 +OnFailure=rauc-bad.service [Service] Type=simple diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-bad.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-bad.service new file mode 100644 index 000000000..04e009b36 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-bad.service @@ -0,0 +1,14 @@ +[Unit] +Description=Rauc mark bad +Requires=rauc.service +After=rauc.service +RefuseManualStart=true +RefuseManualStop=true + +[Service] +Type=oneshot +ExecStart=/usr/bin/rauc status mark-bad +ExecStartPost=/usr/bin/systemctl reboot + +[Install] +WantedBy=multi-user.target diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-good.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-good.service new file mode 100644 index 000000000..4af9b0984 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/rauc-good.service @@ -0,0 +1,14 @@ +[Unit] +Description=Hassio rauc good +Requires=hassio-supervisor.service +After=rauc.service hassio-supervisor.service +RefuseManualStart=true +RefuseManualStop=true + +[Service] +Type=oneshot +ExecStartPre=/bin/sleep 80 +ExecStart=/usr/bin/rauc status mark-good + +[Install] +WantedBy=multi-user.target diff --git a/buildroot-patches/0014-package-rauc-Version-bump-to-0.4.patch b/buildroot-patches/0014-package-rauc-Version-bump-to-0.4.patch new file mode 100644 index 000000000..690bdd4c2 --- /dev/null +++ b/buildroot-patches/0014-package-rauc-Version-bump-to-0.4.patch @@ -0,0 +1,34 @@ +Version 0.4 supports bootloader updates to eMMC boot partitions. + +Signed-off-by: Jim Brennan +--- + package/rauc/rauc.hash | 4 ++-- + package/rauc/rauc.mk | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/package/rauc/rauc.hash b/package/rauc/rauc.hash +index 91d7c1d62e..a16340f185 100644 +--- a/package/rauc/rauc.hash ++++ b/package/rauc/rauc.hash +@@ -1,3 +1,3 @@ + # Locally calculated, after verifying against +-# https://github.com/rauc/rauc/releases/download/v0.3/rauc-0.3.tar.xz.asc +-sha256 dc01bfb08b1830376782f9a51cfec290171519267ab97cc909435da9ac6d6d98 rauc-0.3.tar.xz ++# https://github.com/rauc/rauc/releases/download/v0.4/rauc-0.4.tar.xz.asc ++sha256 89656b6330ac1f31293d450f5179896397c588ab52e77ec229382a6abd125d35 rauc-0.4.tar.xz +diff --git a/package/rauc/rauc.mk b/package/rauc/rauc.mk +index 63fbc53022..f1705a8c33 100644 +--- a/package/rauc/rauc.mk ++++ b/package/rauc/rauc.mk +@@ -4,7 +4,7 @@ + # + ################################################################################ + +-RAUC_VERSION = 0.3 ++RAUC_VERSION = 0.4 + RAUC_SITE = https://github.com/rauc/rauc/releases/download/v$(RAUC_VERSION) + RAUC_SOURCE = rauc-$(RAUC_VERSION).tar.xz + RAUC_LICENSE = LGPL-2.1 +-- +2.11.0 + diff --git a/buildroot/package/rauc/rauc.hash b/buildroot/package/rauc/rauc.hash index 91d7c1d62..a16340f18 100644 --- a/buildroot/package/rauc/rauc.hash +++ b/buildroot/package/rauc/rauc.hash @@ -1,3 +1,3 @@ # Locally calculated, after verifying against -# https://github.com/rauc/rauc/releases/download/v0.3/rauc-0.3.tar.xz.asc -sha256 dc01bfb08b1830376782f9a51cfec290171519267ab97cc909435da9ac6d6d98 rauc-0.3.tar.xz +# https://github.com/rauc/rauc/releases/download/v0.4/rauc-0.4.tar.xz.asc +sha256 89656b6330ac1f31293d450f5179896397c588ab52e77ec229382a6abd125d35 rauc-0.4.tar.xz diff --git a/buildroot/package/rauc/rauc.mk b/buildroot/package/rauc/rauc.mk index 63fbc5302..f1705a8c3 100644 --- a/buildroot/package/rauc/rauc.mk +++ b/buildroot/package/rauc/rauc.mk @@ -4,7 +4,7 @@ # ################################################################################ -RAUC_VERSION = 0.3 +RAUC_VERSION = 0.4 RAUC_SITE = https://github.com/rauc/rauc/releases/download/v$(RAUC_VERSION) RAUC_SOURCE = rauc-$(RAUC_VERSION).tar.xz RAUC_LICENSE = LGPL-2.1 diff --git a/scripts/ovf-create.sh b/scripts/ovf-create.sh old mode 100644 new mode 100755 diff --git a/scripts/update-dtb.sh b/scripts/update-dtb.sh new file mode 100755 index 000000000..1417d7026 --- /dev/null +++ b/scripts/update-dtb.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +dtc -O dtb -o buildroot-external/board/ova/barebox-state.dtb buildroot-external/board/ova/barebox-state.dts