diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-09-26 09:50:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-10-10 08:30:26 +0200 |
commit | 4d9734c8a26437838a5c1085fb3859734036e150 (patch) | |
tree | f63cf21ae773c4d24d2baecc96c6994fa814d57d /arch/arm/boards/at91sam9n12ek/init.c | |
parent | 7791ad2d59a16b76c6a0e48797e9b0ba481b67e0 (diff) | |
download | barebox-4d9734c8a26437838a5c1085fb3859734036e150.tar.gz barebox-4d9734c8a26437838a5c1085fb3859734036e150.tar.xz |
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/arm/boards/at91sam9n12ek/init.c')
-rw-r--r-- | arch/arm/boards/at91sam9n12ek/init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/boards/at91sam9n12ek/init.c b/arch/arm/boards/at91sam9n12ek/init.c index 2ed58c1995..b9431b2ee1 100644 --- a/arch/arm/boards/at91sam9n12ek/init.c +++ b/arch/arm/boards/at91sam9n12ek/init.c @@ -24,6 +24,7 @@ #include <fs.h> #include <fcntl.h> #include <io.h> +#include <envfs.h> #include <mach/hardware.h> #include <nand.h> #include <linux/sizes.h> @@ -327,6 +328,9 @@ static int at91sam9n12ek_devices_init(void) devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1"); dev_add_bb_dev("env_raw1", "env1"); + if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC)) + defaultenv_append_directory(defaultenv_at91sam9n12ek); + return 0; } device_initcall(at91sam9n12ek_devices_init); |