【问题标题】:Buildroot with readonly filesystem: allow writing on /etcBuildroot 与只读文件系统:允许在 /etc 上写入
【发布时间】:2018-08-12 04:44:41
【问题描述】:

我正在准备一个基于 Orange PI Zero 的 Buildroot IoT 项目,因此我将其设为只读系统。无论如何,当用户为他的 WiFi 网络配置 wpa_supplicant.conf 时,我需要在 /etc 上持续写入以更新它。如果用户愿意,我还需要使用一些配置参数更新自定义文本文件。

我想避免每次需要更新单个文件时都以 r/w 方式重新挂载整个文件系统。

实现这一点的最佳方法是什么?

【问题讨论】:

    标签: embedded-linux iot buildroot orange-pi


    【解决方案1】:

    您可以在 /etc 之上设置一个可写覆盖,以便进行更改。选项要么是内核中的 overlayfs,要么是使用 fuse 的 unionfs。由于 init / initscripts 已经使用 /etc,您可能需要在 init 周围创建一个包装脚本,以在执行 init 之前设置此覆盖。 - 例如类似:

    mount -t proc proc /proc
    mount /mnt/data
    mount -o bind /etc/ /mnt/rom-etc
    unionfs -o cow,allow_other,use_ino,nonempty \
            mnt/data=RW:/mnt/rom-etc=RO /etc/
    exec /sbin/init $*
    

    【讨论】:

      猜你喜欢
      • 2022-07-02
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      • 2019-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多