From 05ca042c40e242f8bf513b3aebae7e3e664beee9 Mon Sep 17 00:00:00 2001 From: "[anp/hsw]" Date: Sat, 12 Oct 2024 00:58:47 +0700 Subject: [PATCH 1/4] do not store default mac address with quotes --- uboot-5.x.x.x/common/cmd_nvedit.c | 2 +- uboot-5.x.x.x/common/env_common.c | 8 ++++---- uboot-5.x.x.x/common/environment.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/uboot-5.x.x.x/common/cmd_nvedit.c b/uboot-5.x.x.x/common/cmd_nvedit.c index 7521b88..333bf85 100644 --- a/uboot-5.x.x.x/common/cmd_nvedit.c +++ b/uboot-5.x.x.x/common/cmd_nvedit.c @@ -195,7 +195,7 @@ int _do_setenv (int flag, int argc, char *argv[]) if ( (strcmp (name, "serial#") == 0) || ((strcmp (name, "ethaddr") == 0) #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR) - && (strcmp (env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0) + && (strcmp (env_get_addr(oldval),CONFIG_ETHADDR) != 0) #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */ ) ) { printf ("Can't overwrite \"%s\"\n", name); diff --git a/uboot-5.x.x.x/common/env_common.c b/uboot-5.x.x.x/common/env_common.c index 0d7647f..12f2bd6 100644 --- a/uboot-5.x.x.x/common/env_common.c +++ b/uboot-5.x.x.x/common/env_common.c @@ -86,16 +86,16 @@ uchar default_environment[] = { "loads_echo=" MK_STR(CONFIG_LOADS_ECHO) "\0" #endif #ifdef CONFIG_ETHADDR - "ethaddr=" MK_STR(CONFIG_ETHADDR) "\0" + "ethaddr=" CONFIG_ETHADDR "\0" #endif #ifdef CONFIG_ETH1ADDR - "eth1addr=" MK_STR(CONFIG_ETH1ADDR) "\0" + "eth1addr=" CONFIG_ETH1ADDR "\0" #endif #ifdef CONFIG_ETH2ADDR - "eth2addr=" MK_STR(CONFIG_ETH2ADDR) "\0" + "eth2addr=" CONFIG_ETH2ADDR "\0" #endif #ifdef CONFIG_ETH3ADDR - "eth3addr=" MK_STR(CONFIG_ETH3ADDR) "\0" + "eth3addr=" CONFIG_ETH3ADDR "\0" #endif #ifdef CONFIG_IPADDR "ipaddr=" MK_STR(CONFIG_IPADDR) "\0" diff --git a/uboot-5.x.x.x/common/environment.c b/uboot-5.x.x.x/common/environment.c index ce06bf6..0920845 100644 --- a/uboot-5.x.x.x/common/environment.c +++ b/uboot-5.x.x.x/common/environment.c @@ -122,16 +122,16 @@ env_t environment __PPCENV__ = { "loads_echo=" MK_STR(CONFIG_LOADS_ECHO) "\0" #endif #ifdef CONFIG_ETHADDR - "ethaddr=" MK_STR(CONFIG_ETHADDR) "\0" + "ethaddr=" CONFIG_ETHADDR "\0" #endif #ifdef CONFIG_ETH1ADDR - "eth1addr=" MK_STR(CONFIG_ETH1ADDR) "\0" + "eth1addr=" CONFIG_ETH1ADDR "\0" #endif #ifdef CONFIG_ETH2ADDR - "eth2addr=" MK_STR(CONFIG_ETH2ADDR) "\0" + "eth2addr=" CONFIG_ETH2ADDR "\0" #endif #ifdef CONFIG_ETH3ADDR - "eth3addr=" MK_STR(CONFIG_ETH3ADDR) "\0" + "eth3addr=" CONFIG_ETH3ADDR "\0" #endif #ifdef CONFIG_ETHPRIME "ethprime=" CONFIG_ETHPRIME "\0" From 8272e316374f9880ee09e85be253d1cbb2e3d989 Mon Sep 17 00:00:00 2001 From: "[anp/hsw]" Date: Sat, 12 Oct 2024 01:09:48 +0700 Subject: [PATCH 2/4] Add missing CONFIG_OVERWRITE_ETHADDR_ONCE option --- uboot-5.x.x.x/config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/uboot-5.x.x.x/config.in b/uboot-5.x.x.x/config.in index 4d012b8..df89375 100644 --- a/uboot-5.x.x.x/config.in +++ b/uboot-5.x.x.x/config.in @@ -1811,6 +1811,7 @@ define_hex TEXT_BASE 0xBC000000 fi fi +bool 'Allow setting ethaddr env only once' CONFIG_OVERWRITE_ETHADDR_ONCE n ################################################################################################## comment "" bool 'HTTPD server' HTTPD_SUPPORT n From 8c37dce2937d97781583e920c28c79b3377c1726 Mon Sep 17 00:00:00 2001 From: "[anp/hsw]" Date: Sat, 12 Oct 2024 01:20:53 +0700 Subject: [PATCH 3/4] Add missing CONFIG_ENV_OVERWRITE option --- uboot-5.x.x.x/config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/uboot-5.x.x.x/config.in b/uboot-5.x.x.x/config.in index df89375..608ae64 100644 --- a/uboot-5.x.x.x/config.in +++ b/uboot-5.x.x.x/config.in @@ -1811,6 +1811,7 @@ define_hex TEXT_BASE 0xBC000000 fi fi +bool 'Allow env overwriting' CONFIG_ENV_OVERWRITE y bool 'Allow setting ethaddr env only once' CONFIG_OVERWRITE_ETHADDR_ONCE n ################################################################################################## comment "" From f06f288648f4f7a00a3d58d3bd702510ab34906d Mon Sep 17 00:00:00 2001 From: "[anp/hsw]" Date: Sat, 12 Oct 2024 09:26:44 +0700 Subject: [PATCH 4/4] Add dependency for CONFIG_OVERWRITE_ETHADDR_ONCE option --- uboot-5.x.x.x/config.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uboot-5.x.x.x/config.in b/uboot-5.x.x.x/config.in index 608ae64..5e44467 100644 --- a/uboot-5.x.x.x/config.in +++ b/uboot-5.x.x.x/config.in @@ -1812,7 +1812,9 @@ fi fi bool 'Allow env overwriting' CONFIG_ENV_OVERWRITE y +if [ "$CONFIG_ENV_OVERWRITE" = "y" ]; then bool 'Allow setting ethaddr env only once' CONFIG_OVERWRITE_ETHADDR_ONCE n +fi ################################################################################################## comment "" bool 'HTTPD server' HTTPD_SUPPORT n