From 12b5731e203d25661f457df6ea9721b1cea0965f Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 8 Aug 2018 12:48:07 +0200 Subject: [PATCH] os: fix u-boot env size (#153) * os: fix u-boot env size * Delete fw_env.config --- .../0001-Support-HassOS-bootstate-partition.patch | 15 ++++++++------- buildroot-external/board/raspberrypi/rpi/info | 1 + buildroot-external/board/raspberrypi/rpi0-w/info | 1 + buildroot-external/board/raspberrypi/rpi2/info | 1 + buildroot-external/board/raspberrypi/rpi3-64/info | 1 + buildroot-external/board/raspberrypi/rpi3/info | 1 + buildroot-external/board/tinker/info | 1 + .../0001-Support-HassOS-bootstate-partition.patch | 15 ++++++++------- buildroot-external/board/tinker/uboot.config | 2 +- buildroot-external/bootloader/uboot.config | 2 -- buildroot-external/misc/fw_env.config | 1 - buildroot-external/scripts/rauc.sh | 2 +- 12 files changed, 24 insertions(+), 19 deletions(-) delete mode 100644 buildroot-external/misc/fw_env.config diff --git a/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch b/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch index d73a5221e..0061130fe 100644 --- a/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch +++ b/buildroot-external/board/raspberrypi/patches/uboot/0001-Support-HassOS-bootstate-partition.patch @@ -1,24 +1,25 @@ -From 1529062f72cee8061b4733e1148357d227639900 Mon Sep 17 00:00:00 2001 +From 8458beb24f2540fff3c3faed4fa068553b9e474e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli -Date: Mon, 11 Jun 2018 11:09:10 +0000 +Date: Wed, 8 Aug 2018 09:45:07 +0000 Subject: [PATCH 1/1] Support HassOS bootstate partition Signed-off-by: Pascal Vizeli --- - env/mmc.c | 4 ++++ - 1 file changed, 4 insertions(+) + env/mmc.c | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/env/mmc.c b/env/mmc.c -index 5e3da6dca7..75c06899d1 100644 +index 5e3da6dca75..353f58a12c9 100644 --- a/env/mmc.c +++ b/env/mmc.c -@@ -18,6 +18,10 @@ +@@ -18,6 +18,11 @@ #include #include ++#undef CONFIG_SYS_MMC_ENV_DEV +#define CONFIG_SYS_MMC_ENV_DEV 0 ++#undef CONFIG_ENV_OFFSET +#define CONFIG_ENV_OFFSET 0x25100000 -+#define CONFIG_ENV_SIZE 0x400000 + #define __STR(X) #X #define STR(X) __STR(X) diff --git a/buildroot-external/board/raspberrypi/rpi/info b/buildroot-external/board/raspberrypi/rpi/info index 0ffa169ab..8475fa254 100644 --- a/buildroot-external/board/raspberrypi/rpi/info +++ b/buildroot-external/board/raspberrypi/rpi/info @@ -4,3 +4,4 @@ CHASSIS=embedded BOOTLOADER=uboot KERNEL_FILE=zImage BOOT_SYS=mbr +BOOT_ENV_SIZE=0x4000 diff --git a/buildroot-external/board/raspberrypi/rpi0-w/info b/buildroot-external/board/raspberrypi/rpi0-w/info index 0b22b1b71..80dd3ee2a 100644 --- a/buildroot-external/board/raspberrypi/rpi0-w/info +++ b/buildroot-external/board/raspberrypi/rpi0-w/info @@ -4,3 +4,4 @@ CHASSIS=embedded BOOTLOADER=uboot KERNEL_FILE=zImage BOOT_SYS=mbr +BOOT_ENV_SIZE=0x4000 diff --git a/buildroot-external/board/raspberrypi/rpi2/info b/buildroot-external/board/raspberrypi/rpi2/info index a4b0f1ed0..df9e10c43 100644 --- a/buildroot-external/board/raspberrypi/rpi2/info +++ b/buildroot-external/board/raspberrypi/rpi2/info @@ -4,3 +4,4 @@ CHASSIS=embedded BOOTLOADER=uboot KERNEL_FILE=zImage BOOT_SYS=mbr +BOOT_ENV_SIZE=0x4000 diff --git a/buildroot-external/board/raspberrypi/rpi3-64/info b/buildroot-external/board/raspberrypi/rpi3-64/info index dd915d779..51a01e899 100644 --- a/buildroot-external/board/raspberrypi/rpi3-64/info +++ b/buildroot-external/board/raspberrypi/rpi3-64/info @@ -4,3 +4,4 @@ CHASSIS=embedded BOOTLOADER=uboot KERNEL_FILE=Image BOOT_SYS=mbr +BOOT_ENV_SIZE=0x4000 diff --git a/buildroot-external/board/raspberrypi/rpi3/info b/buildroot-external/board/raspberrypi/rpi3/info index 8231b5754..2e5083119 100644 --- a/buildroot-external/board/raspberrypi/rpi3/info +++ b/buildroot-external/board/raspberrypi/rpi3/info @@ -4,3 +4,4 @@ CHASSIS=embedded BOOTLOADER=uboot KERNEL_FILE=zImage BOOT_SYS=mbr +BOOT_ENV_SIZE=0x4000 diff --git a/buildroot-external/board/tinker/info b/buildroot-external/board/tinker/info index 3fe69f0fa..42e105713 100644 --- a/buildroot-external/board/tinker/info +++ b/buildroot-external/board/tinker/info @@ -4,3 +4,4 @@ CHASSIS=embedded BOOTLOADER=uboot KERNEL_FILE=zImage BOOT_SYS=spl +BOOT_ENV_SIZE=0x8000 diff --git a/buildroot-external/board/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch b/buildroot-external/board/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch index 89a5f5c57..29b0f47cb 100644 --- a/buildroot-external/board/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch +++ b/buildroot-external/board/tinker/patches/uboot/0001-Support-HassOS-bootstate-partition.patch @@ -1,24 +1,25 @@ -From 1529062f72cee8061b4733e1148357d227639900 Mon Sep 17 00:00:00 2001 +From 8458beb24f2540fff3c3faed4fa068553b9e474e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli -Date: Mon, 11 Jun 2018 11:09:10 +0000 +Date: Wed, 8 Aug 2018 09:45:07 +0000 Subject: [PATCH 1/1] Support HassOS bootstate partition Signed-off-by: Pascal Vizeli --- - env/mmc.c | 4 ++++ - 1 file changed, 4 insertions(+) + env/mmc.c | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/env/mmc.c b/env/mmc.c -index 5e3da6dca7..75c06899d1 100644 +index 5e3da6dca75..353f58a12c9 100644 --- a/env/mmc.c +++ b/env/mmc.c -@@ -18,6 +18,10 @@ +@@ -18,6 +18,11 @@ #include #include ++#undef CONFIG_SYS_MMC_ENV_DEV +#define CONFIG_SYS_MMC_ENV_DEV 1 ++#undef CONFIG_ENV_OFFSET +#define CONFIG_ENV_OFFSET 0x25100000 -+#define CONFIG_ENV_SIZE 0x400000 + #define __STR(X) #X #define STR(X) __STR(X) diff --git a/buildroot-external/board/tinker/uboot.config b/buildroot-external/board/tinker/uboot.config index 7256777b9..690c9c65b 100644 --- a/buildroot-external/board/tinker/uboot.config +++ b/buildroot-external/board/tinker/uboot.config @@ -1,4 +1,4 @@ # CONFIG_USB_STORAGE is not set CONFIG_DM_VIDEO=y CONFIG_CMD_FILEENV=y - +CONFIG_ENV_OFFSET=0x25100000 diff --git a/buildroot-external/bootloader/uboot.config b/buildroot-external/bootloader/uboot.config index 37681e718..991646358 100644 --- a/buildroot-external/bootloader/uboot.config +++ b/buildroot-external/bootloader/uboot.config @@ -16,5 +16,3 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_CONSOLE_SCROLL_LINES=10 # CONFIG_EFI_LOADER is not set CONFIG_CMD_SETEXPR=y -CONFIG_ENV_OFFSET=0x25100000 -CONFIG_ENV_SIZE=0x400000 diff --git a/buildroot-external/misc/fw_env.config b/buildroot-external/misc/fw_env.config deleted file mode 100644 index 0c32175e7..000000000 --- a/buildroot-external/misc/fw_env.config +++ /dev/null @@ -1 +0,0 @@ -/dev/disk/by-partlabel/hassos-bootstate 0x00 0x400000 diff --git a/buildroot-external/scripts/rauc.sh b/buildroot-external/scripts/rauc.sh index 65a37acac..effde7a4c 100755 --- a/buildroot-external/scripts/rauc.sh +++ b/buildroot-external/scripts/rauc.sh @@ -77,7 +77,7 @@ function install_rauc_certs() { function install_bootloader_config() { if [ "${BOOTLOADER}" == "uboot" ]; then - cp ${BR2_EXTERNAL_HASSOS_PATH}/misc/fw_env.config ${TARGET_DIR}/etc/fw_env.config + echo -e "/dev/disk/by-partlabel/hassos-bootstatei\t0x00\t${BOOT_ENV_SIZE}" > ${TARGET_DIR}/etc/fw_env.config else cp ${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb ${TARGET_DIR}/etc/barebox-state.dtb fi