mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
* Add / modify (c) in bash scripts Signed-off-by: Igor <igor@armbian.com> * Add (c) to the source config files --------- Signed-off-by: Igor <igor@armbian.com>
111 lines
3.6 KiB
Plaintext
111 lines
3.6 KiB
Plaintext
#
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
|
|
#
|
|
# This file is a part of the Armbian Build Framework
|
|
# https://github.com/armbian/build/
|
|
#
|
|
source "${BASH_SOURCE%/*}/include/sunxi64_common.inc"
|
|
|
|
[[ -z $CPUMIN ]] && CPUMIN=480000
|
|
[[ -z $CPUMAX ]] && CPUMAX=1512000
|
|
GOVERNOR=ondemand
|
|
|
|
case $BRANCH in
|
|
|
|
legacy)
|
|
|
|
LINUXFAMILY=sun50iw9
|
|
KERNELSOURCE='https://github.com/orangepi-xunlong/linux-orangepi.git'
|
|
export KERNEL_MAJOR_MINOR="4.9" # Major and minor versions of this kernel.
|
|
KERNELBRANCH="branch:orange-pi-4.9-sun50iw9"
|
|
KERNELPATCHDIR=${BOARDFAMILY}-${BRANCH}
|
|
KERNELDIR='linux-orangepi'
|
|
BOOTSOURCE='https://github.com/orangepi-xunlong/u-boot-orangepi.git'
|
|
BOOTBRANCH='branch:v2018.05-sun50iw9'
|
|
BOOTPATCHDIR="legacy"
|
|
UBOOT_TARGET_MAP=";;dts/${BOARD}-u-boot.dts boot0_sdcard.fex boot_package.fex u-boot.bin:u-boot.fex"
|
|
UBOOT_COMPILER="arm-linux-gnueabi-"
|
|
UBOOT_USE_GCC='> 6.0'
|
|
BOOTENV_FILE=sun50iw9.txt
|
|
BOOTSCRIPT='boot-sun50iw9.cmd:boot.cmd'
|
|
PACK_UBOOT="yes"
|
|
OFFSET=20
|
|
ATFSOURCE=""
|
|
ATF_COMPILE="no"
|
|
INITRD_ARCH=arm
|
|
|
|
ASOUND_STATE='asound.state.sun50iw9-legacy'
|
|
|
|
write_uboot_platform() {
|
|
dd if=$1/boot0_sdcard.fex of=$2 bs=8k seek=1 conv=fsync > /dev/null 2>&1
|
|
dd if=$1/boot_package.fex of=$2 bs=8k seek=2050 conv=fsync > /dev/null 2>&1 || true
|
|
}
|
|
|
|
;;
|
|
|
|
current | edge)
|
|
|
|
ATFSOURCE='https://github.com/ARM-software/arm-trusted-firmware'
|
|
ATFBRANCH='branch:master'
|
|
ATF_PLAT="sun50i_h616"
|
|
ATF_TARGET_MAP='PLAT=sun50i_h616 DEBUG=1 bl31;;build/sun50i_h616/debug/bl31.bin'
|
|
BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd'
|
|
|
|
;;
|
|
esac
|
|
|
|
family_tweaks_s() {
|
|
if [[ -f $SDCARD/lib/systemd/system/aw859a-bluetooth.service ]]; then
|
|
|
|
# Enable Bluetooth
|
|
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable aw859a-bluetooth.service >/dev/null 2>&1"
|
|
fi
|
|
|
|
if [[ -f $SDCARD/lib/systemd/system/hdmi-audio.service ]]; then
|
|
|
|
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable hdmi-audio.service >/dev/null 2>&1"
|
|
fi
|
|
}
|
|
|
|
family_tweaks_bsp() {
|
|
|
|
if [[ ${BOARD} == orangepizero2 && ${BRANCH} == legacy ]]; then
|
|
install -m 755 $SRC/packages/blobs/bt/hciattach/hciattach_opi_$ARCH $destination/usr/bin/hciattach_opi
|
|
cp $SRC/packages/bsp/sunxi/aw859a-bluetooth.service $destination/lib/systemd/system/
|
|
|
|
install -m 755 $SRC/packages/blobs/sunxi/h616/inithdmiaudio $destination/usr/bin/
|
|
cp $SRC/packages/blobs/sunxi/h616/libtinyalsa.so $destination/usr/lib/
|
|
cp $SRC/packages/bsp/sunxi/hdmi-audio.service $destination/lib/systemd/system/
|
|
|
|
fi
|
|
}
|
|
|
|
uboot_custom_postprocess() {
|
|
|
|
if [[ ${BRANCH} == legacy ]]; then
|
|
export PATH=$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/:$PATH
|
|
cp ${SRC}/packages/pack-uboot/${BOARDFAMILY}/bin/* . -r
|
|
cp sys_config/sys_config_${BOARD}.fex sys_config.fex
|
|
cp u-boot.bin u-boot.fex
|
|
|
|
# make u-boot dtb
|
|
$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/dtc -p 2048 -W no-unit_address_vs_reg -@ -O dtb -o ${BOARD}-u-boot.dtb -b 0 dts/${BOARD}-u-boot.dts
|
|
|
|
# @TODO: rpardini: hmm? # busybox unix2dos sys_config.fex
|
|
$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/script sys_config.fex
|
|
cp ${BOARD}-u-boot.dtb sunxi.fex
|
|
$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/update_dtb sunxi.fex 4096
|
|
$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/update_boot0 boot0_sdcard.fex sys_config.bin SDMMC_CARD
|
|
|
|
$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/update_uboot -no_merge u-boot.fex sys_config.bin
|
|
update_uboot -no_merge u-boot.bin sys_config.bin
|
|
#pack boot package
|
|
|
|
# @TODO: rpardini: hmm? # busybox unix2dos boot_package.cfg
|
|
$SRC/packages/pack-uboot/${BOARDFAMILY}/tools/dragonsecboot -pack boot_package.cfg
|
|
fi
|
|
|
|
}
|