From 3434ee72a80ddbd307fccb21e31b735b1aab66a7 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 2 Jul 2024 13:29:17 +0900 Subject: [PATCH] boot/04-persistent-data-volume.sh: fix 9p cache options `mount=fscache` is printed as `mount=8f` in /proc/mounts https://github.com/torvalds/linux/blob/v6.6/fs/9p/v9fs.h#L61 Signed-off-by: Akihiro Suda --- .../cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh b/pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh index 072eb8a29135..423538f3d837 100644 --- a/pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh +++ b/pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh @@ -32,6 +32,10 @@ for DIR in ${DATADIRS}; do [ "${MNTTYPE}" = "ext4" ] && continue [ "${MNTTYPE}" = "tmpfs" ] && continue MNTOPTS="$(echo "${LINE}" | awk '{print $4}')" + if [ "${MNTTYPE}" = "9p" ]; then + # https://github.com/torvalds/linux/blob/v6.6/fs/9p/v9fs.h#L61 + MNTOPTS="$(echo "${MNTOPTS}" | sed -e 's/cache=8f,/cache=fscache,/; s/cache=f,/cache=loose,/; s/cache=5,/cache=mmap,/; s/cache=1,/cache=readahead,/; s/cache=0,/cache=none,/')" + fi # Before mv, unmount filesystems (virtiofs, 9p, etc.) below "${DIR}", otherwise host mounts will be wiped out # https://github.com/rancher-sandbox/rancher-desktop/issues/6582 umount "${MNTPNT}" || exit 1