Package: dracut / 040+1-1

aufs Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- /dev/null
+++ b/modules.d/90aufs/aufs-mount.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# make a read-only nfsroot writeable by using aufs
+# the nfsroot is already mounted to $NEWROOT
+# add the parameter aufs to the kernel, to activate this feature
+
+. /lib/dracut-lib.sh
+
+aufs=$(getargs aufs)
+
+if [ -z "$aufs" ] ; then
+    return
+fi
+
+modprobe aufs
+
+# a little bit tuning
+mount -o remount,nolock,noatime $NEWROOT
+
+mkdir -p /live/image
+mount --move $NEWROOT /live/image
+
+mkdir /cow
+mount -n -t tmpfs -o mode=0755 tmpfs /cow
+
+mount -t aufs -o noatime,noxino,dirs=/cow=rw:/live/image=rr aufs $NEWROOT
+
+mkdir -p $NEWROOT/live/cow
+mkdir -p $NEWROOT/live/image
+mount --move /cow $NEWROOT/live/cow
+mount --move /live/image $NEWROOT/live/image
--- /dev/null
+++ b/modules.d/90aufs/module-setup.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+depends() {
+    # We depend on nfs modules being loaded
+    echo nfs
+    return 0
+}
+
+install() {
+
+    inst_hook pre-pivot 10 "$moddir/aufs-mount.sh"
+}