-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Expand file tree
/
Copy pathnfs-boot.cmd.template
More file actions
40 lines (31 loc) · 1.47 KB
/
nfs-boot.cmd.template
File metadata and controls
40 lines (31 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## set this to NFS root path (ip:path)
## or else provide dhcp option 17 (root-path)
#setenv nfs_root 192.168.0.2:/mnt/nfsroot
# for DHCP
setenv net_setup "ip=dhcp"
# for static configuration see documentation
# https://www.kernel.org/doc/Documentation/admin-guide/nfs/nfsroot.rst
# setenv net_setup "ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip>"
# No hardcoded `console=`: kernels resolve the console from the DTB's
# /chosen/stdout-path. Hardcoding a baud rate here breaks boards whose
# UART runs at non-115200 speeds (e.g. helios64 @ 1500000).
setenv bootargs "root=/dev/nfs ${net_setup} rw rootwait earlycon panic=10 loglevel=6"
if test -n "${nfs_root}"; then
setenv bootargs "${bootargs} nfsroot=${nfs_root}"
fi
# Load kernel + DTB + initrd from the active distro boot partition.
# devtype/devnum/distro_bootpart are set by U-Boot's bootflow scanner
# before this script runs.
setenv boot_dev "${devtype} ${devnum}:${distro_bootpart}"
load ${boot_dev} ${fdt_addr_r} dtb/${fdtfile}
load ${boot_dev} ${ramdisk_addr_r} uInitrd || setenv ramdisk_addr_r "-"
# Prefer arm64 flat Image (booti); fall back to compressed zImage (bootz).
if load ${boot_dev} ${kernel_addr_r} Image; then
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
else
load ${boot_dev} ${kernel_addr_r} zImage
setenv fdt_high ffffffff
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
fi
# Recompile with:
# mkimage -C none -A arm -T script -d boot.cmd boot.scr