修改grub参数为rw后,usr目录变成只读问题修改

This commit is contained in:
liushanwen 2024-09-13 16:05:42 +08:00
parent d48f59c2d8
commit 87831fc3e2
2 changed files with 11 additions and 0 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
initramfs-tools (0.142kylin13.1.9test3) nile; urgency=medium
* 修改grub参数为rw后usr目录变成可读写了
-- liushanwen <liushanwen@kylinos.cn> Fri, 13 Sep 2024 16:04:13 +0800
initramfs-tools (0.142kylin13.1.9test1) nile; urgency=medium initramfs-tools (0.142kylin13.1.9test1) nile; urgency=medium
* 添加overlayfs文件系统驱动 * 添加overlayfs文件系统驱动

View File

@ -222,8 +222,13 @@ local_mount_root()
mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "/tmproot" mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "/tmproot"
root_real_path=$(readlink -f "/tmproot${OSTREEROOT}") root_real_path=$(readlink -f "/tmproot${OSTREEROOT}")
mount -o bind "${root_real_path}" "${rootmnt?}" mount -o bind "${root_real_path}" "${rootmnt?}"
mount -o ro,bind "${rootmnt?}/usr" "${rootmnt?}/usr"
mount -o ro,bind,remount "${rootmnt?}/usr" "${rootmnt?}/usr" mount -o ro,bind,remount "${rootmnt?}/usr" "${rootmnt?}/usr"
mount -o ro,bind "/tmproot" "${rootmnt?}/sysroot" mount -o ro,bind "/tmproot" "${rootmnt?}/sysroot"
mount -o ro,bind,remount "/tmproot" "${rootmnt?}/sysroot"
mount -o rw,bind "/tmproot/var" "${rootmnt?}/var" mount -o rw,bind "/tmproot/var" "${rootmnt?}/var"
mount -o rw,bind "/tmproot/var" "${rootmnt?}/sysroot/ostree/deploy/openkylin/var" mount -o rw,bind "/tmproot/var" "${rootmnt?}/sysroot/ostree/deploy/openkylin/var"
fi fi