mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-12-26 13:21:28 +00:00
* Refresh fileenv patch for U-Boot 2025.01 * Update Tinker to U-Boot 2025.01 Needs minor patch adjustment, also fixed patch numbering. * Update ODROID-N2 to U-Boot 2025.01, move eMMC patch Move the patch for eMMC so it's applied only for N2 specifically and update it for 2025.01. * Update ODROID-C/XU to U-Boot 2025.01 No changes in patches necessary after moving the N2 patch. * Update RPi boards to U-Boot 2025.01 Changes needed in bcmstb PCIe driver due to upstream refactoring, rest only refreshed. All patches now target the same version, so we can drop one of the series. * Update VIM3 to U-Boot 2025.01 No patches here, just version bump. * Update Green to U-Boot 2025.01 Updated and refreshed patches, added a patch to disable OF_UPSTREAM which is now needed. * Update ODROID-M1 to U-Boot 2025.01 Drop patch that has been mostly merged upstream. The change is that HS400 would stay enabled but let's get back to what upstream does. * Update ODROID-M1 to U-Boot 2025.01 Drop all patches as M1S support should be now merged to U-Boot and DTS taken from upstream. * Disable DFU and mkeficapsule to fix build mkeficapsule requires gnutls to be built first but it's not among dependencies. Since we don't need the tool, we can disable it. DFU is also not used on HAOS and it implies EFI_LOADER that we already disable. Moreover, that also sets SET_DFU_ALT_INFO and leads to linker failure on some platforms where it's not implemented. * fixup! Update Green to U-Boot 2025.01 There were more changes needed in the Green config to use correct memory layout due to upstream changes, otherwise we'll have malloc failures in U-Boot proper. * Move N2 eMMC patch to more generic patches-meson To stay on the safe side, move the eMMC hack to more generic folder that's used for all targets using the meson_gx eMMC driver (i.e. C2, C4 and N2). This is still better than keeping it in hardkernel/patches which is applied only to some hardkernel boards (like it was before bump to U-Boot 20205.01).
93 lines
2.2 KiB
Diff
93 lines
2.2 KiB
Diff
From 4af7bcd52d0b6c8df3129a2f35035c6a1b62848d Mon Sep 17 00:00:00 2001
|
|
From: Pascal Vizeli <pvizeli@syshack.ch>
|
|
Date: Sun, 5 Aug 2018 20:43:03 +0000
|
|
Subject: [PATCH] CMD: read string from fileinto env
|
|
|
|
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
|
|
---
|
|
cmd/Kconfig | 5 +++++
|
|
cmd/Makefile | 1 +
|
|
cmd/fileenv.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
|
|
3 files changed, 51 insertions(+)
|
|
create mode 100644 cmd/fileenv.c
|
|
|
|
diff --git a/cmd/Kconfig b/cmd/Kconfig
|
|
index 1d7ddb4ed36..0c0ce749000 100644
|
|
--- a/cmd/Kconfig
|
|
+++ b/cmd/Kconfig
|
|
@@ -1792,6 +1792,11 @@ config CMD_XXD
|
|
help
|
|
Print file as hexdump to standard output
|
|
|
|
+config CMD_FILEENV
|
|
+ bool "fileenv"
|
|
+ help
|
|
+ Read a file into memory and store it to env.
|
|
+
|
|
endmenu
|
|
|
|
if NET || NET_LWIP
|
|
diff --git a/cmd/Makefile b/cmd/Makefile
|
|
index d1f369deec0..7ad9d3720c0 100644
|
|
--- a/cmd/Makefile
|
|
+++ b/cmd/Makefile
|
|
@@ -170,6 +170,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
|
|
obj-$(CONFIG_CMD_SEAMA) += seama.o
|
|
obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
|
|
obj-$(CONFIG_CMD_SETEXPR_FMT) += printf.o
|
|
+obj-$(CONFIG_CMD_FILEENV) += fileenv.o
|
|
obj-$(CONFIG_CMD_SPI) += spi.o
|
|
obj-$(CONFIG_CMD_STRINGS) += strings.o
|
|
obj-$(CONFIG_CMD_SMBIOS) += smbios.o
|
|
diff --git a/cmd/fileenv.c b/cmd/fileenv.c
|
|
new file mode 100644
|
|
index 00000000000..4154c8df0f0
|
|
--- /dev/null
|
|
+++ b/cmd/fileenv.c
|
|
@@ -0,0 +1,45 @@
|
|
+#include <config.h>
|
|
+#include <command.h>
|
|
+#include <fs.h>
|
|
+#include <linux/ctype.h>
|
|
+
|
|
+static char *fs_argv[5];
|
|
+
|
|
+int do_fileenv(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
|
|
+{
|
|
+ if (argc < 6)
|
|
+ return CMD_RET_USAGE;
|
|
+
|
|
+ fs_argv[0] = "fatload";
|
|
+ fs_argv[1] = argv[1];
|
|
+ fs_argv[2] = argv[2];
|
|
+ fs_argv[3] = argv[3];
|
|
+ fs_argv[4] = argv[4];
|
|
+
|
|
+ if (do_fat_fsload(cmdtp, 0, 5, fs_argv) != 0)
|
|
+ return 1;
|
|
+
|
|
+ char *addr = (char *)simple_strtoul(argv[3], NULL, 16);
|
|
+ size_t size = env_get_hex("filesize", 0);
|
|
+
|
|
+ // Prepare string
|
|
+ addr[size] = 0x00;
|
|
+ char *s = addr;
|
|
+ while(*s != 0x00) {
|
|
+ if (isprint(*s)) {
|
|
+ s++;
|
|
+ }
|
|
+ else {
|
|
+ *s = 0x00;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return env_set(argv[5], addr);
|
|
+}
|
|
+
|
|
+U_BOOT_CMD(
|
|
+ fileenv, 6, 0, do_fileenv,
|
|
+ "Read file and store it into env.",
|
|
+ "<interface> <dev:part> <addr> <filename> <envname>\n"
|
|
+ " - Read file from fat32 and store it as env."
|
|
+);
|