Add H2/H3 legacy branch support

This commit is contained in:
leeboby
2020-12-21 11:13:58 +08:00
parent f58af2f7d3
commit 04ecc49ba9
56 changed files with 15450 additions and 331 deletions

View File

@@ -4,7 +4,6 @@ ARCH=arm64
KERNEL_IMAGE_TYPE=Image
CAN_BUILD_STRETCH=yes
GIT_SERVER="https://github.com/orangepi-xunlong"
#[[ ${DOWNLOAD_MIRROR} == china ]] && GIT_SERVER="https://gitee.com/leeboby"
[[ -z $INITRD_ARCH ]] && INITRD_ARCH=arm64

View File

@@ -5,7 +5,6 @@ ARCH=armhf
KERNEL_IMAGE_TYPE=Image
CAN_BUILD_STRETCH=yes
GIT_SERVER="https://github.com/orangepi-xunlong"
#[[ ${DOWNLOAD_MIRROR} == china ]] && GIT_SERVER="https://gitee.com/leeboby"
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER="arm-none-linux-gnueabihf-"
[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0'

View File

@@ -13,13 +13,15 @@ PACKAGE_LIST_DESKTOP_FAMILY="fcitx fonts-wqy-zenhei"
case $BRANCH in
legacy)
KERNELBRANCH="branch:orange-pi-3.4"
KERNELPATCHDIR='sunxi-'$BRANCH
BOOTENV_FILE='sun8i-default.txt'
KERNEL_USE_GCC='> 5.0'
ASOUND_STATE='asound.state.sun8i-default'
LINUXFAMILY=sun8i
KERNELBRANCH="branch:orange-pi-3.4-sun8i"
KERNELPATCHDIR='sun8i-'$BRANCH
BOOTENV_FILE='sun8i-legacy.txt'
KERNEL_COMPILER="arm-linux-gnueabihf-"
KERNEL_USE_GCC='> 5.0'
ASOUND_STATE='asound.state.sun8i-legacy'
BOOTPATCHDIR='u-boot-sun8i-legacy'
BOOTBRANCH='branch:v2018.05-sun8i-linux3.4'
;;
current)
@@ -28,14 +30,6 @@ case $BRANCH in
KERNELPATCHDIR='sunxi-'$BRANCH
;;
dev)
KERNELSOURCE="https://github.com/megous/linux"
KERNELBRANCH="branch:orange-pi-5.7"
KERNELPATCHDIR='sunxi-'$BRANCH
;;
esac
family_tweaks()
@@ -43,7 +37,7 @@ family_tweaks()
# execute specific tweaks function if present
[[ $(type -t family_tweaks_s) == function ]] && family_tweaks_s
#cp $SRC/packages/blobs/splash/orangepi-u-boot-24.bmp $SDCARD/boot/boot.bmp
#cp $EXTER/packages/blobs/splash/orangepi-u-boot-24.bmp $SDCARD/boot/boot.bmp
}
family_tweaks_bsp()

View File

@@ -10,21 +10,67 @@ fi
family_tweaks_s()
{
if [[ -f $SDCARD/lib/systemd/system/ap6212-bluetooth.service ]]; then
if [[ -f $SDCARD/lib/systemd/system/ap6212-bluetooth.service && $BRANCH == current ]]; then
# install and enable Bluetooth
chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools >/dev/null 2>&1"
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable ap6212-bluetooth.service >/dev/null 2>&1"
fi
}
if [[ $BOARD == orangepizeroplus2h3 && $BRANCH == legacy ]]; then
family_tweaks_bsp()
{
chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools >/dev/null 2>&1"
if [[ $BOARD == orangepizeroplus2h3 ]]; then
install -m 755 $EXTER/packages/blobs/bt/brcm_patchram_plus/brcm_patchram_plus_$ARCH $destination/usr/bin/brcm_patchram_plus
cp $EXTER/packages/bsp/sunxi/ap6212-bluetooth.service $destination/lib/systemd/system/
cat <<-EOF > "${SDCARD}"/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/bin/zeroplus2-bt.sh
exit 0
EOF
chmod +x "${SDCARD}"/etc/rc.local
fi
}
family_tweaks_bsp_s()
{
if [[ $BOARD == orangepizeroplus2h3 && $BRANCH == current ]]; then
install -m 755 $EXTER/packages/blobs/bt/brcm_patchram_plus/brcm_patchram_plus_$ARCH $destination/usr/bin/brcm_patchram_plus
cp $EXTER/packages/bsp/sunxi/ap6212-bluetooth.service $destination/lib/systemd/system/
fi
if [[ $BOARD == orangepizeroplus2h3 && $BRANCH == legacy ]]; then
install -m 755 $EXTER/packages/blobs/bt/brcm_patchram_plus/brcm_patchram_plus_$ARCH $destination/usr/bin/brcm_patchram_plus
install -m 755 $EXTER/packages/bsp/sunxi/zeroplus2-bt.sh $destination/usr/bin/
fi
if [[ $BRANCH == legacy ]]; then
arm-linux-gnueabihf-gcc $EXTER/packages/bsp/sunxi-temp/sunxi_tp_temp.c -o $destination/usr/bin/sunxi_tp_temp
# convert and add fex files
mkdir -p $destination/boot/bin
for i in $(ls -w1 $EXTER/config/fex/*.fex | xargs -n1 basename); do
fex2bin $EXTER/config/fex/${i%*.fex}.fex $destination/boot/bin/${i%*.fex}.bin
done
fi
# h3disp for sun8i/3.4.x
if [[ $BRANCH == legacy ]]; then
install -m 755 $EXTER/packages/bsp/{h3disp,h3consumption,setsystem} $destination/usr/bin
fi
}