Skip to content

Commit

Permalink
initscripts: Correct WiFi MAC and mount /firmware.
Browse files Browse the repository at this point in the history
Setup the MAC addresss for the WiFi chip prior to starting the system.
This fixes autoconnect after a reboot when using connman.

Also make sure to mount /firmware to fix potential issues with adsp not working.
  • Loading branch information
MagneFire committed Dec 30, 2020
1 parent bac0628 commit 53b9122
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
@@ -0,0 +1,27 @@
#!/bin/sh

BOOT_DIR=$1

mkdir $BOOT_DIR/nvdata
mount -t ext4 /dev/mmcblk0p9 $BOOT_DIR/nvdata

mkdir $BOOT_DIR/firmware
mount -t ext4 /dev/mmcblk0p32 $BOOT_DIR/firmware

mkdir -p /nvdata
mkdir -p /firmware
mkdir -p /system/etc/wifi
mkdir -p /system/vendor/firmware/
mkdir -p /vendor/firmware

mount --bind $BOOT_DIR/system/etc/wifi /system/etc/wifi
mount --bind $BOOT_DIR/system/vendor/firmware/ /system/vendor/firmware/
mount --bind $BOOT_DIR/vendor/firmware /vendor/firmware
mount --bind $BOOT_DIR/nvdata /nvdata
mount --bind $BOOT_DIR/firmware /firmware

dd if=/nvdata/MACWLAN of=/proc/wifi/mac

ip link set up dev wlan0
sleep 1
ip link set down dev wlan0
@@ -1,2 +1,10 @@
FILESEXTRAPATHS_prepend_sawfish := "${THISDIR}/${PN}:"
COMPATIBLE_MACHINE_sawfish = "sawfish"

SRC_URI_append_sawfish += " file://init.machine.sh"

do_install_append_sawfish() {
install -m 0755 ${WORKDIR}/init.machine.sh ${D}/init.machine
}

FILES_${PN} += "/init.machine"

0 comments on commit 53b9122

Please sign in to comment.