summaryrefslogtreecommitdiffstats
path: root/arch/nios2
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-09-26 09:50:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-10-10 08:30:26 +0200
commit4d9734c8a26437838a5c1085fb3859734036e150 (patch)
treef63cf21ae773c4d24d2baecc96c6994fa814d57d /arch/nios2
parent7791ad2d59a16b76c6a0e48797e9b0ba481b67e0 (diff)
downloadbarebox-4d9734c8a26437838a5c1085fb3859734036e150.tar.gz
defaultenv: add defaultenv-1 in boards via defaultenv_append_directory()
Currently it's hardcoded for each board which defaultenv version is used. This is unfortunate since some people like the other defaultenv version better and may want to select it. This patch removes the board specific environment path CONFIG_DEFAULT_ENVIRONMENT_PATH and instead adds it via: if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC)) defaultenv_append_directory(defaultenv_<board>); This way we can make sure that the defaultenv-1 board specific bits are only compiled in when defaultenv-1 is actually in use. The next step is to make the defaultenv version selection a user visible choice. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/nios2')
-rw-r--r--arch/nios2/boards/generic/Makefile1
-rw-r--r--arch/nios2/boards/generic/defaultenv-generic/config (renamed from arch/nios2/boards/generic/env/config)0
-rw-r--r--arch/nios2/boards/generic/generic.c4
-rw-r--r--arch/nios2/configs/generic_defconfig1
4 files changed, 5 insertions, 1 deletions
diff --git a/arch/nios2/boards/generic/Makefile b/arch/nios2/boards/generic/Makefile
index d8a3d7f..f262838 100644
--- a/arch/nios2/boards/generic/Makefile
+++ b/arch/nios2/boards/generic/Makefile
@@ -1 +1,2 @@
obj-y += generic.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-generic
diff --git a/arch/nios2/boards/generic/env/config b/arch/nios2/boards/generic/defaultenv-generic/config
index 16adc49..16adc49 100644
--- a/arch/nios2/boards/generic/env/config
+++ b/arch/nios2/boards/generic/defaultenv-generic/config
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 61b60b6..0c2c67c 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -4,6 +4,7 @@
#include <partition.h>
#include <fs.h>
#include <memory.h>
+#include <envfs.h>
static int phy_address = 1;
@@ -52,6 +53,9 @@ static int generic_devices_init(void)
protect_file("/dev/env0", 1);
+ if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+ defaultenv_append_directory(defaultenv_generic);
+
return 0;
}
diff --git a/arch/nios2/configs/generic_defconfig b/arch/nios2/configs/generic_defconfig
index 39f41dd..91d364f 100644
--- a/arch/nios2/configs/generic_defconfig
+++ b/arch/nios2/configs/generic_defconfig
@@ -6,7 +6,6 @@ CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_PARTITION=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/nios2/boards/generic/env"
CONFIG_CMD_EDIT=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_SAVEENV=y