summaryrefslogtreecommitdiffstats
path: root/defaultenv-2
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-09-22 13:09:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-30 07:45:04 +0200
commit28141f9e5a465571cf79505b2fd4b9ae207b9ce3 (patch)
treee87467cc448b9e833a581c7593c03e36f2f3cee9 /defaultenv-2
parent5a968fc81cf1f922733349469072b278efcc6806 (diff)
downloadbarebox-28141f9e5a465571cf79505b2fd4b9ae207b9ce3.tar.gz
barebox-28141f9e5a465571cf79505b2fd4b9ae207b9ce3.tar.xz
defenv-2: replace boot script with command
This replaces the 'boot' script in the defaultenv-2 with a command with the same behaviour. A command gives more flexibility for future externsions Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv-2')
-rw-r--r--defaultenv-2/base/bin/_boot44
-rw-r--r--defaultenv-2/base/bin/_boot_help20
-rw-r--r--defaultenv-2/base/bin/_boot_list7
-rw-r--r--defaultenv-2/base/bin/boot65
4 files changed, 0 insertions, 136 deletions
diff --git a/defaultenv-2/base/bin/_boot b/defaultenv-2/base/bin/_boot
deleted file mode 100644
index 71d149082c..0000000000
--- a/defaultenv-2/base/bin/_boot
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-# The real boot script, to be called from _boot_list which is called
-# from boot
-
-. /env/data/ansi-colors
-
-# clear linux.bootargs.dyn.* and bootm.*
-global -r linux.bootargs.dyn.
-global -r bootm.
-
-file="$1"
-
-scr=/env/boot/$file
-if [ ! -f "$scr" ]; then
- scr="$file"
-fi
-
-if [ ! -f "$scr" ]; then
- echo -e "${RED}/env/boot/${file}${NC} or ${RED}${file}${NC} do not exist"
- _boot_help
- exit 2
-fi
-
-if [ -L $scr ]; then
- readlink -f $scr boot
- basename $boot link
- basename $scr boot
- echo -e "${GREEN}boot${NC} ${YELLOW}${boot}${NC} -> ${CYAN}${link}${NC}"
-else
- echo -e "${GREEN}booting ${YELLOW}$file${NC}..."
-fi
-
-$scr
-
-if [ -n "$BOOT_DRYRUN" ]; then
- echo "dryrun. exiting now"
- exit 0
-fi
-
-${global.bootm.image} $BOOT_BOOTM_OPTS
-bootm $BOOT_BOOTM_OPTS
-
-echo -e "${GREEN}booting ${YELLOW}$file${NC} ${RED}failed${NC}"
diff --git a/defaultenv-2/base/bin/_boot_help b/defaultenv-2/base/bin/_boot_help
deleted file mode 100644
index 5679e9121c..0000000000
--- a/defaultenv-2/base/bin/_boot_help
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-for i in /env/boot/*; do
- basename $i s
- sources="$sources$s "
-done
-
-if [ -d /env/boot.d ]; then
- seq_sources="boot sequence:"
- for i in /env/boot.d/*; do
- readlink -f $i s
- basename $s link
- basename $i s
- seq_sources="$seq_sources\n ${YELLOW}${s}${NC} -> ${CYAN}${link}${NC}"
- done
-else
- seq_sources="boot sequence:\n${GREEN}none${NC}"
-fi
-
-echo -e "boot sources:\n$sources\n\n$seq_sources"
diff --git a/defaultenv-2/base/bin/_boot_list b/defaultenv-2/base/bin/_boot_list
deleted file mode 100644
index 17f29bf9ce..0000000000
--- a/defaultenv-2/base/bin/_boot_list
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# This script is a workaround for buggy globbing in for loops
-
-for i in $*; do
- _boot $i;
-done
diff --git a/defaultenv-2/base/bin/boot b/defaultenv-2/base/bin/boot
deleted file mode 100644
index eed4b3c8b7..0000000000
--- a/defaultenv-2/base/bin/boot
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-BOOT_BOOTM_OPTS=
-BOOT_DRYRUN=
-BOOT_VERBOSE=
-list=
-bootsrc=${global.boot.default}
-
-usage="
-$0 [OPTIONS] [source]\n
- -v verbose\n
- -d dryrun\n
- -l list boot sources\n
- -h help"
-
-. /env/data/ansi-colors
-
-while getopt "vdhl" opt; do
- if [ ${opt} = v ]; then
- BOOT_BOOTM_OPTS="$BOOT_BOOTM_OPTS -v"
- BOOT_VERBOSE=1
- elif [ ${opt} = d ]; then
- BOOT_DRYRUN=1
- elif [ ${opt} = l ]; then
- list=1
- elif [ ${opt} = h ]; then
- echo -e "$usage"
- exit 0
- fi
-done
-
-if [ -n "$list" ]; then
- echo "boot sources:"
- for i in /env/boot/*; do
- basename $i s
- echo $s
- done
- exit 0
-fi
-
-if [ -n "$1" ]; then
- bootsrc="$*"
-fi
-
-export BOOT_BOOTM_OPTS
-export BOOT_DRYRUN
-export BOOT_VERBOSE
-
-for src in $bootsrc; do
- if [ -d ${src} ]; then
- realsrc="$realsrc $src/*"
- else
- realsrc="$realsrc $src"
- fi
-done
-
-if [ -n "$BOOT_VERBOSE" ]; then
- echo -e "\nboot sequence:${YELLOW}$realsrc${NC}\n"
-fi
-
-for s in $realsrc; do
- _boot_list $s
-done
-
-exit $ret