Packages
nerves_system_bbb
0.17.1
2.30.0
2.29.5
2.29.4
2.29.3
2.29.2
2.29.1
2.29.0
2.28.0
2.27.3
2.27.2
2.27.1
2.27.0
2.26.1
2.26.0
2.25.1
2.25.0
2.24.0
2.23.0
2.22.1
2.22.0
2.21.0
2.20.2
2.20.1
2.20.0
2.19.1
2.19.0
2.18.2
2.18.1
2.18.0
2.17.2
2.17.1
2.17.0
2.16.2
2.16.1
2.16.0
2.15.3
2.15.2
2.15.1
2.15.0
retired
2.14.0
2.13.4
2.13.3
2.13.2
2.13.1
2.13.0
2.12.3
2.12.2
2.12.1
2.12.0
2.11.2
2.11.1
2.11.0
2.10.1
2.10.0
2.9.0
2.8.3
2.8.2
2.8.1
2.8.0
2.7.2
2.7.1
2.7.0
2.6.2
2.6.1
2.6.0
2.5.2
2.5.1
2.5.0
2.4.2
2.4.1
2.4.0
2.3.2
2.3.1
2.3.0
2.2.2
2.2.1
2.2.0
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0
2.0.0-rc.0
1.4.0
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
1.0.0-rc.1
1.0.0-rc.0
0.20.0
0.18.0
0.17.1
0.17.0
0.16.1
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.1
0.7.0
0.6.2
0.6.1
0.6.0
0.5.0
Nerves System - BeagleBone Black, BeagleBone Green, PocketBeagle and more
Current section
Files
Jump to
Current section
Files
nerves_system_bbb
uboot-script.cmd
uboot-script.cmd
# Custom U-Boot startup script for Nerves
# This script is invoked from the default AM335x build script
# in "<uboot>/include/configs/am335x_evm.h". In the default build
# script, look for `mmcboot` and its invocation of `loadbootscript`.
# It has been simplified to just support the Nerves use cases.
# Most importantly, it will not fallback to the alternate boot location
# like the default script. If you have it installed on the eMMC
# and you want to boot from the SDCard, you must hold down the USER/BOOT
# button. I usually wipe out the eMMC image when working with SDCard
# images to avoid this issue.
echo "Running Nerves U-Boot script"
# Kernel arguments and arguments to erlinit are passed here
# The erlinit arguments can just be tacked on to the end.
# For example, add "-v" to the end to put erlinit into verbose
# mode.
# When debugging, create a uEnv.txt file in the BOOT partition
# to override these arguments. For example, if you want the
# kernel debug messages, put this in a uEnv.txt:
# optargs="bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN"
env set optargs "quiet bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN"
# Allow the user to override the kernel/erlinit arguments
# via a "uEnv.txt" file in the FAT partition.
if load mmc ${mmcdev}:1 ${loadaddr} uEnv.txt; then
echo "uEnv.txt found. Overriding environment."
env import -t -r ${loadaddr} ${filesize}
# Check if the user provided a set of commands to run
if test -n $uenvcmd; then
echo "Running uenvcmd..."
run uenvcmd
fi
fi
# Determine the boot arguments
#
# Note the root filesystem specification. In Linux, /dev/mmcblk0 is always
# the boot device. In uboot, mmc 0 is the SDCard and mmc 1 is the eMMC.
# Therefore, we hardcode root=/dev/mmcblk0p2 since we always want to mount
# the root partition off the same device that ran u-boot and supplied
# zImage.
setenv bootargs console=${console} ${optargs} root=/dev/mmcblk0p2 rootfstype=squashfs ro rootwait
# Load the kernel
load mmc ${mmcdev}:1 ${loadaddr} zImage
# Load the DT. On the BBB, fdtfile=am335x-boneblack.dtb
load mmc ${mmcdev}:1 ${fdtaddr} ${fdtfile}
# Boot!!
bootz ${loadaddr} - ${fdtaddr}
echo "Nerves boot failed!"