"Das U-Boot" Source Tree
at master 52 lines 1.9 kB view raw
1.. SPDX-License-Identifier: GPL-2.0+: 2 3Script Bootmeth 4=============== 5 6This bootmeth provides a way to locate and run a script on a block or network 7device. It can also support SPI flash. 8 9For a block device the file is read from the selected partition, which must use 10a supported filesystem. The subdirectory to search in is defined by the bootstd 11list of prefixes (``{"/", "/boot"}`` by default) and can be adjust with the 12`filename-prefixes` property in the bootstd device. 13 14For a network device, the filename is obtained from the `boot_script_dhcp` 15environment variable and the file is read using tftp. It must be in the 16top-level directory of the tftp server. 17 18In either case (file or network), the bootmeth searches for the file and creates 19a bootflow if found. The bootmeth searches for "boot.scr.uimg" first, then 20"boot.scr" if not found. 21 22For SPI flash, a script is read from flash using the offset provided by the 23"script_offset_f" environment variable. 24 25Some attempt is made to identify the Operating System: so far this only detects 26an `Armbian <https://www.armbian.com>`_ 27distro. For block devices, if a file called "boot.bmp" exists in the same 28directory then it is used as the bootflow logo. 29 30When the bootflow is booted, the bootmeth sets these environment variables: 31 32 devtype 33 device type (e.g. "usb", "mmc", "ethernet" or "spi_flash") 34 35 devnum 36 device number, corresponding to the device 'sequence' number 37 ``dev_seq(dev)`` 38 39 distro_bootpart 40 (block devices only) partition number on the device (numbered from 1) 41 42 prefix 43 prefix used to find the file 44 45 mmc_bootdev 46 device number (same as `devnum`), set for sunxi mmc devices only 47 48The script file must be a FIT or a legacy uImage. It is loaded into memory and 49executed. 50 51The compatible string "u-boot,script" is used for the driver. It is present 52if `CONFIG_BOOTMETH_SCRIPT` is enabled.