-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Expand file tree
/
Copy pathboot-onecloud.cmd
More file actions
67 lines (56 loc) · 2.36 KB
/
boot-onecloud.cmd
File metadata and controls
67 lines (56 loc) · 2.36 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
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
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#
# We can't use `test -z` due to the bug: https://lists.denx.de/pipermail/u-boot/2005-August/011447.html
if test -n "${bootdev}"; test $? != 0; then
echo '=============================================================='
echo 'Please set "bootdev" before calling this script.'
echo ''
echo 'Boot from usb:'
echo ' setenv bootdev "usb 0"'
echo ' usb start'
echo ' fatload ${bootdev} 0x20800000 boot.scr && autoscr 0x20800000'
echo ''
echo 'Boot from eMMC:'
echo ' setenv bootdev "mmc 1"'
echo ' fatload ${bootdev} 0x20800000 boot.scr && autoscr 0x20800000'
echo '=============================================================='
exit 22
fi
echo "Try to boot from ${bootdev}"
fatload ${bootdev} 0x20800000 /armbianEnv.txt && env import -t 0x20800000 ${filesize}
if test -n "${rootdev}"; test $? != 0; then
echo 'Please set "rootdev" before calling this script'
echo 'or set it in armbianEnv.txt.'
exit 22
fi
if test -n "${consoleargs}"; test $? != 0; then
test -n "${console}" || setenv console "both"
setenv consoleargs ""
# Due to https://github.com/systemd/systemd/issues/9899, only the last
# console will be the primary console (/dev/console) which is the
# only console the initramfs shell and the systemd log use.
# So when set "both", we use serial console as the primary console.
test "${console}" = "display" || test "${console}" = "both" && setenv consoleargs "${consoleargs} console=tty1"
test "${console}" = "serial" || test "${console}" = "both" && setenv consoleargs "${consoleargs} console=ttyAML0,115200n8"
setenv consoleargs "${consoleargs} no_console_suspend consoleblank=0"
test -n "${bootlogo}" || setenv bootlogo "false"
if test "${bootlogo}" = "true"; then
setenv consoleargs "${consoleargs} splash plymouth.ignore-serial-consoles"
else
setenv consoleargs "${consoleargs}"
fi
fi
# Boot Arguments
setenv bootargs ""
setenv bootargs "${bootargs} root=${rootdev} rootwait rw"
setenv bootargs "${bootargs} ${consoleargs}"
setenv bootargs "${bootargs} ${extraargs}"
# Booting
fatload ${bootdev} 0x20800000 /uImage || exit 1
fatload ${bootdev} 0x22000000 /uInitrd || exit 1
fatload ${bootdev} 0x21800000 /dtb/meson8b-onecloud.dtb || exit 1
bootm 0x20800000 0x22000000 0x21800000
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr