feat(i2c): 添加系统状态显示脚本和根文件系统同步脚本

添加selfStatus.py用于在OLED屏幕上显示系统状态信息,包括IP地址、CPU负载、内存使用、磁盘空间和当前时间
添加syncrootfs.sh用于同步根文件系统到/mnt目录,排除特定系统目录
This commit is contained in:
2025-09-07 21:15:08 +08:00
parent ba4adb9516
commit a475b29e03
2 changed files with 140 additions and 0 deletions

36
i2c.py/syncrootfs.sh Normal file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
boot_mnt=`findmnt -n /dev/mmcblk0p1 | awk '{print $1}'`
rsync --force -rltWDEgop --delete --stats --progress \
--exclude ".gvfs" \
--exclude "$boot_mnt" \
--exclude "/dev" \
--exclude "/media" \
--exclude "/mnt" \
--exclude "/proc" \
--exclude "/run" \
--exclude "/snap" \
--exclude "/sys" \
--exclude "/tmp" \
--exclude "lost\+found" \
/ /mnt
if [ ! -d $boot_mnt ]; then
mkdir $boot_mnt
fi
if [ -d /snap ]; then
mkdir /mnt/snap
fi
for i in boot dev media mnt proc run sys boot; do
if [ ! -d /mnt/$i ]; then
mkdir /mnt/$i
fi
done
if [ ! -d /mnt/tmp ]; then
mkdir /mnt/tmp
chmod a+w /mnt/tmp
fi