command documentation

Hi,
I am sorry to ask such a basic question, but i really can't find any documentation on the commands possible in scripting. Documentation of Hush and its commands i can't find.
I am working with the script in u-boot env below. I can read it, but just because i am guessing.
Any help is appreciated
arch=arm board=tinker_rk3288 board_name=tinker_rk3288 scriptaddr=0x00000000 soc=rockchip vendor=rockchip devnums=0 1 devtype=mmc bootdelay=-2
fdt_addr_r=0x01f00000 fdt_high=0x0fffffff fdtcontroladdr=7df5c620 ramdisk_addr_r=0x04000000 kernel_addr_r=0x02000000
bootargs=console=tty2 quiet vt.global_cursor_default=0 rootwait consoleblank=0 loglevel=0
scan_dev_for_boot_part= \ part list mmc ${devnum} -bootable devplist; \ env exists devplist || setenv devplist 1; \ for distro_bootpart in ${devplist}; do \ if fstype mmc ${devnum}:${distro_bootpart} bootfstype; then \ run scan_dev_for_boot; \ fi; \ done
scan_dev_for_boot= \ if test -e mmc ${devnum}:${distro_bootpart} /boot/extlinux/extlinux.conf; then \ setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${distro_bootpart}; \ echo Booting with args: ${bootargs}; \ sysboot mmc ${devnum}:${distro_bootpart} any ${scriptaddr} /boot/extlinux/extlinux.conf; \ fi
bootcmd= \ for devnum in ${devnums}; do \ if mmc dev ${devnum}; then \ run scan_dev_for_boot_part; \ fi; \ done

Hi Jasper,
On Wed, Sep 09, 2020 at 07:03:58PM +0200, Jasper van Santen wrote:
I am sorry to ask such a basic question, but i really can't find any documentation on the commands possible in scripting. Documentation of Hush and its commands i can't find.
The hush shell gives you the ability to do loops/conditionals. It uses the same syntax as most Linux/unix shells, such as ash/bash/dash. You will find many tutorials/documents online for these. Some examples: https://www.xilinx.com/video/soc/u-boot-hush-shell-scripting.html https://www.man7.org/linux/man-pages/man1/dash.1.html Keep in mind that some more fancy features may not be supported in the u-boot hush shell.
As far as official documentation, I am only aware of brief mention in https://github.com/u-boot/u-boot/blob/master/README#L3530
The other aspect is the commands which can be run. This depends on how you configure your u-boot, eg. the CONFIG_CMD_* parameters. You can get a brief overview of commands by typing "help" at the u-boot prompt. And somewhat more help by typing "help <cmdname>".
Hope this helps, Ralph

Hi Ralph,
Thanks a lot for the info.
I had already seen the movie, the book would have been better ;)
Unfortunately I don't have easy access to the prompt since it's embedded. So i can't prompt for help. Fortunately I build U-Boot with buildroot, so i have the source code. It is a big meager, but I ended up grepping the man pages from source:
pcregrep -M -r --buffer-size 9000000 "U_BOOT_CMD([^;]+.*" . > U_BOOT_CMD_HELP.txt
Cheers,
Jasper
On Wed, 9 Sep 2020 at 20:53, Ralph Siemsen ralph.siemsen@linaro.org wrote:
Hi Jasper,
On Wed, Sep 09, 2020 at 07:03:58PM +0200, Jasper van Santen wrote:
I am sorry to ask such a basic question, but i really can't find any documentation on the commands possible in scripting. Documentation of Hush and its commands i can't find.
The hush shell gives you the ability to do loops/conditionals. It uses the same syntax as most Linux/unix shells, such as ash/bash/dash. You will find many tutorials/documents online for these. Some examples: https://www.xilinx.com/video/soc/u-boot-hush-shell-scripting.html https://www.man7.org/linux/man-pages/man1/dash.1.html Keep in mind that some more fancy features may not be supported in the u-boot hush shell.
As far as official documentation, I am only aware of brief mention in https://github.com/u-boot/u-boot/blob/master/README#L3530
The other aspect is the commands which can be run. This depends on how you configure your u-boot, eg. the CONFIG_CMD_* parameters. You can get a brief overview of commands by typing "help" at the u-boot prompt. And somewhat more help by typing "help <cmdname>".
Hope this helps, Ralph

Hi Jasper,
On Thu, Sep 10, 2020 at 11:19:29AM +0200, Jasper van Santen wrote:
I had already seen the movie, the book would have been better ;)
I feel that way too... ;)
Fortunately I build U-Boot with buildroot, so i have the source code. It is a big meager, but I ended up grepping the man pages from source
Nice! You could also potentially use the "sandbox" target, which lets you run u-boot natively on your build host. See doc/arch/sandbox.rst for further details.
Ralph
participants (2)
-
Jasper van Santen
-
Ralph Siemsen