Add overlay prefixes to sunxi boot script
Add overlay "fixup" scripts support Rework sunxi boot script to use "prefix" env variable
This commit is contained in:
parent
52ecf017bd
commit
bfa7134e12
@ -199,7 +199,7 @@ for line in "${buildlist[@]}"; do
|
||||
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
|
||||
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_TARGET_MAP LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
|
||||
MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY MODULES_BLACKLIST MODULES_BLACKLIST_NEXT \
|
||||
MODULES_BLACKLIST_DEV MOUNT SDCARD BOOTPATCHDIR buildtext RELEASE UBOOT_ALT_GCC KERNEL_ALT_GCC IMAGE_TYPE
|
||||
MODULES_BLACKLIST_DEV MOUNT SDCARD BOOTPATCHDIR buildtext RELEASE UBOOT_ALT_GCC KERNEL_ALT_GCC IMAGE_TYPE OVERLAY_PREFIX
|
||||
|
||||
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
||||
n=$[$n+1]
|
||||
|
||||
@ -7,6 +7,7 @@ MODULES_NEXT=""
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
KERNEL_TARGET="dev"
|
||||
OVERLAY_PREFIX="sun8i-a83t"
|
||||
#
|
||||
BOARDRATING=""
|
||||
HARDWARE="https://linux-sunxi.org/Banana_Pi_M3"
|
||||
|
||||
@ -6,7 +6,8 @@ MODULES="hci_uart gpio_sunxi rfcomm hidp bonding spi_sun7i 8021q a20_tp"
|
||||
MODULES_NEXT=""
|
||||
CLI_TARGET="jessie:next"
|
||||
KERNEL_TARGET="next"
|
||||
OVERLAY_PREFIX="sun8i-a33"
|
||||
#
|
||||
BOARDRATING=""
|
||||
HARDWARE="https://www.olimex.com/Products/OLinuXino/A33/A33-OLinuXino/open-source-hardware"
|
||||
FORUMS="http://forum.armbian.com/index.php/forum/13-allwinner-h3"
|
||||
FORUMS="http://forum.armbian.com/index.php/forum/13-allwinner-h3"
|
||||
|
||||
@ -21,7 +21,8 @@ itest.b *0x28 == 0x03 && echo "U-boot loaded from SPI"
|
||||
|
||||
echo "Boot script loaded from ${devtype}"
|
||||
|
||||
if load ${devtype} 0 ${load_addr} /boot/armbianEnv.txt || load ${devtype} 0 ${load_addr} armbianEnv.txt; then
|
||||
if test -e ${devtype} 0 ${prefix}armbianEnv.txt; then
|
||||
load ${devtype} 0 ${load_addr} ${prefix}armbianEnv.txt
|
||||
env import -t ${load_addr} ${filesize}
|
||||
fi
|
||||
|
||||
@ -37,32 +38,44 @@ setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs
|
||||
if test "${disp_mem_reserves}" = "off"; then setenv bootargs "${bootargs} sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16"; fi
|
||||
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
|
||||
|
||||
load ${devtype} 0 ${ramdisk_addr_r} /boot/uInitrd || load ${devtype} 0 ${ramdisk_addr_r} uInitrd
|
||||
load ${devtype} 0 ${kernel_addr_r} /boot/zImage || load ${devtype} 0 ${kernel_addr_r} zImage
|
||||
load ${devtype} 0 ${ramdisk_addr_r} ${prefix}uInitrd
|
||||
load ${devtype} 0 ${kernel_addr_r} ${prefix}zImage
|
||||
|
||||
if load ${devtype} 0 0x00000000 /boot/.next || load ${devtype} 0 0x00000000 .next; then
|
||||
load ${devtype} 0 ${fdt_addr_r} /boot/dtb/${fdtfile} || load ${devtype} 0 ${fdt_addr_r} /dtb/${fdtfile}
|
||||
if test -e ${devtype} 0 "${prefix}.next"; then
|
||||
echo "Found mainline kernel configuration"
|
||||
load ${devtype} 0 ${fdt_addr_r} ${prefix}dtb/${fdtfile}
|
||||
fdt addr ${fdt_addr_r}
|
||||
fdt resize
|
||||
for overlay_file in ${overlays}; do
|
||||
if load ${devtype} 0 ${load_addr} boot/dtb/overlay/${overlay_file}.dtbo || load ${devtype} 0 ${load_addr} dtb/overlay/${overlay_file}.dtbo; then
|
||||
echo "Applying kernel provided DT overlay ${overlay_file}.dtbo"
|
||||
if load ${devtype} 0 ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
|
||||
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
|
||||
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||
fi
|
||||
done
|
||||
for overlay_file in ${user_overlays}; do
|
||||
if load ${devtype} 0 ${load_addr} boot/overlay-user/${overlay_file}.dtbo || load ${devtype} 0 ${load_addr} overlay-user/${overlay_file}.dtbo; then
|
||||
if load ${devtype} 0 ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
|
||||
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
|
||||
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||
fi
|
||||
done
|
||||
if test "${overlay_error}" = "true"; then
|
||||
echo "Error applying DT overlays, restoring original DT"
|
||||
load ${devtype} 0 ${fdt_addr_r} /boot/dtb/${fdtfile} || load ${devtype} 0 ${fdt_addr_r} /dtb/${fdtfile}
|
||||
load ${devtype} 0 ${fdt_addr_r} ${prefix}dtb/${fdtfile}
|
||||
else
|
||||
if load ${devtype} 0 ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-fixup.scr; then
|
||||
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
|
||||
source ${load_addr}
|
||||
fi
|
||||
if test -e ${devtype} 0 ${prefix}fixup.scr; then
|
||||
load ${devtype} 0 ${load_addr} fixup.scr
|
||||
echo "Applying user provided fixup script (fixup.scr)"
|
||||
source ${load_addr}
|
||||
fi
|
||||
fi
|
||||
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
||||
else
|
||||
load ${devtype} 0 ${fdt_addr_r} /boot/script.bin || load ${devtype} 0 ${fdt_addr_r} script.bin
|
||||
echo "Found legacy kernel configuration"
|
||||
load ${devtype} 0 ${fdt_addr_r} ${prefix}script.bin
|
||||
bootz ${kernel_addr_r} ${ramdisk_addr_r}
|
||||
fi
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
source "${BASH_SOURCE%/*}/sunxi64_common.inc"
|
||||
|
||||
OVERLAY_PREFIX='sun50i-a64'
|
||||
|
||||
case $BRANCH in
|
||||
default)
|
||||
BOOTSOURCE='https://github.com/zador-blood-stained/u-boot-pine64-armbian.git'
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
source "${BASH_SOURCE%/*}/sunxi_common.inc"
|
||||
|
||||
OVERLAY_PREFIX='sun4i-a10'
|
||||
|
||||
case $BRANCH in
|
||||
default)
|
||||
KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi'
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
source "${BASH_SOURCE%/*}/sunxi64_common.inc"
|
||||
|
||||
OVERLAY_PREFIX='sun50i-h5'
|
||||
|
||||
BOOTENV_FILE='sun50iw2-next.txt'
|
||||
|
||||
[[ -z $CPUMIN ]] && CPUMIN=480000
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
source "${BASH_SOURCE%/*}/sunxi_common.inc"
|
||||
|
||||
OVERLAY_PREFIX='sun7i-a20'
|
||||
|
||||
case $BRANCH in
|
||||
default)
|
||||
KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi'
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
|
||||
source "${BASH_SOURCE%/*}/sunxi_common.inc"
|
||||
|
||||
[[ -z $OVERLAY_PREFIX ]] && OVERLAY_PREFIX='sun8i-h3'
|
||||
|
||||
case $BRANCH in
|
||||
default)
|
||||
BOOTENV_FILE='sun8i-default.txt'
|
||||
|
||||
@ -85,6 +85,9 @@ install_common()
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -n $OVERLAY_PREFIX && -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]] && \
|
||||
echo "overlay_prefix=$OVERLAY_PREFIX" >> $CACHEDIR/$SDCARD/boot/armbianEnv.txt
|
||||
|
||||
# initial date for fake-hwclock
|
||||
date -u '+%Y-%m-%d %H:%M:%S' > $CACHEDIR/$SDCARD/etc/fake-hwclock.data
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user