summaryrefslogtreecommitdiffstats
path: root/src/initramfs
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-05-25 21:15:04 +0200
committerSebastian Schmelzer2011-05-25 21:15:04 +0200
commit5daabcd9e65920911dc906d62ed3e40f7fd6132d (patch)
tree5835dd90f6f766c75329f2b9fdbdc20b1ede572d /src/initramfs
parentfix typo (diff)
downloadcore-5daabcd9e65920911dc906d62ed3e40f7fd6132d.tar.gz
core-5daabcd9e65920911dc906d62ed3e40f7fd6132d.tar.xz
core-5daabcd9e65920911dc906d62ed3e40f7fd6132d.zip
test union detection ..
Diffstat (limited to 'src/initramfs')
-rwxr-xr-xsrc/initramfs/scripts/init44
1 files changed, 34 insertions, 10 deletions
diff --git a/src/initramfs/scripts/init b/src/initramfs/scripts/init
index f778125d..a680a4c5 100755
--- a/src/initramfs/scripts/init
+++ b/src/initramfs/scripts/init
@@ -722,16 +722,40 @@ runinithook '40-started-hw-config'
# unionfs/aufs modules visible by now if installed or directly compiled into
# the kernel, try to use aufs for rw access if available
union_type=""
-if [ ${aufs} -eq 1 ] && grep -q aufs /proc/filesystems || \
- { modprobe ${MODPRV} aufs 2>/dev/null && \
- lsmod | grep -qe "^aufs" ; } ; then union_type="AUFS"
-elif [ ${unionfs} -eq 1 ] && grep -q unionfs /proc/filesystems || \
- { modprobe ${MODPRV} unionfs 2>/dev/null && \
- lsmod | grep -qe "^unionfs" ; } ; then union_type="UnionFS"
-elif [ "x${fuse}" != "x" ] && grep -q fuse /proc/filesystems || \
- { modprobe ${MODPRV} fuse 2>/dev/null && \
- lsmod | grep -qe "^fuse" ; } ; then union_type="Fuse"
-elif [ ${aufs} -eq 0 -a ${unionfs} -eq 0 -a -z "${cowloop}" ] ; then
+if [ ${aufs} -eq 1 ]; then
+ aufs_in_kernel=$(grep -c aufs /proc/filesystems)
+ if [ ${aufs_in_kernel} -ne 0 ]; then
+ modprobe ${MODPRV} aufs 2>/dev/null
+ aufs_have_module=$(lsmod | grep -qe "^aufs")
+ [ $(aufs_have_module) -ne 0 ] && union_type="AUFS"
+ else
+ union_type="AUFS"
+ fi
+fi
+
+if [ ${unionfs} -eq 1 ]; then
+ unionfs_in_kernel=$(grep -c unionfs /proc/filesystems)
+ if [ ${unionfs_in_kernel} -ne 0 ]; then
+ modprobe ${MODPRV} unionfs 2>/dev/null
+ unionfs_have_module=$(lsmod | grep -qe "^unionfs")
+ [ $(unionfs_have_module) -ne 0 ] && union_type="UnionFS"
+ else
+ union_type="UnionFS"
+ fi
+fi
+
+if [ ${fuse} -eq 1 ]; then
+ fuse_in_kernel=$(grep -c fuse /proc/filesystems)
+ if [ ${fuse_in_kernel} -ne 0 ]; then
+ modprobe ${MODPRV} fuse 2>/dev/null
+ fuse_have_module=$(lsmod | grep -qe "^fuse")
+ [ $(fuse_have_module) -ne 0 ] && union_type="Fuse"
+ else
+ union_type="Fuse"
+ fi
+fi
+
+if [ ${aufs} -eq 0 -a ${unionfs} -eq 0 -a -z "${cowloop}" ] ; then
error "$init_deselau" nonfatal
unset aufs unionfs
else