summaryrefslogtreecommitdiffstats
path: root/source/a/udev/config/rc.d/rc.udev.new
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2016-06-30 20:26:57 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 23:31:18 +0200
commitd31c50870d0bee042ce660e445c9294a59a3a65b (patch)
tree6bfc0de3c95267b401b620c2c67859557dc60f97 /source/a/udev/config/rc.d/rc.udev.new
parent76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff)
downloadcurrent-slackware-14.2.tar.gz
current-slackware-14.2.tar.xz
Slackware 14.2slackware-14.2
Thu Jun 30 20:26:57 UTC 2016 Slackware 14.2 x86_64 stable is released! The long development cycle (the Linux community has lately been living in "interesting times", as they say) is finally behind us, and we're proud to announce the release of Slackware 14.2. The new release brings many updates and modern tools, has switched from udev to eudev (no systemd), and adds well over a hundred new packages to the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to 'source/a/udev/config/rc.d/rc.udev.new')
-rw-r--r--source/a/udev/config/rc.d/rc.udev.new174
1 files changed, 0 insertions, 174 deletions
diff --git a/source/a/udev/config/rc.d/rc.udev.new b/source/a/udev/config/rc.d/rc.udev.new
deleted file mode 100644
index f000e938e..000000000
--- a/source/a/udev/config/rc.d/rc.udev.new
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/bin/sh
-# This is a script to initialize udev, which populates the /dev
-# directory with device nodes, scans for devices, loads the
-# appropriate kernel modules, and configures the devices.
-
-PATH="/sbin:/bin"
-
-. /etc/udev/udev.conf
-
-# remove trailing slash from udev_root
-UDEV_ROOT=$(echo "${udev_root}" |sed 's/\/*$//')
-
-check_mounted() {
- grep -E -q "^[^[:space:]]+ $1 $2" /proc/mounts
- return $?
-}
-
-mount_devpts() {
- if ! check_mounted $UDEV_ROOT/pts devpts ; then
- mkdir $UDEV_ROOT/pts 2> /dev/null
- mount -n -o mode=0620,gid=5 -t devpts devpts $UDEV_ROOT/pts
- fi
-}
-
-case "$1" in
- start)
- # Sanity check #1, udev requires that the kernel support devtmpfs:
- if ! grep -wq devtmpfs /proc/filesystems ; then
- echo "Sorry, but you need devtmpfs support in the kernel to use udev."
- echo "Both of these options are needed: CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y"
- echo
- echo "FATAL: Refusing to run /etc/rc.d/rc.udev."
- sleep 10
- exit 1
- fi
-
- # Sanity check #2, udev requires that the kernel support tmpfs:
- if ! grep -wq tmpfs /proc/filesystems ; then
- echo "Sorry, but you need tmpfs support in the kernel to use udev."
- echo
- echo "FATAL: Refusing to run /etc/rc.d/rc.udev."
- sleep 10
- exit 1
- fi
-
- # Sanity check #3, make sure that a 2.6.x kernel is new enough:
- if [ "$(uname -r | cut -f 1,2 -d .)" = "2.6" ]; then
- if [ "$(uname -r | cut -f 3 -d . | sed 's/[^[:digit:]].*//')" -lt "32" ]; then
- echo "Sorry, but you need a 2.6.32+ kernel to use this udev."
- echo "Your kernel version is only $(uname -r)."
- echo
- echo "FATAL: Refusing to run /etc/rc.d/rc.udev."
- sleep 10
- exit 1
- fi
- fi
-
- # Sanity check #4, make sure the udev package was not removed. If udevd
- # is not there, this will also shut off this script to prevent further
- # problems:
- if [ ! -x /sbin/udevd ]; then
- chmod 0644 /etc/rc.d/rc.udev
- echo "No udevd daemon found."
- echo "Turning off udev: chmod 644 /etc/rc.d/rc.udev"
- echo "FATAL: Refusing to run /etc/rc.d/rc.udev."
- sleep 10
- exit 1
- fi
-
- # Disable hotplug helper since udevd listens to netlink:
- if [ -e /proc/sys/kernel/hotplug ]; then
- echo "" > /proc/sys/kernel/hotplug
- fi
-
- if grep -qw devtmpfs /proc/filesystems ; then
- if ! check_mounted $UDEV_ROOT devtmpfs ; then
- # umount shm if needed
- check_mounted $UDEV_ROOT/shm tmpfs && umount -l $UDEV_ROOT/shm
-
- # Umount pts if needed, we will remount it later:
- check_mounted $UDEV_ROOT/pts devpts && umount -l $UDEV_ROOT/pts
-
- # Mount tmpfs on $UDEV_ROOT:
- mount -n -t devtmpfs devtmpfs $UDEV_ROOT
- fi
- else
- # Mount tmpfs on $UDEV_ROOT:
- if ! check_mounted $UDEV_ROOT tmpfs ; then
- # umount shm if needed
- check_mounted $UDEV_ROOT/shm tmpfs && umount -l $UDEV_ROOT/shm
-
- # Umount pts if needed, we will remount it later:
- check_mounted $UDEV_ROOT/pts devpts && umount -l $UDEV_ROOT/pts
-
- # Mount tmpfs on $UDEV_ROOT:
- # the -n is because we don't want $UDEV_ROOT umounted when
- # someone (rc.[06]) calls umount -a
- mount -n -o mode=0755 -t tmpfs tmpfs $UDEV_ROOT
-
- fi
- fi
- # Mount devpts
- mount_devpts
-
- if ! /sbin/pidof udevd 1>/dev/null 2>/dev/null; then # start udevd
- echo "Starting udevd: /sbin/udevd --daemon"
- /sbin/udevd --daemon
- # Since udev is just now being started we want to use add events:
- echo "Triggering udev events: /sbin/udevadm trigger --action=add"
- # Call udevtrigger and udevsettle to do the device configuration:
- /sbin/udevadm trigger --type=subsystems --action=add
- /sbin/udevadm trigger --type=devices --action=add
- else # trigger changes for already running udevd
- # If the persistent rules files do not exist, trigger an add event:
- if [ ! -r /etc/udev/rules.d/70-persistent-net.rules -o ! -r /etc/udev/rules.d/70-persistent-cd.rules ]; then
- # Test that we can actually write to the directory first:
- if touch /etc/udev/rules.d/testfile 2> /dev/null ; then
- rm -f /etc/udev/rules.d/testfile
- # This should add persistent net/cd rules:
- echo "Triggering udev to write persistent rules to /etc/udev/rules.d/"
- /sbin/udevadm trigger --type=devices --action=add
- sleep 3
- # Create the files if they don't exist at this point.
- # If a machine does not have a network device or an optical
- # device, we don't want to waste time trying to generate
- # rules at every boot.
- # To force another attempt, delete the file(s).
- touch /etc/udev/rules.d/70-persistent-net.rules
- touch /etc/udev/rules.d/70-persistent-cd.rules
- fi
- fi
- # Since udevd is running, most of the time we only need change events:
- echo "Triggering udev events: /sbin/udevadm trigger --action=change"
- /sbin/udevadm trigger --type=subsystems --action=change
- /sbin/udevadm trigger --type=devices --action=change
- fi
- /sbin/udevadm settle --timeout=120
- ;;
- stop)
- echo "Stopping udevd is STRONGLY discouraged and not supported."
- echo "If you are sure you want to do this, use 'force-stop' instead."
- ;;
- force-stop)
- echo "Stopping udevd"
- udevadm control --exit
- killall udevd 2>/dev/null
- ;;
- restart)
- echo "Restarting udevd is STRONGLY discouraged and not supported."
- echo "If you are sure you want to do this, use 'force-restart' instead."
- ;;
- force-restart)
- echo "Restarting udevd"
- udevadm control --exit
- sleep 3
- udevd --daemon
- ;;
- reload)
- echo "Reloading udev rules"
- udevadm control --reload
- cp --preserve=all --recursive --update /lib/udev/devices/* $UDEV_ROOT
- ;;
- force-reload)
- echo "Updating all available device nodes in $UDEV_ROOT"
- udevadm control --reload
- rm -rf $UDEV_ROOT/.udev $UDEV_ROOT/disk
- cp --preserve=all --recursive --update /lib/udev/devices/* $UDEV_ROOT
- ;;
-
- *)
- echo "Usage: $0 {start|stop|restart|reload|force-reload}"
- exit 1
- ;;
-esac