Compare commits

..

No commits in common. "53aa17a9b699be664fc8dac11880763571be6322" and "6ebac5753893be7497601db15623d44eca132eec" have entirely different histories.

13 changed files with 35 additions and 236 deletions

View File

@ -25,4 +25,3 @@ for i in /etc/init.d/S??* ;do
esac
done
/data/bin/e_player &

View File

@ -1 +1 @@
/home/hyx/work/15.6/linuxOS_D21X/target/d211/demo128_nand/image_cfg.json
/home/tzkj/work/code/linuxOS_D21X/target/d211/demo128_nand/image_cfg.json

View File

@ -17,14 +17,6 @@ BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBIFS_MAX_SIZE=0x4000000
BR2_TARGET_ROOTFS_UBIFS_OPTS="-F"
BR2_TARGET_USERFS1=y
BR2_TARGET_USERFS1_NAME="system"
BR2_TARGET_USERFS1_TYPE_UBIFS=y
BR2_TARGET_USERFS1_OVERLAY="target/$(LUBAN_CHIP_NAME)/$(LUBAN_BOARD_NAME)/system"
BR2_TARGET_USERFS2=y
BR2_TARGET_USERFS2_NAME="data"
BR2_TARGET_USERFS2_TYPE_UBIFS=y
BR2_TARGET_USERFS2_OVERLAY="target/$(LUBAN_CHIP_NAME)/$(LUBAN_BOARD_NAME)/data"
BR2_GENERATE_BURNER_IMAGE=y
BR2_GENERATE_IMAGE_AUTO_CALCULATE_SIZE=y
BR2_PACKAGE_OPENSBI_FW_TEXT_BASE=0x47FE0000

View File

@ -63,7 +63,7 @@ set_nand_mtdargs=env delete mtdparts
set_nand_bootargs=run set_nand_mtdargs; \
run set_commonargs; \
setenv bootargs ${bootargs} mtdparts=${MTD} ubi.mtd=${ubi_rootfs_mtd} ubi.mtd=11 root=${nand_root} rootfstype=${nand_rootfstype}
setenv bootargs ${bootargs} mtdparts=${MTD} ubi.mtd=${ubi_rootfs_mtd} root=${nand_root} rootfstype=${nand_rootfstype}
set_nand_bootargs_recovery=run set_nand_mtdargs; \
run set_commonargs_recovery; \

View File

@ -13,7 +13,7 @@
"kernel": { "size": "12m" },
"recovery": { "size": "16m" },
"ubiroot": {
"size": "64m",
"size": "218m",
"ubi": { // Volume in UBI device
"rootfs": { "size": "-" },
},
@ -21,8 +21,7 @@
"ubisystem": {
"size": "-",
"ubi": { // Volume in UBI device
"system": { "size": "8m" },
"data": { "size": "-" },
"user": { "size": "-" },
},
},
}
@ -104,15 +103,10 @@
"attr": ["ubi", "required"],
"part": ["ubiroot:rootfs"]
},
"system": {
"file": "system*.ubifs",
"app": {
"file": "user*.ubifs",
"attr": ["ubi", "optional"],
"part": ["ubisystem:system"]
},
"data": {
"file": "data*.ubifs",
"attr": ["ubi", "optional"],
"part": ["ubisystem:data"]
"part": ["ubisystem:user"]
},
},
},

View File

@ -1,11 +0,0 @@
# <file system> <mount pt> <type> <options> <dump> <pass>
/dev/root / ext2 rw,noauto 0 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults,gid=5,mode=620,ptmxmode=0666 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs mode=1777 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
ubi1:system /system ubifs ro,defaults 0 0
ubi1:data /data ubifs defaults 0 0

View File

@ -1,55 +0,0 @@
#!/bin/sh
#
# Auto-create and mount UBI volumes for system and data partitions
#
start() {
echo "Initializing UBI volumes..."
# Check if ubi1 device exists
if [ ! -e /dev/ubi1 ]; then
echo "ubi1 device not found, skipping..."
return 0
fi
# Create mount points
mkdir -p /system /data
# Mount system (read-only)
if ! mountpoint -q /system; then
echo "Mounting /system..."
mount -t ubifs -o ro ubi1:system /system 2>/dev/null || echo "Failed to mount /system"
fi
# Mount data (read-write)
if ! mountpoint -q /data; then
echo "Mounting /data..."
mount -t ubifs ubi1:data /data 2>/dev/null || echo "Failed to mount /data"
fi
echo "UBI volumes initialized"
}
stop() {
echo "Unmounting UBI volumes..."
umount /data 2>/dev/null
umount /system 2>/dev/null
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

View File

@ -0,0 +1,28 @@
#!/bin/sh
# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
for i in /etc/init.d/S??* ;do
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
/usr/bin/e_player &

View File

@ -1,42 +0,0 @@
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/sbin/swapon -a
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS
# e_player monitor and auto-restart
::respawn:/usr/bin/e_player_wrapper
::sysinit:/bin/cat /etc/issue # Put a getty on the serial port
console::respawn:-/bin/sh # GENERIC_SERIAL
# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r

Binary file not shown.

View File

@ -1,106 +0,0 @@
#!/bin/sh
# e_player 崩溃监控和恢复脚本
CRASH_COUNT_FILE="/data/.e_player_crash_count"
STABLE_COUNT_FILE="/data/.e_player_stable_count"
MAX_CRASH=5
CHECK_INTERVAL=1
STABLE_CHECKS=120 # 连续检测120s 进程存在才认为稳定
if [ ! -f "$CRASH_COUNT_FILE" ]; then
echo 0 > "$CRASH_COUNT_FILE"
fi
if [ ! -f "$STABLE_COUNT_FILE" ]; then
echo 0 > "$STABLE_COUNT_FILE"
fi
echo "$(date): e_player_wrapper starting, waiting for e_player..." >> /data/crash.log
WAIT_COUNT=0
while [ $WAIT_COUNT -lt 20 ]; do
if ps | grep -v grep | grep -v e_player_wrapper | grep e_player > /dev/null; then
echo "$(date): e_player detected after ${WAIT_COUNT} checks, starting monitoring..." >> /data/crash.log
break
fi
sleep 3
WAIT_COUNT=$((WAIT_COUNT + 1))
done
if ! ps | grep -v grep | grep -v e_player_wrapper | grep e_player > /dev/null; then
echo "$(date): WARNING - e_player not found after 60s, will monitor anyway..." >> /data/crash.log
fi
echo "$(date): Starting main monitoring loop..." >> /data/crash.log
HEARTBEAT=0
while true; do
HEARTBEAT=$((HEARTBEAT + 1))
if [ $HEARTBEAT -ge 120 ]; then
echo "$(date): [Heartbeat] Monitoring active, stable_count=$(cat $STABLE_COUNT_FILE)" >> /data/crash.log
HEARTBEAT=0
fi
if ! ps | grep -v grep | grep -v e_player_wrapper | grep e_player > /dev/null; then
# 进程不存在,崩溃了
echo 0 > "$STABLE_COUNT_FILE" # 重置稳定计数
COUNT=$(cat "$CRASH_COUNT_FILE")
COUNT=$((COUNT + 1))
echo $COUNT > "$CRASH_COUNT_FILE"
echo "$(date): e_player crashed, count: $COUNT" >> /data/crash.log
if [ $COUNT -ge $MAX_CRASH ]; then
echo "$(date): Crash count exceeded $MAX_CRASH, restoring from factory..." >> /data/crash.log
# 从factory恢复bin文件
if [ -f /system/factory/bin/e_player ]; then
cp /system/factory/bin/e_player /data/bin/e_player
chmod +x /data/bin/e_player
echo "$(date): Restored e_player from factory" >> /data/crash.log
fi
if [ -f /system/factory/bin/lbh_client ]; then
cp /system/factory/bin/lbh_client /data/bin/lbh_client
chmod +x /data/bin/lbh_client
echo "$(date): Restored lbh_client from factory" >> /data/crash.log
fi
# 恢复配置文件
if [ -f /system/factory/system_properties.cfg ]; then
cp /system/factory/system_properties.cfg /data/system_properties.cfg
echo "$(date): Restored system_properties.cfg from factory" >> /data/crash.log
fi
# 重置崩溃计数,重新开始
echo 0 > "$CRASH_COUNT_FILE"
echo "$(date): Reset crash count, retrying..." >> /data/crash.log
fi
echo "$(date): Restarting e_player..." >> /data/crash.log
killall -9 e_player 2>/dev/null
sleep 1
export LD_LIBRARY_PATH=/data/bin/libs:/vendor/qua/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
cd /data
/data/bin/e_player &
sleep 3
else
# 进程存在,累加稳定计数
STABLE=$(cat "$STABLE_COUNT_FILE")
STABLE=$((STABLE + 1))
echo $STABLE > "$STABLE_COUNT_FILE"
# 如果稳定运行120秒重置崩溃计数
if [ $STABLE -ge $STABLE_CHECKS ]; then
COUNT=$(cat "$CRASH_COUNT_FILE")
if [ $COUNT -gt 0 ]; then
echo "$(date): e_player stable, resetting crash count" >> /data/crash.log
echo 0 > "$CRASH_COUNT_FILE"
fi
echo 0 > "$STABLE_COUNT_FILE" # 重置稳定计数,下次再累计
fi
fi
sleep $CHECK_INTERVAL
done