blob: ae72c677ee811fe0227286c295329b78f1229d2f (
plain)
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
|
if test ${distro_bootpart} != 1 && test ${devtype} != "ubi"
then
echo "Boot partition needs to be the first partition"
exit
fi
env set overlays_file "overlays.txt"
env set load_overlay 'load ${devtype} ${devnum}:1 ${loadaddr} ${overlays_file}; env import -t ${loadaddr} ${filesize}'
env set apply_overlays 'fdt addr ${fdt_addr_r} && fdt resize 0x20000 && for overlay_file in ${fdt_overlays}; do echo "Applying Overlay: ${overlay_file}"
&& load ${devtype} ${devnum}:1 ${loadaddr} ${overlay_file} && fdt apply ${loadaddr}; done;'
env set bootcmd_load_k 'load ${devtype} ${devnum}:2 ${kernel_addr_r} "/boot"${kernel_image}'
env set bootcmd_load_r 'load ${devtype} ${devnum}:2 ${ramdisk_addr_r} "/boot"${ramdisk_image}; env set ramdisk_size ${filesize}'
if test ${devtype} != ubi
then
# Load commands for regular block devices
env set bootcmd_otenv 'ext4load ${devtype} ${devnum}:2 ${loadaddr} /boot/loader/uEnv.txt; env import -t ${loadaddr} ${filesize}'
env set bootcmd_args 'env set bootargs root=LABEL=otaroot rootfstype=ext4 ${bootargs} ${scriptargs} ${tdxargs}'
else
# Load commands for raw NAND devices
env set bootcmd_otenv 'ubifsmount ubi${devnum}:rootfs && load ${devtype} ${devnum}:2 ${loadaddr} /boot/loader/uEnv.txt; env import -t ${loadaddr} ${filesize}'
env set bootcmd_args 'env set bootargs ubi.mtd=ubi root=/dev/ubi0_1 rootfstype=ubifs ubi.fm_autoconvert=1 ${bootargs} ${tdxargs}'
fi
run bootcmd_otenv
if test "${board}" = "apalis-imx8"
then
echo "Loading HDMI firmware..."
env set hdp_file hdmitxfw.bin
load ${devtype} ${devnum}:1 ${loadaddr} ${hdp_file}
hdp load ${loadaddr}
env set scriptargs pci=nomsi
fi
if test -n ${rollback} && test ${rollback} = 1
then
echo "Roolback enabled. Booting old version."
env set kernel_image ${kernel_image2}
env set ramdisk_image ${ramdisk_image2}
env set bootargs ${bootargs2}
env set fdt_path ${fdt_path2}
fi
env set bootcmd_dtb 'load ${devtype} ${devnum}:2 ${fdt_addr_r} "/boot"${fdt_path}devicetree-${fdtfile}; if test -e ${devtype} ${devnum}:1 ${overlays_file}; then run load_overlay && run apply_overlays || true;fi || true'
env set bootcmd_boot '@@KERNEL_BOOTCMD@@ ${kernel_addr_r} ${ramdisk_addr_r}:${ramdisk_size} ${fdt_addr_r}'
env set bootcmd_run 'run bootcmd_dtb && run bootcmd_args && run bootcmd_load_k && run bootcmd_load_r && run bootcmd_boot'
run bootcmd_run
|