mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-06-08 02:54:40 +08:00
speedup wifi boot (#597)
* speedup wifi boot * just a pre * bump kernel: * bump kernel
This commit is contained in:
Submodule agnos-kernel-sdm845 updated: 9ddc4650a0...c368754c26
29
userspace/root/usr/comma/wlan-nm-init.sh
Executable file
29
userspace/root/usr/comma/wlan-nm-init.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
iface=wlan0
|
||||
timeout=300
|
||||
|
||||
for ((i = 0; i < timeout; i++)); do
|
||||
[[ -r "/sys/class/net/$iface/ifindex" ]] && break
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
if [[ ! -r "/sys/class/net/$iface/ifindex" ]]; then
|
||||
echo "timed out waiting for $iface"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ifindex=$(< "/sys/class/net/$iface/ifindex")
|
||||
mkdir -p /run/udev/data
|
||||
tmp=$(mktemp "/run/udev/data/n${ifindex}.XXXXXX")
|
||||
|
||||
{
|
||||
printf 'I:%s\n' "$(($(date +%s%N) / 1000))"
|
||||
printf 'E:NM_UNMANAGED=0\n'
|
||||
printf 'V:1\n'
|
||||
} > "$tmp"
|
||||
|
||||
mv "$tmp" "/run/udev/data/n${ifindex}"
|
||||
@@ -0,0 +1,2 @@
|
||||
[Service]
|
||||
ExecStartPre=/usr/comma/wlan-nm-init.sh
|
||||
Reference in New Issue
Block a user