-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xiaomi-elish: Generate bluetooth mac address from machine-id
Since v6.9 default mac bluetooth address of QCA6390 "00:00:00:00:5a:ad" is no longer usable. So we have to generate a new one.
- Loading branch information
1 parent
9a59cfd
commit 1c63698
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Bluetooth Fixed Mac Address | ||
After=bluetooth.service systemd-machine-id-commit.service | ||
Wants=bluetooth.service | ||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
SyslogIdentifier=bt-fixed-mac | ||
ExecStart=/usr/local/bin/bt-fixed-mac.sh | ||
[Install] | ||
WantedBy=bluetooth.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
mac="$(echo $(cat /etc/machine-id; echo bluetooth)| sha256sum -)" | ||
bt_mac=$(echo "42:${mac:0:2}:${mac:4:2}:${mac:8:2}:${mac:12:2}:${mac:16:2}") | ||
echo $bt_mac | ||
/usr/bin/bluetoothctl mgmt.public-addr $bt_mac |