feat: 开放小爱音箱补丁固件构建源代码和教程

This commit is contained in:
Del Wang
2025-04-12 23:49:07 +08:00
parent 0585ddab72
commit 2cf6623db9
21 changed files with 1794 additions and 0 deletions
@@ -0,0 +1,48 @@
--- squashfs-root/etc/init.d/dropbear 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/init.d/dropbear 2025-02-13 21:19:31
@@ -53,8 +53,7 @@
MaxAuthTries mdns ipaddrs
validate_section_dropbear "${1}" || {
- echo "validation failed"
- return 1
+ echo "validation failed and skip"
}
[ -n "${Interface}" ] && {
@@ -64,7 +63,6 @@
}
}
- [ "${enable}" = "0" ] && return 1
PIDCOUNT="$(( ${PIDCOUNT} + 1))"
local pid_file="/var/run/${NAME}.${PIDCOUNT}.pid"
@@ -111,25 +109,12 @@
load_interfaces()
{
config_get interface "$1" Interface
- config_get enable "$1" enable 1
-
- [ "${enable}" = "1" ] && interfaces=" ${interface} ${interfaces}"
+ interfaces=" ${interface} ${interfaces}"
}
start_service()
{
- [ x"bluetooth" == x`micocfg_work_mode` ] && {
- logger -t dropbear.init.d -p 3 "in bluetooth mode, will not start"
- return
- }
-
- ssh_en=`cat /data/ssh_en 2>/dev/null`
- ssh_en_bind=`cat /data/.ssh_en 2>/dev/null`
- ssh_en_tmp=`cat /tmp/ssh_en 2>/dev/null`
- channel=`micocfg_channel 2>/dev/null`
- if [ "$ssh_en" != "1" -a "$ssh_en_bind" != "1" -a "$ssh_en_tmp" != "1" -a "$channel" = "release" ]; then
- return 0
- fi
+ mkdir -p /data/etc/dropbear
[ -s /data/etc/dropbear/dropbear_rsa_host_key ] || keygen
. /lib/functions.sh
@@ -0,0 +1,35 @@
--- squashfs-root/etc/shadow 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/shadow 2025-02-13 21:07:41
@@ -1,4 +1,4 @@
-root:$1$N0Iz0LLs$kZ5zG/Y2AUWHNE5I3ElWm1:18128:0:99999:7:::
+root:{SSH_PASSWORD}:18128:0:99999:7:::
daemon:*:0:0:99999:7:::
ftp:*:0:0:99999:7:::
network:*:0:0:99999:7:::
diff --color -Naur squashfs-root/etc/inittab squashfs-root-patched/etc/inittab
--- squashfs-root/etc/inittab 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/inittab 2025-02-13 20:56:13
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
tts/0::askfirst:/bin/ash --login
-ttyS0::askfirst:/bin/login
+ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
diff --color -Naur squashfs-root/etc/pam.d/common-auth squashfs-root-patched/etc/pam.d/common-auth
--- squashfs-root/etc/pam.d/common-auth 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/pam.d/common-auth 2025-02-13 21:09:02
@@ -8,10 +8,10 @@
# traditional Unix authentication mechanisms.
#
-auth sufficient libmico-pam.so
-account sufficient libmico-pam.so
+# auth sufficient libmico-pam.so
+# account sufficient libmico-pam.so
# here are the per-package modules (the "Primary" block)
-# auth [success=1 default=ignore] pam_unix.so nullok_secure
+auth [success=1 default=ignore] pam_unix.so nullok_secure
# here's the fallback if no module succeeds
auth requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
@@ -0,0 +1,46 @@
--- squashfs-root/bin/ota 2024-12-06 15:11:58
+++ squashfs-root-patched/bin/ota 2025-02-13 21:50:40
@@ -133,6 +133,9 @@
download_upgrade() {
+ logger -t ota -p 3 "download upgrade failed"
+ return 1
+
if [ -f $OTA_FILE ]; then
logger -t ota -p 3 "ota is in progress now, exit this one."
exit 1
@@ -278,6 +281,9 @@
}
upgrade() {
+ logger -t ota -p 3 "no upgrade"
+ return 1
+
if [ -z "$1" -o -z "$2" ]; then
upgrade_failed
return 1
--- squashfs-root/bin/flash.sh 2024-12-06 15:11:58
+++ squashfs-root-patched/bin/flash.sh 2025-02-18 23:21:57
@@ -5,6 +5,9 @@
. /bin/boardupgrade.sh
upgrade_param_check() {
+ klogger "no upgrade"
+ return 1
+
if [ -z "$1" -o ! -f "$1" ]; then
klogger "USAGE: $0 input.bin [1: slient] [1:don't reboot]"
return 1
--- squashfs-root/etc/init.d/wireless 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/init.d/wireless 2025-02-18 23:15:31
@@ -1361,6 +1361,9 @@
password=$3
identity=$4
+ echo "download_fail"
+ exit 3;
+
trylock "ota"
[ $? != 0 ] && {
# shut_led 10
@@ -0,0 +1,9 @@
--- squashfs-root/etc/rc.local 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/rc.local 2025-02-13 22:06:13
@@ -1,4 +1,6 @@
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
+[ -f "/data/init.sh" ] && /data/init.sh &
+
exit 0
@@ -0,0 +1,33 @@
--- squashfs-root/etc/asound.conf 2024-12-06 15:11:58
+++ squashfs-root-patched/etc/asound.conf 2025-02-18 22:14:10
@@ -125,16 +125,20 @@
}
pcm.noop {
- type dsnoop
- ipc_key 1024
- slave {
- pcm "hw:0,3"
- format S32_LE
- rate 48000
- channels 8
- period_size 480
- buffer_size 3840
- }
+ type plug
+ slave.pcm {
+ type dsnoop
+ ipc_key 1024
+ ipc_perm 0666
+ slave {
+ pcm "hw:0,3"
+ format S32_LE
+ rate 48000
+ channels 8
+ period_size 480
+ buffer_size 3840
+ }
+ }
}
defaults.pcm.rate_converter "speexrate_medium"
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
# 动态获取偏移量
OFFSET=$(strings -t d usr/lib/libxaudio_engine.so | grep hw:0,3 | awk '{print $1}')
# 检查偏移量是否存在
if [ -z "$OFFSET" ]; then
echo "未找到 \"hw:0,3\" 字符串偏移量,取消 patch usr/lib/libxaudio_engine.so"
exit -1
fi
echo -n -e "noop\x00\x00" | dd of=usr/lib/libxaudio_engine.so bs=1 count=6 seek=$OFFSET conv=notrunc
echo "patched file usr/lib/libxaudio_engine.so"