2022-12-02 19:51:41 +08:00
|
|
|
source "${BASH_SOURCE%/*}/include/rockchip64_common.inc"
|
|
|
|
|
|
|
|
|
|
OVERLAY_PREFIX='rk3588'
|
|
|
|
|
BOOTDELAY=0
|
|
|
|
|
|
|
|
|
|
CPUMIN=408000
|
|
|
|
|
CPUMAX=2400000
|
|
|
|
|
|
|
|
|
|
case $BRANCH in
|
|
|
|
|
|
|
|
|
|
legacy)
|
|
|
|
|
|
|
|
|
|
BOOTBRANCH='branch:v2017.09-rk3588'
|
|
|
|
|
UBOOT_COMPILER="aarch64-linux-gnu-"
|
|
|
|
|
UBOOT_USE_GCC='< 8.0'
|
|
|
|
|
|
|
|
|
|
KERNELBRANCH='branch:orange-pi-5.10-rk3588'
|
|
|
|
|
KERNELPATCHDIR='rockchip-rk3588-legacy'
|
2023-04-10 09:20:03 +08:00
|
|
|
LINUXCONFIG="linux-rockchip-rk3588-legacy"
|
|
|
|
|
|
2023-02-16 19:40:07 +08:00
|
|
|
KERNEL_USE_GCC='> 10.0'
|
2022-12-02 19:51:41 +08:00
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
prepare_boot_configuration
|
|
|
|
|
|
|
|
|
|
family_tweaks_bsp() {
|
|
|
|
|
|
|
|
|
|
install -m 755 $EXTER/packages/bsp/adb/adbd-${ARCH} ${destination}/usr/bin/adbd
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-05 14:37:48 +08:00
|
|
|
|
|
|
|
|
install_balenaEtcher(){
|
|
|
|
|
|
|
|
|
|
if [[ $BUILD_DESKTOP == yes && $install_balena_etcher == yes ]]; then
|
|
|
|
|
|
|
|
|
|
balena_etcher_deb=balena-etcher-electron_1.7.9+5945ab1f_arm64.deb
|
|
|
|
|
balena_etcher_url="https://github.com/Itai-Nelken/BalenaEtcher-arm/releases/download/v1.7.9/${balena_etcher_deb}"
|
|
|
|
|
balena_etcher=${EXTER}/cache/debs/arm64/${balena_etcher_deb}
|
|
|
|
|
|
|
|
|
|
if [[ ! -f ${balena_etcher} ]]; then
|
|
|
|
|
wget -P ${EXTER}/cache/debs/arm64 ${balena_etcher_url}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
install_deb_chroot ${balena_etcher}
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-02 19:51:41 +08:00
|
|
|
family_tweaks_s() {
|
|
|
|
|
|
2023-03-14 19:52:17 +08:00
|
|
|
if [[ ${SELECTED_CONFIGURATION} == desktop && ${DESKTOP_ENVIRONMENT} == kde-plasma ]]; then
|
|
|
|
|
rsync -a --chown=root:root --exclude=etc/pulse "${EXTER}"/packages/bsp/rk3588/* ${SDCARD}/
|
|
|
|
|
cat > "${SDCARD}"/etc/profile.d/kde_env.sh <<- __EOF__
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
export KWIN_COMPOSE=X
|
|
|
|
|
__EOF__
|
|
|
|
|
|
|
|
|
|
cat > "${SDCARD}"/home/orangepi/.config/kwalletrc <<- __EOF__
|
|
|
|
|
[Wallet]
|
|
|
|
|
Enabled=false
|
|
|
|
|
__EOF__
|
|
|
|
|
|
|
|
|
|
if [[ ${RELEASE} == bullseye ]]; then
|
|
|
|
|
cat > "${SDCARD}"/home/orangepi/.config/kwinrc <<- __EOF__
|
|
|
|
|
[Compositing]
|
|
|
|
|
Backend=XRender
|
|
|
|
|
OpenGLIsUnsafe=false
|
|
|
|
|
__EOF__
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
rsync -a --chown=root:root "${EXTER}"/packages/bsp/rk3588/* ${SDCARD}/
|
|
|
|
|
fi
|
|
|
|
|
|
2023-04-10 09:20:03 +08:00
|
|
|
if [[ ${BOARD} == orangepi5plus ]]; then
|
|
|
|
|
|
|
|
|
|
rsync -a --chown=root:root "${EXTER}"/packages/bsp/orangepi5plus/* ${SDCARD}/
|
|
|
|
|
cp /home/orangepi/orangepi-build/external/cache/sources/linuxpg "${SDCARD}"/opt/ -rfa
|
|
|
|
|
fi
|
|
|
|
|
|
2022-12-09 14:16:22 +08:00
|
|
|
[[ ${RELEASE} == jammy ]] && rm ${SDCARD}/etc/profile.d/orangepi-ssh-title.sh # for adbd
|
|
|
|
|
|
2023-03-14 19:52:17 +08:00
|
|
|
if [[ -f "${SDCARD}"/etc/profile.d/im-config_wayland.sh && ${DESKTOP_ENVIRONMENT} =~ xfce|kde-plasma ]]; then
|
2022-12-09 14:16:22 +08:00
|
|
|
chroot $SDCARD /bin/bash -c "rm /etc/profile.d/im-config_wayland.sh" # for adbd
|
|
|
|
|
fi
|
2022-12-02 19:51:41 +08:00
|
|
|
|
|
|
|
|
# enable additional services
|
|
|
|
|
chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable usbdevice.service >/dev/null 2>&1"
|
2023-04-10 09:20:03 +08:00
|
|
|
#[[ $BOARD == orangepi5plus ]] && chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable pwm-fan.service >/dev/null 2>&1"
|
2022-12-02 19:51:41 +08:00
|
|
|
|
|
|
|
|
sed "s/^SIZE=.*/SIZE=200M/" -i "${SDCARD}"/etc/default/orangepi-ramlog
|
2022-12-05 14:37:48 +08:00
|
|
|
chroot "${SDCARD}" /bin/bash -c "ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime"
|
|
|
|
|
chroot "${SDCARD}" /bin/bash -c "dpkg-reconfigure -f noninteractive tzdata" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
|
2022-12-22 18:59:57 +08:00
|
|
|
|
2023-03-08 20:03:09 +08:00
|
|
|
chroot $SDCARD /bin/bash -c "apt-get -y -qq install lm-sensors usb-modeswitch tree dnsmasq v4l-utils swig python3-dev python3-setuptools bluez libncurses-dev" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
|
2022-12-02 19:51:41 +08:00
|
|
|
|
2022-12-09 14:16:22 +08:00
|
|
|
install_wiringop
|
2022-12-05 14:37:48 +08:00
|
|
|
install_docker
|
|
|
|
|
install_balenaEtcher
|
2022-12-02 19:51:41 +08:00
|
|
|
}
|