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

@@ -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
}