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/ppc/boards/geip-da923rc/defaultenv-geip-da923rc | |
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/ppc/boards/geip-da923rc/defaultenv-geip-da923rc')
3 files changed, 39 insertions, 0 deletions
diff --git a/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/boot b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/boot new file mode 100644 index 0000000000..ce7da18e63 --- /dev/null +++ b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/boot @@ -0,0 +1,9 @@ +#!/bin/sh +#Load the firmware images from the NOR UBIFS file system and boot + +readlink /mnt/active symlink + +bootargs="ubi.mtd=nand root=ubi0:fs-active rootfstype=ubifs rw panic=25" +cp /mnt/$symlink/uImage / +cp /mnt/$symlink/dtb / +bootm -o /dtb /uImage
\ No newline at end of file diff --git a/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/init b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/init new file mode 100644 index 0000000000..80cc2cffb3 --- /dev/null +++ b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/init @@ -0,0 +1,26 @@ +#!/bin/sh +export PATH=/env/bin + +source /env/config + +#Define a 26MB partition in flash starting at offset 0x20000 +addpart -n /dev/nor0 0x1a00000@0x20000(boot) +ubiattach /dev/boot + +if [ $? -ne 0 ]; then + echo "Fail to attach UBI device" + exit 1; +fi + +mkdir /mnt +mount -t ubifs /dev/ubi0.boot /mnt + +echo +echo -n "Hit ctrl-c to stop autoboot: " +timeout -c 5 + +if [ $? -ne 0 ]; then + exit 0 +fi + +boot diff --git a/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/config b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/config new file mode 100644 index 0000000000..79e2606a71 --- /dev/null +++ b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/config @@ -0,0 +1,4 @@ +#!/bin/sh +export bootargs="root=/dev/nfs rw ip=bootp" +eth0.ipaddr=192.168.0.136 +eth0.serverip=192.168.0.102 |