diff options
Diffstat (limited to 'defaultenv-2/base/bin/_boot')
-rw-r--r-- | defaultenv-2/base/bin/_boot | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/defaultenv-2/base/bin/_boot b/defaultenv-2/base/bin/_boot new file mode 100644 index 000000000..71d149082 --- /dev/null +++ b/defaultenv-2/base/bin/_boot @@ -0,0 +1,44 @@ +#!/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}" |