Skip to content

Commit

Permalink
boot/04-persistent-data-volume.sh: fix 9p cache options
Browse files Browse the repository at this point in the history
`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]>
  • Loading branch information
AkihiroSuda committed Jul 2, 2024
1 parent 6e608ec commit 3434ee7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3434ee7

Please sign in to comment.