From 96abf38c78a28d06a15556d68fea7f1b8b4f4ace Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sat, 13 Feb 2010 15:35:59 -0600 Subject: [PATCH] Patch etc/rc.d/zfs to mount a tmpfs over /zfs if / is read-only, for holding zfs mounts --- patch/etc_rc.d_zfs-tmpfs-mountpoint.patch | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 patch/etc_rc.d_zfs-tmpfs-mountpoint.patch diff --git a/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch b/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch new file mode 100644 index 0000000..ff01ae6 --- /dev/null +++ b/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch @@ -0,0 +1,30 @@ +--- etc/rc.d/zfs 2010-01-25 06:27:11.000000000 +0000 ++++ etc/rc.d/zfs 2009-04-12 16:59:35.000000000 +0000 +@@ -23,6 +23,14 @@ + + zfs_start_main() + { ++ # If root is read-only, mount a tmpfs on /zfs to provide ++ # a writable mountpoint, if not already ++ if [ -d /zfs ] && mount | grep ' on / ' | grep -q 'read-only' && \ ++ ! mount | grep -q ' on /zfs (tmpfs' ++ then ++ mount -t tmpfs -o size=65536 tmpfs /zfs ++ fi ++ + zfs mount -a + zfs share -a + if [ ! -r /etc/zfs/exports ]; then +@@ -50,6 +58,12 @@ + { + zfs unshare -a + zfs unmount -a ++ ++ # If /zfs is a tmpfs, unmount it ++ if mount | grep -q ' on /zfs (tmpfs' ++ then ++ umount -f /zfs ++ fi + } + + zfs_stop() -- 2.42.0