Skip to content

Commit 84ca61d

Browse files
committed
Move aawgd.env to aawgd.conf.sh and source it early in boot process
- Rename /etc/aawgd.env to /etc/aawgd.conf.sh, make it a shell script - Source aawgd.conf.sh early in boot process in /etc/init.d/rcS
1 parent 1f9253f commit 84ca61d

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
set -o allexport
3+
4+
######## Common configuration options for Android Auto Wireless Dongle ########
5+
6+
## Set the connection strategy to use
7+
## 0 - Dongle mode. Waits for both dongle and headunit bluetooth connections and then starts the wifi and usb connections.
8+
## 1 - Phone first (default). Waits for the phone bluetooth and wifi to connect first, and then starts the usb connection.
9+
## 2 - Usb first. Waits for the usb to connect first, and then starts the bluetooth and wifi connection with phone.
10+
AAWG_CONNECTION_STRATEGY=1
11+
12+
13+
## Override bluetooth name suffix
14+
## Set a custom suffix to replace unique id used in "WirelessAADongle-<suffix>" or "AndroidAuto-Dongle-<suffix>"
15+
#AAWG_UNIQUE_NAME_SUFFIX=

aa_wireless_dongle/board/common/rootfs_overlay/etc/aawgd.env

Lines changed: 0 additions & 10 deletions
This file was deleted.

aa_wireless_dongle/board/common/rootfs_overlay/etc/init.d/S93aawgd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ RETVAL=0
1111

1212
case "$1" in
1313
start)
14+
if [ -z "$AAWG_CONF_SOURCED" ]; then
15+
echo "Source /etc/aawgd.conf.sh"
16+
source /etc/aawgd.conf.sh
17+
fi
18+
1419
printf "Starting $DAEMON: "
15-
export $(grep -v '^#' /etc/aawgd.env | xargs)
1620
start-stop-daemon -S -b -q -m -p "$PIDFILE" -x "/usr/bin/$DAEMON"
1721
RETVAL=$?
1822
[ $RETVAL = 0 ] && echo "OK" || echo "FAIL"

aa_wireless_dongle/board/common/rootfs_overlay/etc/init.d/rcS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
exec 1> >(logger -s -p INFO -t console 2>&1)
55
exec 2> >(logger -s -p WARNING -t console)
66

7+
# Source aawgd configuration environment variables
8+
source /etc/aawgd.conf.sh
9+
export AAWG_CONF_SOURCED=1
10+
711
# Start all init scripts in /etc/init.d
812
# executing them in numerical order.
913
#

aa_wireless_dongle/board/raspberrypi/genimage.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image boot.vfat {
22
vfat {
33
label = "WirelessAA"
44
files = {
5-
"aawgd.env",
5+
"aawgd.conf.sh",
66
#BOOT_FILES#
77
}
88
}

aa_wireless_dongle/board/raspberrypi/post-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -u
44
set -e
55
set -x
66

7-
mv ${TARGET_DIR}/etc/aawgd.env ${BINARIES_DIR}/aawgd.env
8-
ln -sf /boot/aawgd.env ${TARGET_DIR}/etc/aawgd.env
7+
mv ${TARGET_DIR}/etc/aawgd.conf.sh ${BINARIES_DIR}/aawgd.conf.sh
8+
ln -sf /boot/aawgd.conf.sh ${TARGET_DIR}/etc/aawgd.conf.sh
99

1010
source board/raspberrypi/post-build.sh

0 commit comments

Comments
 (0)