-
Notifications
You must be signed in to change notification settings - Fork 4
/
emmc_autoscript.command
90 lines (73 loc) · 3.35 KB
/
emmc_autoscript.command
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#
# Armbian boot script modified for Amlogic vendor u-boot by devmfc
test "${devtype}" = "" && setenv devtype "mmc"
test "${devnum}" = "" && setenv devnum 1
setenv scriptaddr "0x01080000"
setenv kernel_addr_r "0x02000000"
setenv fdt_addr_r "0x04000000"
setenv dtb_mem_addr "0x04000000"
setenv initrd_loadaddr "0x13000000"
setenv cmd_do_boot booti ${kernel_addr_r} ${initrd_loadaddr} ${fdt_addr_r}
setenv overlay_error "false"
# default values
setenv rootdev "LABEL=ROOT_EMMC"
setenv verbosity "1"
setenv console "both"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv disable_vu7 "true"
if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
fatload ${devtype} ${devnum} ${scriptaddr} ${prefix}armbianEnv.txt
env import -t ${scriptaddr} ${filesize}
fi
if test "${console}" = "display"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyAML0,115200"; fi
if test "${console}" = "both"; then setenv consoleargs "console=ttyAML0,115200 console=tty1"; fi
if test "${bootlogo}" = "true"; then
setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}"
else
setenv consoleargs "splash=verbose ${consoleargs}"
fi
if test "${disable_vu7}" = "false"; then setenv usbhidquirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 coherent_pool=2M loglevel=${verbosity} ubootpart=${partuuid} libata.force=noncq usb-storage.quirks=${usbstoragequirks} ${usbhidquirks} ${extraargs} ${extraboardargs}"
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
fatload ${devtype} ${devnum} ${initrd_loadaddr} ${prefix}uInitrd
fatload ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image
fatload ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if fatload ${devtype} ${devnum} ${scriptaddr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${scriptaddr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if fatload ${devtype} ${devnum} ${scriptaddr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${scriptaddr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
fatload ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if fatload ${devtype} ${devnum} ${scriptaddr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
autoscr ${scriptaddr}
fi
fi
if test -e ${devtype} ${devnum} ${prefix}${soc_fixup}fixup.scr; then
echo "Applying user provided fixup script (${prefix}${soc_fixup}fixup.scr)"
fatload ${devtype} ${devnum} ${scriptaddr} ${prefix}${soc_fixup}fixup.scr
autoscr ${scriptaddr}
fi
echo "Starting kernel with cmdline: ${bootargs}"
run cmd_do_boot
# Recompile with:
# mkimage -C none -A arm -T script -d emmc_autoscript.command emmc_autoscript