Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/extra-build-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ By default SD card media is used as boot media.
To switch the boot media from SD card to USB memory, the following variables are supported
in local.conf: `CMDLINE_ROOT_PARTITION` and `BOOT_MEDIA`.
The default value of `CMDLINE_ROOT_PARTITION` is "/dev/mmcblk0p2" to mount SD card. If you want to mount USB memory partition, set CMDLINE_ROOT_PARTITION to "/dev/sda2".
`BOOT_MEDIA` allows `mmc` and `usb`. The "mmc" is required to load an image from the SD card, following the u-boot specification. Similarly, if you want to load a boot image file from USB memory, set BOOT_MEDIA to "usb".
`BOOT_MEDIA` allows `mmc` and `usb`. When U-Boot bootflow runs the boot script, the kernel is loaded from the device and partition holding the script. `BOOT_MEDIA` (device 0, partition 1) is only used when `devtype`, `devnum` and `distro_bootpart` are not set, for example when sourcing the script manually.

For example, if you want to use USB boot, please define
the following parameters in your local.conf file.
Expand Down
17 changes: 15 additions & 2 deletions recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
fatload @@BOOT_MEDIA@@ 0:1 ${kernel_addr_r} @@KERNEL_IMAGETYPE@@
if test ! -e @@BOOT_MEDIA@@ 0:1 uboot.env; then saveenv; fi;

# Load the kernel from the bootflow device; fall back to BOOT_MEDIA 0:1.
if test -n "${devtype}" -a -n "${devnum}" -a -n "${distro_bootpart}"; then
fatload ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} @@KERNEL_IMAGETYPE@@
else
fatload @@BOOT_MEDIA@@ 0:1 ${kernel_addr_r} @@KERNEL_IMAGETYPE@@
fi

# uboot.env lives on mmc 0:1. Only create it when booted from there (not
# on another image's SD card) and without the per-boot bootflow variables.
if test "${devtype}" = mmc -a "${devnum}" = 0 -a "${distro_bootpart}" = 1 -a ! -e mmc 0:1 uboot.env; then
env delete devtype devnum distro_bootpart prefix
saveenv
Comment thread
agherzan marked this conversation as resolved.
Resolved
fi

@@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr}
Loading