usrmount: do not install, if /sbin/init does not live in /usr
authorHarald Hoyer <harald@redhat.com>
Wed, 24 Jul 2013 11:41:15 +0000 (13:41 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 24 Jul 2013 11:41:57 +0000 (13:41 +0200)
modules.d/98usrmount/module-setup.sh

index 5d81d15..a668069 100755 (executable)
@@ -3,7 +3,10 @@
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
 check() {
+    local _init
     [[ $mount_needs ]] && return 1
+    _init=$(readlink -f /sbin/init)
+    [[ "$init" == "${init##/usr}" ]] && return 255
     return 0
 }