Skip to content

Commit 3434ee7

Browse files
committed
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 <[email protected]>
1 parent 6e608ec commit 3434ee7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ for DIR in ${DATADIRS}; do
3232
[ "${MNTTYPE}" = "ext4" ] && continue
3333
[ "${MNTTYPE}" = "tmpfs" ] && continue
3434
MNTOPTS="$(echo "${LINE}" | awk '{print $4}')"
35+
if [ "${MNTTYPE}" = "9p" ]; then
36+
# https://github.com/torvalds/linux/blob/v6.6/fs/9p/v9fs.h#L61
37+
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,/')"
38+
fi
3539
# Before mv, unmount filesystems (virtiofs, 9p, etc.) below "${DIR}", otherwise host mounts will be wiped out
3640
# https://github.com/rancher-sandbox/rancher-desktop/issues/6582
3741
umount "${MNTPNT}" || exit 1

0 commit comments

Comments
 (0)