71 lines
2.9 KiB
Plaintext
71 lines
2.9 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/
|
|
#
|
|
BOOTSCRIPT='boot-mt7623.cmd:boot.cmd'
|
|
BOOTENV_FILE='mt7623.txt'
|
|
UBOOT_TARGET_MAP=";;$SRC/packages/blobs/mt7623n/BPI-R2-HEAD440-0k.img $SRC/packages/blobs/mt7623n/BPI-R2-HEAD1-512b.img $SRC/packages/blobs/mt7623n/BPI-R2-preloader-2k.img $SRC/packages/blobs/mt7623n/BPI-R2-EMMC-boot0-0K-0905.img u-boot.bin"
|
|
BOOTPATCHDIR='v2024.07'
|
|
BOOTBRANCH='tag:v2024.07'
|
|
ARCH=armhf
|
|
ATF_COMPILE="no"
|
|
EXTRAWIFI="no"
|
|
|
|
case $BRANCH in
|
|
|
|
# 07/2024: This family only has one board (BananaPi R2) and has not been properly maintained in many years, so 'current' LTS kernel is enough.
|
|
# No need for 'edge' kernel unless someone plans to step in as maintainer who bumps and tests it on every new kernel release.
|
|
current)
|
|
KERNEL_MAJOR_MINOR="6.6" # Major and minor versions of this kernel.
|
|
# No need to set KERNELPATCHDIR, since default is: KERNELPATCHDIR='archive/${BOARDFAMILY}-${KERNEL_MAJOR_MINOR}'
|
|
;;
|
|
|
|
esac
|
|
|
|
CPUMIN=98000
|
|
CPUMAX=1300000
|
|
GOVERNOR="ondemand"
|
|
|
|
declare -g NETWORKING_STACK="systemd-networkd" # Always use systemd-networkd since 'family_tweaks()' includes some network config that currently is only available for networkd; @TODO Change this config to Netplan config
|
|
|
|
# @TODO Can probably be deleted, especially after the config (see 'NETWORKING_STACK' above) has been converted to Netplan. Then it won't matter if networkd or Network-Manager is used.
|
|
function pre_install_kernel_debs__network_manager_ignore_devices() {
|
|
display_alert "Board: ${BOARD}: Disabling Network-Manager for all devices" "interface-name:eth*,interface-name:wan*,interface-name:lan*,interface-name:br*" "info"
|
|
|
|
mkdir -p "${SDCARD}"/etc/NetworkManager/conf.d/
|
|
cat <<- EOF > "${SDCARD}"/etc/NetworkManager/conf.d/99-ignore-interfaces.conf
|
|
[keyfile]
|
|
unmanaged-devices="interface-name:eth*,interface-name:wan*,interface-name:lan*,interface-name:br*"
|
|
EOF
|
|
}
|
|
|
|
write_uboot_platform() {
|
|
if [[ $2 == /dev/mmcblk* && -b ${2}boot0 ]]; then
|
|
local device=${2}boot0
|
|
echo 0 > /sys/block/$(basename $device)/force_ro
|
|
local is_emmc=1
|
|
else
|
|
local device=${2}
|
|
fi
|
|
|
|
if [[ $is_emmc == 1 ]]; then
|
|
dd if=$1/BPI-R2-EMMC-boot0-0K-0905.img of=$2boot0 bs=1024 seek=0 status=noxfer > /dev/null 2>&1
|
|
dd if=$1/u-boot.bin of=$2 bs=1k seek=320 status=noxfer > /dev/null 2>&1
|
|
mmc bootpart enable 1 1 $2
|
|
|
|
else
|
|
dd if=$SRC/packages/blobs/mt7623n/BPI-R2-HEAD440-0k.img of=$2 bs=440 seek=0 count=1 status=noxfer > /dev/null 2>&1
|
|
dd if=$SRC/packages/blobs/mt7623n/BPI-R2-HEAD1-512b.img of=$2 bs=512 seek=1 status=noxfer > /dev/null 2>&1
|
|
dd if=$SRC/packages/blobs/mt7623n/BPI-R2-preloader-2k.img of=$2 bs=1k seek=2 status=noxfer > /dev/null 2>&1
|
|
dd if=$1/u-boot.bin of=$2 bs=1k seek=320 status=noxfer > /dev/null 2>&1
|
|
fi
|
|
}
|
|
|
|
family_tweaks() {
|
|
cp $SRC/packages/bsp/mt7623/10* $SDCARD/etc/systemd/network/
|
|
}
|