From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= Date: Wed, 05 Feb 2014 10:16:05 +0100 Subject: [U-Boot] [PATCH V3 2/3] ARM: tegra: rework boot scripts In-Reply-To: <1391554782-7444-2-git-send-email-swarren@wwwdotorg.org> References: <1391554782-7444-1-git-send-email-swarren@wwwdotorg.org> <1391554782-7444-2-git-send-email-swarren@wwwdotorg.org> Message-ID: <52F20155.4040808@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 04.02.2014 23:59, schrieb Stephen Warren: > From: Stephen Warren > > Update the common Tegra boot scripts in the default environment to > > a) Make use of the new "exists" shell command to avoid some error > messges. "messages"; and "exists" became "test -e" > > b) Allow booting using the sysboot command and extlinux.conf. This > allows easy creation of boot menus, and provides a simple interface > for distros to parameterize/configure the boot process. > > Signed-off-by: Stephen Warren > --- > v3: s/exists/test -e/ in shell commands. > v2: No change. > --- > include/configs/tegra-common-post.h | 39 ++++++++++++++++++++++++++++--------- > 1 file changed, 30 insertions(+), 9 deletions(-) > > diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h > index e1a3bbc62636..5acbdc3a1890 100644 > --- a/include/configs/tegra-common-post.h > +++ b/include/configs/tegra-common-post.h > @@ -69,20 +69,41 @@ > #define BOOTCMDS_COMMON \ > "rootpart=1\0" \ > \ > + "do_script_boot=" \ > + "load ${devtype} ${devnum}:${rootpart} " \ > + "${scriptaddr} ${prefix}${script}; " \ > + "source ${scriptaddr}\0" \ > + \ > "script_boot=" \ > - "if load ${devtype} ${devnum}:${rootpart} " \ > - "${scriptaddr} ${prefix}${script}; then " \ > - "echo ${script} found! Executing ...;" \ > - "source ${scriptaddr};" \ > - "fi;\0" \ > + "for script in ${boot_scripts}; do " \ > + "if test -e ${devtype} ${devnum}:${rootpart} " \ > + "${prefix}${script}; then " \ > + "echo Found U-Boot script " \ > + "${prefix}${script}; " \ > + "run do_script_boot;" \ > + "echo SCRIPT FAILED; continuing...; " \ This is not going to work, "continuing..." would be treated as command. > + "fi; " \ > + "done\0" \ > + \ > + "do_sysboot_boot=" \ > + "sysboot ${devtype} ${devnum}:${rootpart} any " \ > + "${scriptaddr} ${prefix}extlinux.conf\0" \ > + \ > + "sysboot_boot=" \ > + "if test -e ${devtype} ${devnum}:${rootpart} " \ > + "${prefix}extlinux.conf; then " \ > + "echo Found extlinux config " \ > + "${prefix}extlinux.conf; " \ > + "run do_sysboot_boot;" \ > + "echo SCRIPT FAILED; continuing...; " \ Dito. Also note that there's no space before either echo. Cheers, Andreas > + "fi\0" \ > \ > "scan_boot=" \ > "echo Scanning ${devtype} ${devnum}...; " \ > "for prefix in ${boot_prefixes}; do " \ > - "for script in ${boot_scripts}; do " \ > - "run script_boot; " \ > - "done; " \ > - "done;\0" \ > + "run script_boot; " \ > + "run sysboot_boot; " \ > + "done\0" \ > \ > "boot_targets=" \ > BOOT_TARGETS_MMC " " \ -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer; HRB 16746 AG N?rnberg