配置overlay(overlayfs)根目录挂载构建deb
发布时间:2020-02-27 09:47:21
来源:51CTO
阅读:9628
作者:btvnlue
据wikipedia描述overlayfs在2014年融入linux内核,其轻量和易用特性已在openwrt中应用,但在debian发行版本中还没有直接使用overlayfs挂载根目录的启动选项。增加启动选项需对启动initrd进行相应改造,debian的initrt脚本已经预留了应用接口,使得应用overlayfs和无盘(或简盘)工作变得相对简单。
构建无盘工作站使用
TFTP+PXE启动服务器 <=== QEMU客户端
进行改造和测试
因需要在已安装系统中改造initrd,首先分析mkinitramfs脚本,可以得到启动脚本模板init使用的是/usr/share/initramfs-tools/init,进而分析该init脚本。
init脚本中挂载根目录片段:
:log_begin_msg "Mounting root file system"
# Always load local and nfs (since these might be needed for /etc or
# /usr, irrespective of the boot script used to mount the rootfs).
. /scripts/local
. /scripts/nfs
. /scripts/${BOOT}
parse_numeric ${ROOT}
maybe_break mountroot