From 4d9734c8a26437838a5c1085fb3859734036e150 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 26 Sep 2016 09:50:08 +0200 Subject: 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_); 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 --- arch/arm/boards/guf-neso/Makefile | 1 + arch/arm/boards/guf-neso/board.c | 4 ++ .../arm/boards/guf-neso/defaultenv-guf-neso/config | 47 ++++++++++++++++++++++ arch/arm/boards/guf-neso/env/config | 47 ---------------------- 4 files changed, 52 insertions(+), 47 deletions(-) create mode 100644 arch/arm/boards/guf-neso/defaultenv-guf-neso/config delete mode 100644 arch/arm/boards/guf-neso/env/config (limited to 'arch/arm/boards/guf-neso') diff --git a/arch/arm/boards/guf-neso/Makefile b/arch/arm/boards/guf-neso/Makefile index 81263ccab0..af90c36c7e 100644 --- a/arch/arm/boards/guf-neso/Makefile +++ b/arch/arm/boards/guf-neso/Makefile @@ -1,3 +1,4 @@ lwl-y += lowlevel.o obj-y += board.o obj-y += pll_init.o +bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-guf-neso diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c index 176d77e7b3..e1cd9098e0 100644 --- a/arch/arm/boards/guf-neso/board.c +++ b/arch/arm/boards/guf-neso/board.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -282,6 +283,9 @@ static int neso_devices_init(void) armlinux_set_architecture(MACH_TYPE_NESO); + if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC)) + defaultenv_append_directory(defaultenv_guf_neso); + return 0; } diff --git a/arch/arm/boards/guf-neso/defaultenv-guf-neso/config b/arch/arm/boards/guf-neso/defaultenv-guf-neso/config new file mode 100644 index 0000000000..bd44a555d9 --- /dev/null +++ b/arch/arm/boards/guf-neso/defaultenv-guf-neso/config @@ -0,0 +1,47 @@ +#!/bin/sh + +eth0.serverip= +user= + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=dhcp + +# or set your networking parameters here +#eth0.ipaddr=a.b.c.d +#eth0.netmask=a.b.c.d +#eth0.gateway=a.b.c.d +#eth0.serverip=a.b.c.d + +# can be either 'nfs', 'tftp', 'nor' or 'nand' +kernel_loc=tftp +# can be either 'net', 'nor', 'nand' or 'initrd' +rootfs_loc=net + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root-${global.hostname}.$rootfs_type + +kernelimage=zImage-${global.hostname} +#kernelimage=uImage-${global.hostname} +#kernelimage=Image-${global.hostname} +#kernelimage=Image-${global.hostname}.lzo + +if [ -n $user ]; then + kernelimage="$user"-"$kernelimage" + nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" + rootfsimage="$user"-"$rootfsimage" +else + nfsroot="$eth0.serverip:/path/to/nfs/root" +fi + +autoboot_timeout=3 + +bootargs="console=ttymxc0,115200" + +nand_parts="256k(barebox)ro,512k(bareboxenv),2M(kernel),-(root)" +rootfs_mtdblock_nand=3 + +# set a fancy prompt (if support is compiled in) +PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m " + diff --git a/arch/arm/boards/guf-neso/env/config b/arch/arm/boards/guf-neso/env/config deleted file mode 100644 index bd44a555d9..0000000000 --- a/arch/arm/boards/guf-neso/env/config +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -eth0.serverip= -user= - -# use 'dhcp' to do dhcp in barebox and in kernel -# use 'none' if you want to skip kernel ip autoconfiguration -ip=dhcp - -# or set your networking parameters here -#eth0.ipaddr=a.b.c.d -#eth0.netmask=a.b.c.d -#eth0.gateway=a.b.c.d -#eth0.serverip=a.b.c.d - -# can be either 'nfs', 'tftp', 'nor' or 'nand' -kernel_loc=tftp -# can be either 'net', 'nor', 'nand' or 'initrd' -rootfs_loc=net - -# can be either 'jffs2' or 'ubifs' -rootfs_type=ubifs -rootfsimage=root-${global.hostname}.$rootfs_type - -kernelimage=zImage-${global.hostname} -#kernelimage=uImage-${global.hostname} -#kernelimage=Image-${global.hostname} -#kernelimage=Image-${global.hostname}.lzo - -if [ -n $user ]; then - kernelimage="$user"-"$kernelimage" - nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}" - rootfsimage="$user"-"$rootfsimage" -else - nfsroot="$eth0.serverip:/path/to/nfs/root" -fi - -autoboot_timeout=3 - -bootargs="console=ttymxc0,115200" - -nand_parts="256k(barebox)ro,512k(bareboxenv),2M(kernel),-(root)" -rootfs_mtdblock_nand=3 - -# set a fancy prompt (if support is compiled in) -PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m " - -- cgit v1.2.3