Synchroniser un clavier apple aluminium bluetooth en dual boot (OS X - Gnu/Linux)
Dans le cadre d’une installation en dual boot MAC OS / Debian, il peut s’avérer fastidieux de synchroniser ses périphériques bluetooth avec un identifiant commun entre les systèmes.
La marche à suivre consiste à opérer la synchronisation sous OS X, puis booter sous GNU/Linux, monter la partition OS X, par exemple :sudo mount -t hfsplus /dev/sda2 /media/OSX/
Puis à exécuter ce script [1] :
- #!/bin/sh
- # sync-bt-os.sh
- cd /var/lib/bluetooth
- for i in *; do
- cd "$i"
- plutil -i /media/OSX/private/var/root/Library/Preferences/blued.plist -o /dev/stdout |
- perl -0777 -MMIME::Base64 -ne 's|\s||g; $s = $_; while ($s =~ m|<key>(..-..-..-..-..-..)</key><data>(.*?)</data>|g) { $mac = uc($1); $key = uc(unpack("H*",reverse decode_base64($2))); $mac =~ s/-/:/g; $pinlength = 6; $pinlength = 4 if $mac eq "C4:2C:03:A0:C7:20"; print "$mac $key 0 $pinlength\n"; }' |
- tee linkkeys
- cd ..
- done
- service bluetooth restart