OSDN Git Service

Update to lfsbook 7.2.ja
[linuxjf/JF.git] / docs / LFS-BOOK / scripts / apds04.html
index 38235f7..7d95aba 100644 (file)
@@ -4,27 +4,27 @@
   <head>
     <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
     <title>
-      D.4. /etc/rc.d/init.d/consolelog
+      D.4. /etc/rc.d/init.d/mountvirtfs
     </title>
     <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
     <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
     <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
     "text/css" media="print" />
   </head>
-  <body class="lfs" id="lfs-6.8">
+  <body class="lfs" id="lfs-7.2">
     <div class="navheader">
       <h4>
-        Linux From Scratch - Version 6.8
+        Linux From Scratch - Version 7.2
       </h4>
       <h3>
-        付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
+        付録 D. ブートスクリプトと sysconfig スクリプト version-20120901
       </h3>
       <ul>
         <li class="prev">
           <a accesskey="p" href="apds03.html" title=
-          "/etc/rc.d/init.d/mountkernfs">前のページ</a>
+          "/etc/rc.d/init.d/functions">前のページ</a>
           <p>
-            /etc/rc.d/init.d/mountkernfs
+            /etc/rc.d/init.d/functions
           </p>
         </li>
         <li class="next">
         </li>
         <li class="up">
           <a accesskey="u" href="scripts.html" title=
-          "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
+          "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
         </li>
         <li class="home">
           <a accesskey="h" href="../index.html" title=
-          "Linux From Scratch - Version 6.8">ホーム</a>
+          "Linux From Scratch - Version 7.2">ホーム</a>
         </li>
       </ul>
     </div>
     <div class="wrap" lang="ja" xml:lang="ja">
       <h1 class="sect1">
-        <a id="consolelog" name="consolelog"></a>D.4.
-        /etc/rc.d/init.d/consolelog
+        <a id="mountvirtfs" name="mountvirtfs"></a>D.4.
+        /etc/rc.d/init.d/mountvirtfs
       </h1>
       <pre class="screen">
 #!/bin/sh
-# Begin $rc_base/init.d/consolelog
-
 ########################################################################
+# Begin mountvirtfs
 #
-# Description : Set the kernel log level for the console
-#
-# Authors     : Dan Nicholson - dnicholson@linuxfromscratch.org
+# Description : Mount proc, sysfs, and run
 #
-# Version     : 00.00
+# Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
+#               DJ Lucas - dj@linuxfromscratch.org
+# Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
 #
-# Notes       : /proc must be mounted before this can run
+# Version     : LFS 7.0
 #
 ########################################################################
 
-. /etc/sysconfig/rc
-. ${rc_functions}
+### BEGIN INIT INFO
+# Provides:            mountvirtfs
+# Required-Start:
+# Should-Start:
+# Required-Stop:
+# Should-Stop:
+# Default-Start:       S
+# Default-Stop:
+# Short-Description:   Mounts /sys and /proc virtual (kernel) filesystems.
+#                      Mounts /run (tmpfs) and /dev (devtmpfs).
+# Description:         Mounts /sys and /proc virtual (kernel) filesystems.
+#                      Mounts /run (tmpfs) and /dev (devtmpfs).
+# X-LFS-Provided-By:   LFS
+### END INIT INFO
 
-# set the default loglevel
-LOGLEVEL=7
-if [ -r /etc/sysconfig/console ]; then
-    . /etc/sysconfig/console
-fi
+. /lib/lsb/init-functions
 
 case "${1}" in
-    start)
-        case "$LOGLEVEL" in
-        [1-8])
-            boot_mesg "Setting the console log level to ${LOGLEVEL}..."
-            dmesg -n $LOGLEVEL
-            evaluate_retval
-            ;;
-        *)
-            boot_mesg "Console log level '${LOGLEVEL}' is invalid" ${FAILURE}
-            echo_failure
-            ;;
-        esac
-        ;;
-    status)
-        # Read the current value if possible
-        if [ -r /proc/sys/kernel/printk ]; then
-            read level line &lt; /proc/sys/kernel/printk
-        else
-            boot_mesg "Can't read the current console log level" ${FAILURE}
-            echo_failure
-        fi
+   start)
+      # Make sure /run/var is available before logging any messages
+      if ! mountpoint /run &gt;/dev/null; then
+         mount -n /run || failed=1
+      fi
+
+      mkdir -p /run/var /run/lock /run/shm
+      chmod 1777 /run/shm
+
+      log_info_msg "Mounting virtual file systems: ${INFO}/run" 
+
+      if ! mountpoint /proc &gt;/dev/null; then
+         log_info_msg2 " ${INFO}/proc"
+         mount -n -o nosuid,noexec,nodev /proc || failed=1
+      fi
+
+      if ! mountpoint /sys &gt;/dev/null; then
+         log_info_msg2 " ${INFO}/sys" 
+         mount -n -o nosuid,noexec,nodev /sys || failed=1
+      fi
+
+      if ! mountpoint /dev &gt;/dev/null; then
+         log_info_msg2 " ${INFO}/dev" 
+         mount -n -o mode=0755,nosuid /dev  || failed=1
+      fi
+
+      # Copy devices that Udev &gt;= 155 doesn't handle to /dev
+      cp -a /lib/udev/devices/* /dev
 
-        # Print the value
-        if [ -n "$level" ]; then
-            ${ECHO} -e "${INFO}The current console log level" \
-                "is ${level}${NORMAL}"
-        fi
-        ;;
+      ln -sfn /run/shm /dev/shm
+      
+      (exit ${failed})
+      evaluate_retval
+      exit $failed
+      ;;
 
-    *)
-        echo "Usage: ${0} {start|status}"
-        exit 1
-        ;;
+   *)
+      echo "Usage: ${0} {start}"
+      exit 1
+      ;;
 esac
 
-# End $rc_base/init.d/consolelog
+# End mountvirtfs
 </pre>
     </div>
     <div class="navfooter">
       <ul>
         <li class="prev">
           <a accesskey="p" href="apds03.html" title=
-          "/etc/rc.d/init.d/mountkernfs">前のページ</a>
+          "/etc/rc.d/init.d/functions">前のページ</a>
           <p>
-            /etc/rc.d/init.d/mountkernfs
+            /etc/rc.d/init.d/functions
           </p>
         </li>
         <li class="next">
@@ -131,11 +145,11 @@ esac
         </li>
         <li class="up">
           <a accesskey="u" href="scripts.html" title=
-          "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
+          "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
         </li>
         <li class="home">
           <a accesskey="h" href="../index.html" title=
-          "Linux From Scratch - Version 6.8">ホーム</a>
+          "Linux From Scratch - Version 7.2">ホーム</a>
         </li>
       </ul>
     </div>