forked from yoffy/jetson-nano-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-btusb.sh
executable file
·36 lines (27 loc) · 935 Bytes
/
install-btusb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -eu
MAKEJ="make -j$(( $(nproc) + 1 ))"
BTUSB_PATCH=$(pwd)/btusb.patch
INSTALL_DIR=/lib/modules/$(uname -r)/updates/drivers/bluetooth
source download-kernel.sh
pushd workdir/${KERNEL_DIR}
echo "Patch"
patch -p1 -N < "${BTUSB_PATCH}" && true
echo "Configuring kernel"
${MAKEJ} ARCH=arm64 O=${TEGRA_KERNEL_OUT} tegra_defconfig
bash scripts/config \
--file "${TEGRA_KERNEL_OUT}/.config" \
--set-str LOCALVERSION "-tegra"
${MAKEJ} ARCH=arm64 O=${TEGRA_KERNEL_OUT} prepare
${MAKEJ} ARCH=arm64 O=${TEGRA_KERNEL_OUT} scripts
# need to make twice (why?)
echo "Making module"
${MAKEJ} ARCH=arm64 O=${TEGRA_KERNEL_OUT} M=drivers/bluetooth
${MAKEJ} ARCH=arm64 O=${TEGRA_KERNEL_OUT} M=drivers/bluetooth
echo "Installing module"
sudo modprobe -r btusb && true
sudo mkdir -p ${INSTALL_DIR}
sudo cp ${TEGRA_KERNEL_OUT}/drivers/bluetooth/btusb.ko ${INSTALL_DIR}/
sudo depmod -a
sudo modprobe btusb && true
popd