1
0
Fork 0
remarkable-uboot/common
Kim Phillips a000b7950d common: add a grepenv command
u-boot environments, esp. when boards are shared across multiple
users, can get pretty large and time consuming to visually parse.
The grepenv command this patch adds can be used in lieu of printenv
to facilitate searching.  grepenv works like printenv but limits
its output only to environment strings (variable name and value
pairs) that match the user specified substring.

the following examples are on a board with a 5313 byte environment
that spans multiple screen pages:

Example 1:  summarize ethernet configuration:

=> grepenv eth TSEC
etact=FM1@DTSEC2
eth=FM1@DTSEC4
ethact=FM1@DTSEC2
eth1addr=00:E0:0C:00:8b:01
eth2addr=00:E0:0C:00:8b:02
eth3addr=00:E0:0C:00:8b:03
eth4addr=00:E0:0C:00:8b:04
eth5addr=00:E0:0C:00:8b:05
eth6addr=00:E0:0C:00:8b:06
eth7addr=00:E0:0C:00:8b:07
eth8addr=00:E0:0C:00:8b:08
eth9addr=00:E0:0C:00:8b:09
ethaddr=00:E0:0C:00:8b:00
netdev=eth0
uprcw=setenv ethact $eth;setenv filename p4080ds/R_PPSXX_0xe/rcw_0xe_2sgmii_rev2_high.bin;setenv start 0xe8000000;protect off all;run upimage;protect on all
upuboot=setenv ethact $eth;setenv filename u-boot.bin;setenv start eff80000;protect off all;run upimage;protect on all
upucode=setenv ethact $eth;setenv filename fsl_fman_ucode_P4080_101_6.bin;setenv start 0xef000000;protect off all;run upimage;protect on all
usdboot=setenv ethact $eth;tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/initramfs.cpio.gz.uboot;tftp c00000 $dir/p4080ds-usdpaa.dtb;setenv bootargs root=/dev/ram rw console=ttyS0,115200 $othbootargs;bootm 1000000 2000000 c00000;
=>

Example 2: detect unused env vars:

=> grepenv etact
etact=FM1@DTSEC2
=>

Example 3: reveal hardcoded variables; e.g., for fdtaddr:

=> grepenv fdtaddr
fdtaddr=c00000
nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
=> grep $fdtaddr
fdtaddr=c00000
my_boot=bootm 0x40000000 0x41000000 0x00c00000
my_dtb=tftp 0x00c00000 $prefix/p4080ds.dtb
nohvboot=tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/$ramdiskfile;tftp c00000 $dir/$fdtfile;setenv bootargs root=/dev/ram rw ramdisk_size=0x10000000 console=ttyS0,115200;bootm 1000000 2000000 c00000;
=>

This patch also enables the grepenv command by default on
corenet_ds based boards (and repositions the DHCP command
entry to keep the list sorted).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Kumar Gala <kumar.gala@freescale.com>
Cc: Andy Fleming <afleming@freescale.com>
2011-04-28 01:00:07 +02:00
..
Makefile Merge branch 'phylib' of git://git.denx.de/u-boot-mmc 2011-04-20 23:01:52 +02:00
bedbug.c common: Move conditional compilation to Makefile 2008-08-13 01:40:38 +02:00
cmd_ambapp.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_bdinfo.c common/cmd_bdinfo.c: fix do_bdinfo() for AVR32 2011-04-12 22:58:32 +02:00
cmd_bedbug.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_bmp.c cmd_bmp.c: message about compressed formats is debug info only. 2011-02-09 21:32:20 +01:00
cmd_boot.c make `go` optional 2011-04-13 15:56:39 -04:00
cmd_bootldr.c Blackfin: bootldr: use common defines 2011-04-08 00:44:27 -04:00
cmd_bootm.c Respect memreserve regions specified in the device tree 2011-04-25 21:11:21 -04:00
cmd_cache.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_console.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_cplbinfo.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_cramfs.c various cmd_* files: remove the command name from the help message 2010-08-09 01:06:34 +02:00
cmd_dataflash_mmc_mux.c various cmd_* files: remove the command name from the help message 2010-08-09 01:06:34 +02:00
cmd_date.c cmd_date: constify 2010-11-28 21:58:24 +01:00
cmd_dcr.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_df.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_diag.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_display.c led_display: split led display support into generic and hw-dependent parts 2010-10-12 22:44:33 +02:00
cmd_dtt.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_echo.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_eeprom.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_elf.c cmd_elf: add an option for loading ELFs according to PHDRs 2010-10-06 22:42:14 +02:00
cmd_exit.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_ext2.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_fat.c fs/fat: Big code cleanup. 2010-07-24 20:54:46 +02:00
cmd_fdc.c Revert "boot cmds: convert to getenv_yesno() with autostart" 2011-01-11 20:56:34 +01:00
cmd_fdos.c Revert "boot cmds: convert to getenv_yesno() with autostart" 2011-01-11 20:56:34 +01:00
cmd_fdt.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_flash.c Fix build warnings in cmd_flash.c 2011-02-19 20:32:38 +01:00
cmd_fpga.c cmd_fpga: cleanup help and check parameters 2010-10-19 23:52:45 +02:00
cmd_gpio.c gpio: check request result 2011-04-13 15:57:00 -04:00
cmd_help.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_i2c.c Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC 2010-10-29 21:32:07 +02:00
cmd_ide.c cmd_ide: Fix an unused CONFIG_AU1X00 symbol to work as intended 2011-02-05 20:06:03 +09:00
cmd_immap.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_irq.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_itest.c itest: fix result of string compares 2011-02-15 21:45:55 +01:00
cmd_jffs2.c cmd_jffs2: Fix get_part_sector_size_nor() overflow bug 2011-01-19 00:04:43 +01:00
cmd_ldrinfo.c Blackfin: ldrinfo: new command 2011-04-08 00:44:27 -04:00
cmd_led.c Add 'led' command 2011-04-27 19:38:05 +02:00
cmd_license.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_load.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_log.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_mac.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_md5sum.c md5sum/sha1sum/unzip: split out of mondo mem file 2011-04-13 15:56:47 -04:00
cmd_mdio.c Add mdio command for new PHY infrastructure 2011-04-20 15:09:35 -05:00
cmd_mem.c md5sum/sha1sum/unzip: split out of mondo mem file 2011-04-13 15:56:47 -04:00
cmd_mfsl.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_mgdisk.c various cmd_* files: remove the command name from the help message 2010-08-09 01:06:34 +02:00
cmd_mii.c miiphy: convert to linux/mii.h 2011-01-09 18:06:50 +01:00
cmd_misc.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_mmc.c mmc: show mmc capacity using print_size 2011-04-13 06:35:22 -05:00
cmd_mmc_spi.c mmc: add generic mmc spi driver 2011-04-13 06:35:22 -05:00
cmd_mp.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_mtdparts.c Followup fixes on the mtdparts spread patchset 2010-10-11 15:11:01 -05:00
cmd_nand.c NAND: add the ability to directly write yaffs image 2011-01-12 17:13:10 -06:00
cmd_net.c Revert "boot cmds: convert to getenv_yesno() with autostart" 2011-01-11 20:56:34 +01:00
cmd_nvedit.c common: add a grepenv command 2011-04-28 01:00:07 +02:00
cmd_onenand.c onenand: add yaffs write command 2010-12-17 14:32:12 -06:00
cmd_otp.c Blackfin: otp: fix build after constification of args[] 2010-10-02 16:00:40 -04:00
cmd_pci.c pci: Clean up PCI info when CONFIG_PCI_SCAN_SHOW 2010-11-14 23:46:46 +01:00
cmd_pcmcia.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_portio.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_reginfo.c mpc85xx: Add reginfo command 2010-07-16 10:55:09 -05:00
cmd_reiser.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_sata.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_scsi.c Revert "boot cmds: convert to getenv_yesno() with autostart" 2011-01-11 20:56:34 +01:00
cmd_setexpr.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_sf.c cmd_sf: use cmd_usage() in more places 2011-04-12 02:30:25 -04:00
cmd_sha1sum.c md5sum/sha1sum/unzip: split out of mondo mem file 2011-04-13 15:56:47 -04:00
cmd_source.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_spi.c sspi: add options to specify bus and mode 2010-10-06 20:50:38 -04:00
cmd_spibootldr.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_strings.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_terminal.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_test.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_tsi148.c TSI148: Fix argument parsing 2010-10-12 23:31:10 +02:00
cmd_ubi.c UBI: Fix error code handling in ubi commands 2011-03-21 10:02:16 +01:00
cmd_ubifs.c UBI/UBIFS: Automatically unmount UBIFS volume upon UBI partition change 2010-12-03 18:24:04 +01:00
cmd_universe.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
cmd_unzip.c md5sum/sha1sum/unzip: split out of mondo mem file 2011-04-13 15:56:47 -04:00
cmd_usb.c Fix misc spelling errors found by lintian 2011-04-12 22:58:31 +02:00
cmd_version.c Print compiler and linker version with the version command 2011-02-02 21:56:39 +01:00
cmd_vfd.c cmd_usage(): simplify return code handling 2010-07-24 20:43:57 +02:00
cmd_ximg.c various cmd_* files: fixed layout a little bit 2010-08-09 01:07:37 +02:00
cmd_yaffs2.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
command.c env: re-add support for auto-completion 2011-01-09 17:57:37 +01:00
console.c stdio: constify "name" arg in public api 2010-11-28 21:58:48 +01:00
ddr_spd.c mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements 2011-04-04 09:24:43 -05:00
dlmalloc.c malloc: Fix issue with calloc memory possibly being non-zero 2010-11-17 22:06:40 +01:00
dlmalloc.src * Code cleanup: 2003-06-27 21:31:46 +00:00
env_common.c env: re-add support for auto-completion 2011-01-09 17:57:37 +01:00
env_dataflash.c hashtable: drop all non-reentrant versions 2010-12-17 21:07:14 +01:00
env_eeprom.c hashtable: drop all non-reentrant versions 2010-12-17 21:07:14 +01:00
env_embedded.c Revert "env: only build env_embedded and envcrc when needed" 2009-10-27 20:46:31 +01:00
env_flash.c hashtable: drop all non-reentrant versions 2010-12-17 21:07:14 +01:00
env_mgdisk.c New implementation for internal handling of environment variables. 2010-09-19 19:29:48 +02:00
env_mmc.c env_mmc: Allow board code to override the environment address 2011-04-04 22:26:16 -05:00
env_nand.c NAND: env: remember the flags used in the previous environment 2011-02-08 15:25:02 -06:00
env_nowhere.c New implementation for internal handling of environment variables. 2010-09-19 19:29:48 +02:00
env_nvram.c hashtable: drop all non-reentrant versions 2010-12-17 21:07:14 +01:00
env_onenand.c hashtable: drop all non-reentrant versions 2010-12-17 21:07:14 +01:00
env_sf.c fix redundant environment for serial flash 2011-04-28 00:46:01 +02:00
exports.c x86: Rename i386 to x86 2011-04-13 19:43:28 +10:00
fdt_support.c Fix off-by-one error in passing initrd end address via device tree 2011-04-25 21:11:21 -04:00
flash.c cfi_flash: Simplify dynamic flash bank number detection 2010-09-20 15:08:51 +02:00
hush.c do_reset: unify duplicate prototypes 2010-11-28 21:47:24 +01:00
hwconfig.c Minor Coding Style Cleanup. 2011-02-02 22:36:10 +01:00
image.c Respect memreserve regions specified in the device tree 2011-04-25 21:11:21 -04:00
iomux.c stdio/device: rework function naming convention 2009-07-18 00:27:46 +02:00
kallsyms.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
kgdb.c Make sure that argv[] argument pointers are not modified. 2010-07-04 23:55:42 +02:00
kgdb_stubs.c kgdb: add default generic stubs 2010-01-18 00:23:00 +01:00
lcd.c lcd: align fb writing address for horizontal display offset 2011-01-27 00:20:59 +01:00
lynxkdi.c Fix implicit declaration of function 'eth_[gs]etenv_enetaddr' 2009-03-28 20:16:16 +01:00
main.c cmd editing: mark erase/tab seqs constant 2011-01-09 18:03:58 +01:00
memsize.c Sequential accesses to non-existent memory must be synchronized, 2006-11-06 17:06:36 +01:00
miiphyutil.c Create PHY Lib for U-Boot 2011-04-20 15:09:19 -05:00
modem.c make MODEM SUPPORT generic instead of duplicate it 2009-06-12 20:45:47 +02:00
s_record.c Initial revision 2002-08-17 09:36:01 +00:00
serial.c serial: Add Tegra2 serial port support 2011-02-21 08:30:55 +01:00
stdio.c stdio: constify "name" arg in public api 2010-11-28 21:58:48 +01:00
system_map.c Add support for Linux-like kallsysms 2009-06-12 20:45:48 +02:00
update.c rename CFG_ macros to CONFIG_SYS 2008-10-18 21:54:03 +02:00
usb.c Add USB host ethernet adapter support 2011-02-19 20:32:36 +01:00
usb_kbd.c USB Consolidate descriptor definitions 2009-12-20 12:47:37 +01:00
usb_storage.c Fix misc spelling errors found by lintian 2011-04-12 22:58:31 +02:00
xyzModem.c common: fix 'dummy' is used uninitialized in this function warning 2009-07-19 21:37:02 +02:00