This commit is contained in:
dianjixz
2024-12-13 18:52:13 +08:00
parent 156ae9c747
commit 3db9c355bf
5 changed files with 85 additions and 6 deletions
@@ -6,10 +6,7 @@ start() {
printf 'Starting %s:' "$MODULES"
insmod /lib/modules/4.19.125/extra/esp32_sdio.ko
/sbin/devmem 0x02304084 32 0x00060083
/sbin/devmem 0x02304090 32 0x00060083
/sbin/devmem 0x4801010 32 0x3
/sbin/devmem 0x480100c 32 0x3
sh -c 'sleep 1 ; /sbin/devmem 0x02304084 32 0x00060083 ; /sbin/devmem 0x02304090 32 0x00060083 ; /sbin/devmem 0x4801010 32 0x3 ; /sbin/devmem 0x480100c 32 0x0 ; sleep 1 ; /sbin/devmem 0x480100c 32 0x3 ' &> /dev/null &
echo ' OK'
}
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
MODULES="soc_modules"
load_unload() {
chmod 755 /soc/scripts/auto_load_all_drv.sh
/soc/scripts/auto_load_all_drv.sh
}
start() {
printf 'Starting %s:' "$MODULES"
echo ' OK'
}
stop() {
printf 'Stopping %s: ' "$MODULES"
load_unload unload
echo 'OK'
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit $?
+42
View File
@@ -0,0 +1,42 @@
#!/bin/sh
MODULES="eth_mac"
start() {
printf 'Starting %s:' "$MODULES"
sha256_hash=`/usr/bin/sha256sum /proc/ax_proc/uid`
hex_bytes=${sha256_hash:0:12}
prefix="6e:46:28"
mac1="$prefix:${hex_bytes:0:2}:${hex_bytes:2:2}:${hex_bytes:4:2}"
mac2="$prefix:${hex_bytes:6:2}:${hex_bytes:8:2}:${hex_bytes:10:2}"
mac3="$prefix:${hex_bytes:0:2}:${hex_bytes:2:2}:${hex_bytes:4:2}"
mac4="$prefix:${hex_bytes:6:2}:${hex_bytes:8:2}:${hex_bytes:10:2}"
ip link set dev eth0 address $mac1
echo ' OK'
}
stop() {
printf 'Stopping %s: ' "$MODULES"
echo 'OK'
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit $?
+1 -2
View File
@@ -2,8 +2,7 @@
/usr/local/m5stack/startup-script.sh
/soc/scripts/startup-script.sh
sh -c ". /etc/profile ; /soc/scripts/usb-adb.sh start"
chown root:telnetd /usr/lib/telnetlogin
chmod 4754 /usr/lib/telnetlogin
Binary file not shown.