Skip to content

Commit

Permalink
hcitools : 更新对新型号的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-bin committed Dec 17, 2024
1 parent 3193781 commit f09254c
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arm64/hcitools/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: hcitools
Description: hcitools is used to control bluetooth
Version: 1.0.0
Version: 1.0.1
Maintainer: sc-bin <[email protected]>
Section: free
Priority: optional
Installed-Size: 992
Installed-Size: 2316
Architecture: arm64

37 changes: 37 additions & 0 deletions arm64/hcitools/DEBIAN/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

PATH_PWD="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"

clone_or_pull() {
url="$1"

project_name=$(basename "$url" .git)
target_path="${PATH_PWD}/../usr/lib/walnutpi/$project_name"

if [[ ! -d "$target_path" ]]; then

if [[ ! -d "${PATH_PWD}/../usr/lib/walnutpi" ]]; then
mkdir -p ${PATH_PWD}/../usr/lib/walnutpi
fi

max_attempts=5
attempt_num=1
until [[ $attempt_num -gt $max_attempts ]]
do
git clone "$url" "$target_path" && break
attempt_num=$((attempt_num+1))
echo "git clone failed, attempt $attempt_num..."
sleep 3
done

if [[ $attempt_num -gt $max_attempts ]]; then
echo "git clone failed after $max_attempts attempts, exiting..."
exit 1
fi
else
cd "$target_path"
git pull
fi
}

clone_or_pull "https://github.com/walnutpi/hcitools.git"
8 changes: 8 additions & 0 deletions arm64/hcitools/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

cd /usr/lib/walnutpi/hcitools

make
make install
5 changes: 5 additions & 0 deletions arm64/hcitools/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cd /usr/lib/walnutpi/hcitools

make clean
Binary file removed arm64/hcitools/usr/bin/btmon
Binary file not shown.
Binary file removed arm64/hcitools/usr/bin/hciattach
Binary file not shown.
Binary file removed arm64/hcitools/usr/bin/hciconfig
Binary file not shown.
Binary file removed arm64/hcitools/usr/bin/hcitool
Binary file not shown.
Binary file added server/arm64/hcitools_1.0.1_arm64.deb
Binary file not shown.

0 comments on commit f09254c

Please sign in to comment.