Automatically try to mount configfs
authorUlrich Dangel <mru@grml.org>
Tue, 20 Dec 2011 23:47:56 +0000 (00:47 +0100)
committerUlrich Dangel <mru@grml.org>
Wed, 21 Dec 2011 00:15:43 +0000 (01:15 +0100)
autoconfig
autoconfig.functions
grml-autoconfig

index 620d9d2..5e9b10c 100644 (file)
@@ -51,6 +51,7 @@ CONFIG_AUTOMOUNT='yes'        # automounting of device labeled GRMLCFG
 CONFIG_BLANKING='yes'         # check for bootoption noblank to disable console blanking
 CONFIG_CONFIG='yes'           # do we want config unpacking to work?
 CONFIG_CONSOLE='yes'          # activate mgetty when using console=... as bootparam
+CONFIG_CONFIGFS='yes'         # automatically mount configfs
 CONFIG_DEBOOTSTRAP='yes'      # support automatic installation of Debian via grml-deboostrap
 CONFIG_DEBNET='yes'           # search for /etc/network/interfaces on partitions and set up network afterwards
 CONFIG_DEBS='yes'             # check for bootoption debs for installing .debs
index e133004..d166998 100755 (executable)
@@ -399,6 +399,23 @@ config_userfstab(){
 }
 # }}}
 
+# {{{ mount configfs
+config_configfs() {
+  einfo "Mounting configfs"
+  CONFIGFS_DIR=/sys/kernel/config/
+  modprobe configfs 2>/dev/null 1>&2
+  if ! [  -d "$CONFIGFS_DIR" ] ; then
+    eindent
+    einfo "$CONFIGFS_DIR does not exist, can't mount directory"
+    eend 1
+    eoutdent
+  else
+    mount -t configfs configfs "$CONFIGFS_DIR" 2>/dev/null 1>&2
+    eend $?
+  fi
+}
+# }}}
+
 # {{{ Set clock (Local time is more often used than GMT, so it is default)
 config_time(){
  # don't touch the files if running from harddisk:
index c561418..4e69dbb 100755 (executable)
@@ -95,6 +95,8 @@ checkvalue $CONFIG_HOSTNAME && config_hostname
 
 checkvalue $CONFIG_USERFSTAB && config_userfstab
 
+checkvalue $CONFIG_CONFIGFS && config_configfs
+
 checkvalue $CONFIG_TIME && config_time
 
 checkvalue $CONFIG_KERNEL &&  config_kernel