u-boot-brain/common
Simon Glass 87b6398b46 cli: hush: Adjust 'run' command to run each line of the env var
The run command treats each argument an an environment variable. It gets the
value of each variable and executes it as a command. If an environment
variable contains a newline and the hush cli is used, it is supposed to
execute each line one after the other.

Normally a newline signals to hush to exit - this is used in normal command
line entry - after a command is entered we want to return to allow the user
to enter the next one. But environment variables obviously need to execute
to completion.

Add a special case for the execution of environment variables which
continues when a newline is seen, and add a few tests to check this
behaviour.

Note: it's not impossible that this may cause regressions in other areas.
I can't think of a case but with any change of behaviour with limited test
coverage there is always a risk. From what I can tell this behaviour has
been around since at least U-Boot 2011.03, although this pre-dates sandbox
and I have not tested it on real hardware.

Reported-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-10-27 11:03:33 -04:00
..
spl common: spl_sata: perform SCSI scan before getting device 2014-10-10 09:44:42 -04:00
aboot.c implement the Android sparse image format 2014-09-16 12:23:57 -04:00
autoboot.c autoboot: add its own header 2014-07-18 17:53:24 -04:00
bedbug.c Consolidate bool type 2013-04-01 16:33:52 -04:00
board_f.c common: board: use __weak 2014-10-24 16:04:59 -04:00
board_r.c common: board_r: make local functions static 2014-10-25 07:02:00 -04:00
bootm_os.c common: bootm_os: make arch_preboot_os __weak 2014-07-18 17:53:23 -04:00
bootm.c x86: Support loading kernel setup from a FIT 2014-10-22 09:03:06 -06:00
bootretry.c Rename bootretry functions and remove #ifdefs 2014-05-29 17:49:00 -04:00
bootstage.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
bouncebuf.c Fix a few printf argument verification warnings 2014-09-15 13:32:55 -04:00
cli_hush.c cli: hush: Adjust 'run' command to run each line of the env var 2014-10-27 11:03:33 -04:00
cli_readline.c Move bootretry code into bootretry.c and clean up 2014-05-29 17:48:21 -04:00
cli_simple.c cli: Export cli_simple_process_macros for use outside of cli_simple 2014-08-21 12:01:13 -04:00
cli.c cli: hush: Adjust 'run' command to run each line of the env var 2014-10-27 11:03:33 -04:00
cmd_aes.c aes: Add 'aes' command to access AES-128-CBC 2014-03-21 16:43:58 -04:00
cmd_ambapp.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_bdinfo.c common: commands: make commands static 2014-07-18 17:53:23 -04:00
cmd_bedbug.c Use run_command_repeatable() 2014-06-11 16:25:47 -04:00
cmd_blob.c crypto/fsl: Add command for encapsulating/decapsulating blobs 2014-10-16 14:20:40 -07:00
cmd_bmp.c Coding Style cleanup: replace leading SPACEs by TABs 2013-10-14 16:06:54 -04:00
cmd_boot.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_bootldr.c Blackfin: bootldr: use common defines 2011-04-08 00:44:27 -04:00
cmd_bootm.c x86: Support loading kernel setup from a FIT 2014-10-22 09:03:06 -06:00
cmd_bootmenu.c Remove unnecessary use of hush header file 2014-05-29 17:45:31 -04:00
cmd_bootstage.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_cache.c common: commands: make commands static 2014-07-18 17:53:23 -04:00
cmd_cbfs.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_clk.c common: Add new clk command 2014-02-04 16:32:20 +01:00
cmd_console.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_cplbinfo.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_cramfs.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_dataflash_mmc_mux.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_date.c Merge branch 'master' of git://git.denx.de/u-boot-i2c 2013-07-24 09:50:24 -04:00
cmd_dcr.c Add cli_ prefix to readline functions 2014-05-29 17:45:31 -04:00
cmd_demo.c dm: rename device struct to udevice 2014-05-27 10:21:32 -04:00
cmd_dfu.c dfu: Provide means to find difference between dfu-util -e and -R 2014-09-02 14:29:28 +02:00
cmd_diag.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_disk.c bootm: make use of legacy image format configurable 2014-06-05 14:44:56 -04:00
cmd_display.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_dtt.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
cmd_echo.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_eeprom.c common: commands: make commands static 2014-07-18 17:53:23 -04:00
cmd_elf.c common/cmd_elf.c: add missing include 2014-10-25 15:27:15 -04:00
cmd_exit.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_ext2.c Fix help text of ext2load and fatload. 2014-07-22 07:44:25 -04:00
cmd_ext4.c ext4load: fix help text 2014-08-09 11:17:03 -04:00
cmd_fastboot.c usb/gadget: fastboot: minor cleanup 2014-09-24 18:30:27 -04:00
cmd_fat.c fs: implement size/fatsize/ext4size 2014-08-09 11:16:57 -04:00
cmd_fdc.c bootm: make use of legacy image format configurable 2014-06-05 14:44:56 -04:00
cmd_fdt.c fdt: Rename fdt_resize() to fdt_shrink_to_minimum() 2014-08-09 11:17:03 -04:00
cmd_fitupd.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_flash.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_fpga.c bootm: make use of legacy image format configurable 2014-06-05 14:44:56 -04:00
cmd_fpgad.c powerpc/ppc4xx: Convert new gdsys files to SPDX license tags 2013-07-26 15:32:59 -04:00
cmd_fs.c fs: implement size/fatsize/ext4size 2014-08-09 11:16:57 -04:00
cmd_fuse.c Add the function 'confirm_yesno' for interactive 2014-05-23 11:53:05 +03:00
cmd_gettime.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_gpio.c Merge git://git.denx.de/u-boot-dm 2014-10-26 14:03:08 -04:00
cmd_gpt.c cmd:gpt: randomly generate each partition uuid if undefined 2014-04-02 16:36:06 -04:00
cmd_hash.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_help.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_i2c.c common: commands: make commands static 2014-07-18 17:53:23 -04:00
cmd_ide.c common: cmd_ide: use __weak and add prototypes 2014-07-22 07:44:26 -04:00
cmd_immap.c powerpc: mpc8260: consolidate CONFIG_MPC8260 and CONFIG_8260 2014-03-07 10:59:06 -05:00
cmd_ini.c SPDX-License-Identifier: convert BSD-3-Clause files 2013-08-19 15:45:35 -04:00
cmd_io.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_iotrace.c Add an I/O tracing feature 2014-06-20 11:54:29 -06:00
cmd_irq.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
cmd_itest.c Fix itest mask overflow 2014-06-05 14:38:38 -04:00
cmd_jffs2.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_ldrinfo.c Blackfin: ldrinfo: new command 2011-04-08 00:44:27 -04:00
cmd_led.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
cmd_license.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_load.c Enable xmodem support 2013-08-16 13:45:15 -04:00
cmd_log.c stdio: Pass device pointer to stdio methods 2014-07-23 14:07:23 +01:00
cmd_lzmadec.c Add lzmadec command 2014-03-22 14:47:22 -06:00
cmd_mac.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_md5sum.c cmd_md5sum.c: remove dead code / fix warning 2014-06-19 11:19:07 -04:00
cmd_mdio.c net: add support for extended registers to mdio command 2013-11-22 16:50:52 -06:00
cmd_mem.c cmd_mem: add static to internally used functions 2014-09-16 12:23:57 -04:00
cmd_mfsl.c common: fsl: Fix broken SPDX-License-Identifier change 2013-10-16 09:24:38 -04:00
cmd_mii.c common: cmd_mii: fix printf format warning 2014-07-18 17:53:24 -04:00
cmd_misc.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_mmc_spi.c mmc: Split mmc struct, rework mmc initialization (v2) 2014-03-24 12:58:56 +02:00
cmd_mmc.c cmd_mmc: fix bootpart-resize maxarg to 4 2014-10-03 17:26:50 +03:00
cmd_mp.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_mtdparts.c Fix a few printf argument verification warnings 2014-09-15 13:32:55 -04:00
cmd_nand.c cmd_nand: Update (nand_info_t*)nand after arg_off(_size) call 2014-09-24 18:30:29 -04:00
cmd_net.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_nvedit.c Add option -r to env import to allow import of text files with CRLF as line endings 2014-07-22 07:44:26 -04:00
cmd_onenand.c mtd: resync with Linux-3.7.1 2013-05-31 17:12:03 -05:00
cmd_otp.c Add the function 'confirm_yesno' for interactive 2014-05-23 11:53:05 +03:00
cmd_part.c common: commands: make commands static 2014-07-18 17:53:23 -04:00
cmd_pci.c Rename bootretry functions and remove #ifdefs 2014-05-29 17:49:00 -04:00
cmd_pcmcia.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_portio.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_pxe.c pxe: Ensure we don't overflow bootargs 2014-10-10 09:44:21 -04:00
cmd_read.c Add a command to read raw blocks from a partition 2012-12-11 13:17:33 -07:00
cmd_reginfo.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_reiser.c cmd_reiser: normalize 'file not found' errors 2013-11-08 15:25:13 -05:00
cmd_sandbox.c sandbox: restore ability to access host fs through standard commands 2014-06-23 15:37:23 -06:00
cmd_sata.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_scsi.c common: spl: Add spl sata boot support 2014-02-19 10:47:43 -05:00
cmd_setexpr.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
cmd_sf.c dm: Convert spi_flash_probe() and 'sf probe' to use driver model 2014-10-22 10:36:50 -06:00
cmd_sha1sum.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
cmd_softswitch.c blackfin: bf609: add softswitch config command 2013-05-13 16:26:12 +08:00
cmd_sound.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_source.c common: commands: make commands static 2014-07-18 17:53:23 -04:00
cmd_spi.c dm: spi: Adjust cmd_spi to work with driver model 2014-10-22 10:36:47 -06:00
cmd_spibootldr.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_spl.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_strings.c Convert cmd_usage() calls in common to use a return value 2012-03-06 21:09:46 +01:00
cmd_terminal.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_test.c cmd_test: implement -e test for file existence 2014-02-19 09:47:34 -05:00
cmd_thordown.c thor: defer parsing of device string to IO backend 2014-08-09 11:17:00 -04:00
cmd_time.c cmd_time: do not show ticks 2014-05-12 15:19:46 -04:00
cmd_tpm.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_trace.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_tsi148.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
cmd_ubi.c mtd, ubi, ubifs: resync with Linux-3.14 2014-08-25 19:25:55 -04:00
cmd_ubifs.c mtd, ubi, ubifs: resync with Linux-3.14 2014-08-25 19:25:55 -04:00
cmd_universe.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
cmd_unzip.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_usb_mass_storage.c ums: allow the user to specify the device type 2014-05-08 10:38:29 +02:00
cmd_usb.c usb: kbd: Allow "usb reset" to continue when an usb kbd is used 2014-10-06 14:50:43 +02:00
cmd_version.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cmd_ximg.c bootm: make use of legacy image format configurable 2014-06-05 14:44:56 -04:00
cmd_yaffs2.c u-boot: Update yaffs2 file system 2012-08-09 23:39:18 +02:00
cmd_zfs.c cmd_zfs: normalize 'file not found' errors 2013-11-08 15:25:13 -05:00
cmd_zip.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
command.c Add 64-bit data support for memory commands 2014-03-04 12:15:30 -05:00
console.c common:console: add missing include 2014-10-25 07:27:37 -04:00
cros_ec.c dm: cros_ec: Add support for driver model 2014-10-22 10:36:53 -06:00
ddr_spd.c driver/ddr/fsl: Add DDR4 support to Freescale DDR driver 2014-04-22 17:58:48 -07:00
dlmalloc.c sandbox: Always enable malloc debug 2014-07-23 14:06:17 +01:00
dlmalloc.src Consolidate bool type 2013-04-01 16:33:52 -04:00
edid.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
env_attr.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
env_callback.c common, env: optimize boottime 2014-01-14 09:01:06 -05:00
env_common.c Add option -r to env import to allow import of text files with CRLF as line endings 2014-07-22 07:44:26 -04:00
env_dataflash.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
env_eeprom.c env_eeprom: Assign default environment during board_init_f 2014-06-05 14:44:56 -04:00
env_embedded.c nand_spl: remove nand_spl infrastructure 2014-06-05 17:01:59 -04:00
env_fat.c env_fat.c: Make sure our buffer is cache aligned 2014-08-09 11:26:34 -04:00
env_flags.c common, env: optimize boottime 2014-01-14 09:01:06 -05:00
env_flash.c env_flash.c: Drop unused variables 2014-04-17 17:44:36 -04:00
env_mmc.c env_mmc: correct fini partition to match init partition 2014-10-03 17:26:50 +03:00
env_nand.c env_nand: make local functions static 2014-10-25 07:02:01 -04:00
env_nowhere.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
env_nvram.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
env_onenand.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
env_remote.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
env_sf.c dm: Add spi.h header to a few files 2014-10-22 10:36:47 -06:00
env_ubi.c env: Add env_export() wrapper 2014-03-21 16:43:59 -04:00
exports.c dm: spi: Add a uclass for SPI 2014-10-22 10:36:46 -06:00
fb_mmc.c usb/gadget: fastboot: implement sparse format 2014-09-24 18:30:27 -04:00
fdt_support.c fdt_support: Make of_bus_default_count_cells non static 2014-09-25 08:36:19 -07:00
flash.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
hash.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
hwconfig.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
image-android.c image: add support for Android's boot image format 2014-05-08 10:38:29 +02:00
image-fdt.c fdt: Rename fdt_resize() to fdt_shrink_to_minimum() 2014-08-09 11:17:03 -04:00
image-fit.c image-fit: make local function static 2014-10-25 07:02:01 -04:00
image-sig.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
image.c x86: Support loading kernel setup from a FIT 2014-10-22 09:03:06 -06:00
iomux.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
iotrace.c Add an I/O tracing feature 2014-06-20 11:54:29 -06:00
kallsyms.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
Kconfig kconfig: move CONFIG_CMD_IMPORTENV to Kconfig 2014-09-24 18:30:29 -04:00
kgdb_stubs.c kgdb: add default generic stubs 2010-01-18 00:23:00 +01:00
kgdb.c kgdb: Remove first_entry for kgdb 2014-09-16 12:23:56 -04:00
lcd.c lcd: Fix build error with CONFIG_LCD_BMP_RLE8 2014-10-16 09:58:24 +02:00
lynxkdi.c checkpatch whitespace cleanups 2011-10-22 01:13:35 +02:00
main.c common: main.c: make show_boot_progress __weak 2014-07-18 17:53:23 -04:00
Makefile common: Makefile: allow for spl builds with env_fat 2014-10-23 11:53:01 -04:00
memsize.c common: Add get_effective_memsize() to memsize.c 2014-02-21 11:06:13 -05:00
menu.c misc: use __weak 2014-10-25 07:01:59 -04:00
miiphyutil.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
modem.c modem.c: Switch to debug() from dbg found in common/console.c 2014-10-25 07:27:37 -04:00
s_record.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
splash.c common:splash: use __weak 2014-07-18 17:53:23 -04:00
stdio.c serial: make local functions static 2014-10-25 07:02:02 -04:00
system_map.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
update.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
usb_hub.c usb: hub: don't check CONNECTION in hub_port_reset() 2014-08-29 11:27:43 +02:00
usb_kbd.c usb: kbd: Allow "usb reset" to continue when an usb kbd is used 2014-10-06 14:50:43 +02:00
usb_storage.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
usb.c usb: Handle -ENODEV from usb_lowlevel_init() 2014-08-29 11:27:42 +02:00
xyzModem.c common/xyzModem.c: move empty statements to newline 2014-06-11 16:27:06 -04:00