mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-17 23:34:07 +00:00
alarm/firmware-brcm43xx: Generate semi-random MAC address and make service conf optional
Prevents MAC conflicts when settings up multiple systems at the same time.
This commit is contained in:
parent
e4acc8dd6c
commit
935b1d41f1
4 changed files with 12 additions and 10 deletions
|
@ -19,17 +19,15 @@ source=('https://raw.githubusercontent.com/OpenBricks/openbricks/master/packages
|
|||
'https://github.com/OpenBricks/openbricks/raw/master/packages/brcm-patchram-plus/sources/bcm4330.hcd'
|
||||
'https://raw.githubusercontent.com/OpenBricks/openbricks/master/packages/brcm-patchram-plus/sources/brcm_patchram_plus.c'
|
||||
'start-brcm-patchram-plus'
|
||||
'brcm43xx.service'
|
||||
'bcm43xx')
|
||||
'brcm43xx.service')
|
||||
md5sums=('bf01292eec17815baa68a83d3d7722ad'
|
||||
'31a9a011ce24707ed3c1024616c9005e'
|
||||
'31a9a011ce24707ed3c1024616c9005e'
|
||||
'ff27325602dc223203adfdd23a89844b'
|
||||
'8e32f9168aaa540467589c153129c57a'
|
||||
'627e9612337e5ef6027a87a79c491446'
|
||||
'c2d65a43d3c1c5eb7e2d168440867db4'
|
||||
'7e4dcf16c3def9b5a159627b25b21e1e'
|
||||
'587fa5f25768380605287057924238e6')
|
||||
'33ec0f0cfbbdd42b933d0a2ad93f7181'
|
||||
'f2eefa2042130e559b2d664a3fcc7b50')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/"
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
MAC_ADDR=43:29:B1:55:01:01
|
|
@ -3,7 +3,7 @@ Description=Load Broadcom bluetooth firmware
|
|||
Before=bluetooth.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/conf.d/bcm43xx
|
||||
EnvironmentFile=-/etc/conf.d/bcm43xx
|
||||
Type=oneshot
|
||||
ExecStart=/usr/lib/systemd/scripts/start-brcm-patchram-plus
|
||||
RemainAfterExit=yes
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
CACHE=/var/cache/brcm43xx-mac
|
||||
MAC_OPTIONS=""
|
||||
if [ -z "$MAC_ADDR" ]; then
|
||||
echo "MAC_ADDR in /etc/conf.d/bcm4329 not set, will use MAC set by device (expect this to be buggy)"
|
||||
else
|
||||
MAC_OPTIONS="--bd_addr $MAC_ADDR"
|
||||
if [ ! -f "$CACHE" ]; then
|
||||
echo 43:29:B1$(od -txC -An -N3 /dev/random|tr \ : | tr '[:lower:]' '[:upper:]') >"$CACHE"
|
||||
fi
|
||||
|
||||
MAC_ADDR=`cat "$CACHE"`
|
||||
echo "Warning: Using self generated MAC address! MAC_ADDR should be defined in /etc/conf.d/brcm43xx."
|
||||
else
|
||||
[ -f "$CACHE" ] && rm "$CACHE"
|
||||
fi
|
||||
MAC_OPTIONS="--bd_addr $MAC_ADDR"
|
||||
|
||||
a=`cat /sys/class/mmc_host/mmc0/mmc0\:0001/mmc0\:0001\:1/device`
|
||||
|
||||
|
|
Loading…
Reference in a new issue