From 9f318ba306fa33ba0e626d6d3dc0bc24291ee2f0 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 19 Apr 2011 03:26:49 +0000 Subject: Add new /run mount point to top level directories. Mount a tmpfs on /run in bootscripts. Add symlinks to use new /run tmpfs. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9510 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- bootscripts/ChangeLog | 4 +++ bootscripts/Makefile | 8 ++--- bootscripts/contrib/lsb-v3/Makefile | 8 ++--- bootscripts/contrib/lsb-v3/init.d/modules | 2 +- bootscripts/contrib/lsb-v3/init.d/mountfs | 2 ++ bootscripts/contrib/lsb-v3/init.d/mountkernfs | 43 ---------------------- bootscripts/contrib/lsb-v3/init.d/mountvirtfs | 48 +++++++++++++++++++++++++ bootscripts/contrib/lsb-v3/init.d/sysctl | 2 +- bootscripts/lfs/init.d/mountfs | 6 ++++ bootscripts/lfs/init.d/mountkernfs | 44 ----------------------- bootscripts/lfs/init.d/mountvirtfs | 51 +++++++++++++++++++++++++++ 11 files changed, 121 insertions(+), 97 deletions(-) delete mode 100644 bootscripts/contrib/lsb-v3/init.d/mountkernfs create mode 100644 bootscripts/contrib/lsb-v3/init.d/mountvirtfs delete mode 100644 bootscripts/lfs/init.d/mountkernfs create mode 100644 bootscripts/lfs/init.d/mountvirtfs (limited to 'bootscripts') diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index bf7aec7a5..089c5345f 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,7 @@ +2010-05-29 Bruce Dubbs + * lfs/init.d/mountvirtfs: Change name from mountkernfs to mountvirtfs. + Add mounting of /run filesystem. + 2010-05-29 Matt Burgess * lfs/init.d/udev: Only copy /lib/udev/devices/null, as Udev >= 155 copies devices from /lib/udev/devices to /dev itself. Udevd still needs /dev/null diff --git a/bootscripts/Makefile b/bootscripts/Makefile index 85bd722f5..54b8f6562 100644 --- a/bootscripts/Makefile +++ b/bootscripts/Makefile @@ -31,7 +31,7 @@ install: create-dirs create-service-dir install -m ${MODE} lfs/init.d/localnet ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/modules ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/mountfs ${EXTDIR}/rc.d/init.d/ - install -m ${MODE} lfs/init.d/mountkernfs ${EXTDIR}/rc.d/init.d/ + install -m ${MODE} lfs/init.d/mountvirtfs ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/network ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/rc ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/reboot ${EXTDIR}/rc.d/init.d/ @@ -67,7 +67,7 @@ install: create-dirs create-service-dir ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc6.d/S80swap ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rc6.d/S90localnet ln -sf ../init.d/reboot ${EXTDIR}/rc.d/rc6.d/S99reboot - ln -sf ../init.d/mountkernfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountkernfs + ln -sf ../init.d/mountvirtfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountvirtfs ln -sf ../init.d/consolelog ${EXTDIR}/rc.d/rcsysinit.d/S02consolelog ln -sf ../init.d/modules ${EXTDIR}/rc.d/rcsysinit.d/S05modules ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcsysinit.d/S10udev @@ -104,7 +104,7 @@ minimal: create-dirs create-service-dir install -m ${MODE} lfs/init.d/halt ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/localnet ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/mountfs ${EXTDIR}/rc.d/init.d/ - install -m ${MODE} lfs/init.d/mountkernfs ${EXTDIR}/rc.d/init.d/ + install -m ${MODE} lfs/init.d/mountvirtfs ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/rc ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/reboot ${EXTDIR}/rc.d/init.d/ install -m ${MODE} lfs/init.d/sendsignals ${EXTDIR}/rc.d/init.d/ @@ -119,7 +119,7 @@ minimal: create-dirs create-service-dir ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc6.d/S70mountfs ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc6.d/S80swap ln -sf ../init.d/reboot ${EXTDIR}/rc.d/rc6.d/S99reboot - ln -sf ../init.d/mountkernfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountkernfs + ln -sf ../init.d/mountvirtfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountvirtfs ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcsysinit.d/S10udev ln -sf ../init.d/swap ${EXTDIR}/rc.d/rcsysinit.d/S20swap ln -sf ../init.d/checkfs ${EXTDIR}/rc.d/rcsysinit.d/S30checkfs diff --git a/bootscripts/contrib/lsb-v3/Makefile b/bootscripts/contrib/lsb-v3/Makefile index d86c083cb..0d31fb60a 100644 --- a/bootscripts/contrib/lsb-v3/Makefile +++ b/bootscripts/contrib/lsb-v3/Makefile @@ -35,7 +35,7 @@ install: create-dirs create-service-dir create-boottemp-dir install -m ${MODE} init.d/localnet ${EXTDIR}/init.d/ install -m ${MODE} init.d/modules ${EXTDIR}/init.d/ install -m ${MODE} init.d/mountfs ${EXTDIR}/init.d/ - install -m ${MODE} init.d/mountkernfs ${EXTDIR}/init.d/ + install -m ${MODE} init.d/mountvirtfs ${EXTDIR}/init.d/ install -m ${MODE} init.d/network ${EXTDIR}/init.d/ install -m ${MODE} init.d/rc ${EXTDIR}/init.d/ install -m ${MODE} init.d/reboot ${EXTDIR}/init.d/ @@ -67,7 +67,7 @@ install: create-dirs create-service-dir create-boottemp-dir /usr/lib/lsb/install_initd ${EXTDIR}/init.d/localnet /usr/lib/lsb/install_initd ${EXTDIR}/init.d/modules /usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountfs - /usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountkernfs + /usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountvirtfs /usr/lib/lsb/install_initd ${EXTDIR}/init.d/network /usr/lib/lsb/install_initd ${EXTDIR}/init.d/reboot /usr/lib/lsb/install_initd ${EXTDIR}/init.d/sendsignals @@ -85,7 +85,7 @@ minimal: create-dirs create-service-dir create-boottemp-dir install -m ${MODE} init.d/halt ${EXTDIR}/init.d/ install -m ${MODE} init.d/localnet ${EXTDIR}/init.d/ install -m ${MODE} init.d/mountfs ${EXTDIR}/init.d/ - install -m ${MODE} init.d/mountkernfs ${EXTDIR}/init.d/ + install -m ${MODE} init.d/mountvirtfs ${EXTDIR}/init.d/ install -m ${MODE} init.d/rc ${EXTDIR}/init.d/ install -m ${MODE} init.d/reboot ${EXTDIR}/init.d/ install -m ${MODE} init.d/sendsignals ${EXTDIR}/init.d/ @@ -103,7 +103,7 @@ minimal: create-dirs create-service-dir create-boottemp-dir /usr/lib/lsb/install_initd ${EXTDIR}/init.d/halt /usr/lib/lsb/install_initd ${EXTDIR}/init.d/localnet /usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountfs - /usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountkernfs + /usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountvirtfs /usr/lib/lsb/install_initd ${EXTDIR}/init.d/reboot /usr/lib/lsb/install_initd ${EXTDIR}/init.d/sendsignals /usr/lib/lsb/install_initd ${EXTDIR}/init.d/setclock diff --git a/bootscripts/contrib/lsb-v3/init.d/modules b/bootscripts/contrib/lsb-v3/init.d/modules index b233cf46d..f97cb892d 100644 --- a/bootscripts/contrib/lsb-v3/init.d/modules +++ b/bootscripts/contrib/lsb-v3/init.d/modules @@ -3,7 +3,7 @@ ### BEGIN INIT INFO # Provides: modules -# Required-Start: mountkernfs sysctl +# Required-Start: mountvirts sysctl # Should-Start: # Required-Stop: # Should-Stop: diff --git a/bootscripts/contrib/lsb-v3/init.d/mountfs b/bootscripts/contrib/lsb-v3/init.d/mountfs index 2e03db582..5a375ec51 100644 --- a/bootscripts/contrib/lsb-v3/init.d/mountfs +++ b/bootscripts/contrib/lsb-v3/init.d/mountfs @@ -33,6 +33,7 @@ case "${1}" in mount -f / || failed=1 mount -f /proc || failed=1 mount -f /sys || failed=1 + mount -f /run || failed=1 (exit ${failed}) evaluate_retval standard @@ -40,6 +41,7 @@ case "${1}" in # their option list. _netdev denotes a network filesystem. message="Mounting remaining file systems..." mount -a -O no_netdev >/dev/null + ln -s /run/shm /dev/shm evaluate_retval standard ;; diff --git a/bootscripts/contrib/lsb-v3/init.d/mountkernfs b/bootscripts/contrib/lsb-v3/init.d/mountkernfs deleted file mode 100644 index 7366f0bf1..000000000 --- a/bootscripts/contrib/lsb-v3/init.d/mountkernfs +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# Begin /etc/init.d/mountkernfs - -### BEGIN INIT INFO -# Provides: mountkernfs -# Required-Start: -# Should-Start: -# Required-Stop: -# Should-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Mounts /sys and /proc virtual (kernel) filesystems. -# Description: Mounts /sys and /proc virtual (kernel) filesystems. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -case "${1}" in - start) - message="Mounting kernel-based file systems:" - - if ! mountpoint /proc > /dev/null; then - message="${message}${INFO} /proc${NORMAL}" - mount -n /proc || failed=1 - fi - - if ! mountpoint /sys > /dev/null; then - message="${message}${INFO} /sys${NORMAL}" - mount -n /sys || failed=1 - fi - - (exit ${failed}) - evaluate_retval standard - ;; - - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -# End /etc/init.d/mountkernfs diff --git a/bootscripts/contrib/lsb-v3/init.d/mountvirtfs b/bootscripts/contrib/lsb-v3/init.d/mountvirtfs new file mode 100644 index 000000000..6706da0a3 --- /dev/null +++ b/bootscripts/contrib/lsb-v3/init.d/mountvirtfs @@ -0,0 +1,48 @@ +#!/bin/sh +# Begin /etc/init.d/mountvirtfs + +### BEGIN INIT INFO +# Provides: mountvirtfs +# Required-Start: +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mounts /sys, /proc, and /run virtual (virtel) filesystems. +# Description: Mounts /sys, /proc, and run virtual (virtel) filesystems. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + message="Mounting virtel-based file systems:" + + if ! mountpoint /proc > /dev/null; then + message="${message}${INFO} /proc${NORMAL}" + mount -n /proc || failed=1 + fi + + if ! mountpoint /sys > /dev/null; then + message="${message}${INFO} /sys${NORMAL}" + mount -n /sys || failed=1 + fi + + if ! mountpoint /run > /dev/null; then + message="${message}${INFO} /run${NORMAL}" + mount -n /run || failed=1 + fi + + (exit ${failed}) + evaluate_retval standard + ;; + + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +# End /etc/init.d/mountvirtfs diff --git a/bootscripts/contrib/lsb-v3/init.d/sysctl b/bootscripts/contrib/lsb-v3/init.d/sysctl index 813467117..cccff126e 100644 --- a/bootscripts/contrib/lsb-v3/init.d/sysctl +++ b/bootscripts/contrib/lsb-v3/init.d/sysctl @@ -3,7 +3,7 @@ ### BEGIN INIT INFO # Provides: sysctl -# Required-Start: mountkernfs +# Required-Start: mountvirtfs # Should-Start: # Required-Stop: # Should-Stop: diff --git a/bootscripts/lfs/init.d/mountfs b/bootscripts/lfs/init.d/mountfs index 3d9262463..09d6f913c 100644 --- a/bootscripts/lfs/init.d/mountfs +++ b/bootscripts/lfs/init.d/mountfs @@ -29,6 +29,7 @@ case "${1}" in mount -f / || failed=1 mount -f /proc || failed=1 mount -f /sys || failed=1 + mount -f /run || failed=1 (exit ${failed}) evaluate_retval @@ -37,6 +38,11 @@ case "${1}" in boot_mesg "Mounting remaining file systems..." mount -a -O no_netdev >/dev/null evaluate_retval + + #Create a symlink for shared memory after /dev is mounted + boot_mesg "Redirect /dev/shm to /run/shm..." + ln -s /run/shm /dev/shm + evaluate_retval ;; stop) diff --git a/bootscripts/lfs/init.d/mountkernfs b/bootscripts/lfs/init.d/mountkernfs deleted file mode 100644 index 10b165a5c..000000000 --- a/bootscripts/lfs/init.d/mountkernfs +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin $rc_base/init.d/mountkernfs -# -# Description : Mount proc and sysfs -# -# Authors : Gerard Beekmans - gerard@linuxfromscratch.org -# -# Version : 00.00 -# -# Notes : -# -######################################################################## - -. /etc/sysconfig/rc -. ${rc_functions} - -case "${1}" in - start) - boot_mesg -n "Mounting kernel-based file systems:" ${INFO} - - if ! mountpoint /proc >/dev/null; then - boot_mesg -n " /proc" ${NORMAL} - mount -n /proc || failed=1 - fi - - if ! mountpoint /sys >/dev/null; then - boot_mesg -n " /sys" ${NORMAL} - mount -n /sys || failed=1 - fi - - boot_mesg "" ${NORMAL} - - (exit ${failed}) - evaluate_retval - ;; - - *) - echo "Usage: ${0} {start}" - exit 1 - ;; -esac - -# End $rc_base/init.d/mountkernfs diff --git a/bootscripts/lfs/init.d/mountvirtfs b/bootscripts/lfs/init.d/mountvirtfs new file mode 100644 index 000000000..370f4e4b0 --- /dev/null +++ b/bootscripts/lfs/init.d/mountvirtfs @@ -0,0 +1,51 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/mountvirtfs +# +# Description : Mount proc, sysfs, and run +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# +# Version : 00.00 +# +# Notes : +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +case "${1}" in + start) + boot_mesg -n "Mounting virtual file systems:" ${INFO} + + if ! mountpoint /proc >/dev/null; then + boot_mesg -n " /proc" ${NORMAL} + mount -n /proc || failed=1 + fi + + if ! mountpoint /sys >/dev/null; then + boot_mesg -n " /sys" ${NORMAL} + mount -n /sys || failed=1 + fi + + if ! mountpoint /run >/dev/null; then + boot_mesg -n " /run" ${NORMAL} + mount -n /run || failed=1 + mkdir /run/var + mkdir /run/shm + fi + + boot_mesg "" ${NORMAL} + + (exit ${failed}) + evaluate_retval + ;; + + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +# End $rc_base/init.d/mountvertfs -- cgit v1.2.3-54-g00ecf