]> CyberLeo.Net >> Repos - CDN/Mosi.git/blob - targets/amd64/H340/config/patch/etc_rc.d_zfs-tmpfs-mountpoint.patch
targets/amd64/H340: new target for Acer Aspire EasyStore H340 NAS brick
[CDN/Mosi.git] / targets / amd64 / H340 / config / patch / etc_rc.d_zfs-tmpfs-mountpoint.patch
1 --- etc/rc.d/zfs        2010-01-25 06:27:11.000000000 +0000
2 +++ etc/rc.d/zfs        2009-04-12 16:59:35.000000000 +0000
3 @@ -23,6 +23,14 @@
4  
5  zfs_start_main()
6  {
7 +       # If root is read-only, mount a tmpfs on /zfs to provide
8 +       #  a writable mountpoint, if not already
9 +       if [ -d /zfs ] && mount | grep ' on / ' | grep -q 'read-only' && \
10 +         ! mount | grep -q ' on /zfs (tmpfs'
11 +       then
12 +               mount -t tmpfs -o size=65536 tmpfs /zfs
13 +       fi
14 +       
15         zfs mount -a
16         zfs share -a
17         if [ ! -r /etc/zfs/exports ]; then
18 @@ -50,6 +58,12 @@
19  {
20         zfs unshare -a
21         zfs unmount -a
22 +
23 +       # If /zfs is a tmpfs, unmount it
24 +       if mount | grep -q ' on /zfs (tmpfs'
25 +       then
26 +               umount -f /zfs
27 +       fi
28  }
29  
30  zfs_stop()