mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-18 12:51:40 +00:00
commit
1c4171a958
4 changed files with 50 additions and 0 deletions
|
@ -108,5 +108,18 @@ family_tweaks()
|
|||
echo "ttyFIQ0" >> $SDCARD/etc/securetty
|
||||
if [[ $BOARD == z28pro ]]; then
|
||||
echo "fdtfile=rockchip/rk3328-z28pro.dtb" >> $SDCARD/boot/armbianEnv.txt
|
||||
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable z28pro-bluetooth.service >/dev/null 2>&1"
|
||||
fi
|
||||
}
|
||||
|
||||
family_tweaks_bsp()
|
||||
{
|
||||
if [[ $BOARD == z28pro ]]; then
|
||||
mkdir -p $destination/usr/local/bin
|
||||
# Bluetooth
|
||||
install -m 755 $SRC/packages/bsp/rk3328/z28pro/8822b_hciattach $destination/usr/bin
|
||||
install -m 755 $SRC/packages/bsp/rk3328/z28pro/start_bt.sh $destination/usr/local/bin
|
||||
cp $SRC/packages/bsp/rk3328/z28pro/z28pro-bluetooth.service $destination/lib/systemd/system/
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
BIN
packages/bsp/rk3328/z28pro/8822b_hciattach
Executable file
BIN
packages/bsp/rk3328/z28pro/8822b_hciattach
Executable file
Binary file not shown.
26
packages/bsp/rk3328/z28pro/start_bt.sh
Normal file
26
packages/bsp/rk3328/z28pro/start_bt.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
function die_on_error {
|
||||
if [ ! $? = 0 ]; then
|
||||
echo $1
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Kill any rtk_hciattach actually running.
|
||||
# Do not complain if we didn't kill anything.
|
||||
killall -q -SIGTERM 8822b_hciattach
|
||||
|
||||
echo "We must stop getty now, You must physically disconnect your USB-UART-Adapter!"
|
||||
systemctl stop serial-getty@ttyS2 || die_on_error "Could not stop getty"
|
||||
|
||||
echo "Using /dev/ttyS2 for Bluetooth"
|
||||
|
||||
echo "Power cycle 8822BS BT-section"
|
||||
rfkill block bluetooth
|
||||
sleep 2
|
||||
rfkill unblock bluetooth
|
||||
echo "Start attaching"
|
||||
|
||||
/usr/bin/8822b_hciattach -n -s 115200 /dev/ttyS2 rtk_h5 || die_on_error "Could not create hci0 through rtk_hciattach. Did you remove your USB-UART-Adapter?"
|
11
packages/bsp/rk3328/z28pro/z28pro-bluetooth.service
Normal file
11
packages/bsp/rk3328/z28pro/z28pro-bluetooth.service
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Realtek H5 bluetooth support
|
||||
Before=bluetooth.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash /usr/local/bin/start_bt.sh
|
||||
Restart=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Reference in a new issue