diff options
Diffstat (limited to 'board/post-build.sh')
-rwxr-xr-x | board/post-build.sh | 95 |
1 files changed, 3 insertions, 92 deletions
diff --git a/board/post-build.sh b/board/post-build.sh index 6b1c86c..cfdaec0 100755 --- a/board/post-build.sh +++ b/board/post-build.sh @@ -15,98 +15,9 @@ fi # Put the whole system in readonly sed -ie '/^\/dev\/root/ s/rw 0 1/ro 0 0/' "${TARGET_DIR}/etc/fstab" -########################### -# # -# Network configuration # -# # -########################### - -# Add default wpa_supplicant.conf if it exists -if [ -f "$BR2_EXTERNAL_PIAUDIO_PATH/wpa_supplicant.conf" ]; then - create_missing_dir "/etc/wpa_supplicant/" - cat "$BR2_EXTERNAL_PIAUDIO_PATH/wpa_supplicant.conf" > "${TARGET_DIR}/etc/wpa_supplicant/wpa_supplicant-wlan0.conf" - - - cat << __EOF__ > "${TARGET_DIR}/etc/systemd/network/wireless.network" -[Match] -Name=wlan0 - -[Network] -DHCP=yes -__EOF__ - - # Create the link to interface wlan0 directly in the system configuration - ln -sf /usr/lib/systemd/system/wpa_supplicant@.service "${TARGET_DIR}/usr/lib/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service" - -fi - -############################## -# # -# Pulseaudio configuration # -# # -############################## - -# Create the directory where pulseaudio store its files and put it in tempfs -create_missing_dir "/var/lib/pulse" -if ! grep -qE '/var/lib/pulse' "${TARGET_DIR}/etc/fstab"; then - cat << __EOF__ >> "${TARGET_DIR}/etc/fstab" -tmpfs /var/lib/pulse tmpfs rw 0 0 -__EOF__ -fi - -if ! grep -qE '^load-module module-native-protocol-tcp' "${TARGET_DIR}/etc/pulse/system.pa"; then - cat << __EOF__ >> "${TARGET_DIR}/etc/pulse/system.pa" -load-module module-bluetooth-policy -load-module module-bluetooth-discover -load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24;2a01:e35:8ac8:0e00::/64 auth-anonymous=1 -__EOF__ -fi - -############################# -# # -# Bluetooth configuration # -# # -############################# - -create_missing_dir "/etc/bluetooth/" -cat << __EOF__ > "${TARGET_DIR}/etc/bluetooth/main.conf" -[General] - -Class = 200428 -DiscoverableTimeout = 0 -PairableTimeout = 0 - -[Policy] -AutoEnable=true -__EOF__ - - -cat << __EOF__ > "${TARGET_DIR}/etc/systemd/system/bt-agent.service" -[Unit] -Description=Bluetooth Agent -After=bluetooth.service -Requires=bluetooth.service - -[Service] -Type=simple -ExecStartPre=bt-adapter --set Discoverable 1 -ExecStart=bt-agent -c NoInputNoOutput -RestartSec=5 -Restart=always -KillSignal=SIGUSR1 - -[Install] -WantedBy=bluetooth.target -__EOF__ - -# The same for the bluetooth, as bluetoothd keep a track for each paired device -create_missing_dir "/var/lib/bluetooth/" -if ! grep -qE '/var/lib/bluetooth' "${TARGET_DIR}/etc/fstab"; then - cat << __EOF__ >> "${TARGET_DIR}/etc/fstab" -tmpfs /var/lib/bluetooth tmpfs rw 0 0 -__EOF__ -fi - +. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/network.sh" +. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/pulseaudio.sh" +. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/bluetooth.sh" mkdir -p "${TARGET_DIR}"/etc/systemd/system/getty.target.wants # Add a console on ttyAMA0 and enable auto login |