我有一个 Raspberrypi 4,带有自定义 Yocto 映像和只读根文件系统。作为设置的一部分,我想做:
#/bin/sh
mount -o remount,rw /
timedatectl set-timezone $1
sync
mount -o remount,ro /
我尝试过到处添加同步,甚至添加睡眠,但有时就像挂载命令放弃一样,我得到类似的信息:
root@raspberrypi4:~# for tz in $(timedatectl list-timezones | head); do /var/tz.sh $tz; done
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
Failed to set time zone: Failed to set time zone: Read-only file system
其他时候一切都很好。
另外,我总是可以在命令行上键入命令:
root@raspberrypi4:~# mount -o remount,rw /
root@raspberrypi4:~# timedatectl set-timezone Africa/Accra
root@raspberrypi4:~# mount -o remount,ro /
从未失败。
我缺少什么?