maybe chmod 0644 'conf.d/swap'
maybe chmod 0644 'conf.d/tmpfiles'
maybe chmod 0644 'conf.d/udev'
+maybe chmod 0644 'conf.d/udev-settle'
+maybe chmod 0644 'conf.d/udev-trigger'
maybe chmod 0644 'conf.d/urandom'
maybe chmod 0700 'config-archive'
maybe chmod 0755 'config-archive/etc'
maybe chmod 0755 'init.d/tmpfiles.dev'
maybe chmod 0755 'init.d/tmpfiles.setup'
maybe chmod 0755 'init.d/udev'
+maybe chmod 0755 'init.d/udev-settle'
+maybe chmod 0755 'init.d/udev-trigger'
maybe chmod 0755 'init.d/urandom'
maybe chmod 0644 'initramfs.mounts'
maybe chmod 0644 'inittab'
maybe chmod 0644 'openldap/schema/sudo.schema'
maybe chgrp 'ldap' 'openldap/slapd.conf'
maybe chmod 0640 'openldap/slapd.conf'
-maybe chmod 0600 'openldap/slapd.conf.default'
+maybe chgrp 'ldap' 'openldap/slapd.conf.default'
+maybe chmod 0640 'openldap/slapd.conf.default'
maybe chmod 0600 'openldap/slapd.ldif'
maybe chmod 0600 'openldap/slapd.ldif.default'
maybe chmod 0755 'openldap/ssl'
# /etc/conf.d/udev: config file for udev
-# udev can trigger coldplug events which cause services to start and
-# kernel modules to be loaded.
-# Services are deferred to start in the boot runlevel.
-# Set rc_coldplug="NO" if you don't want this.
-# If you want module coldplugging but not coldplugging of services then you
-# can disable service coldplugging in baselayout/openrc config files.
-# The setting is named different in different versions.
-# in /etc/rc.conf: rc_hotplug="!*" or
-# in /etc/conf.d/rc: rc_plug_services="!*"
-#rc_coldplug="YES"
-
-# We can create a /dev/root symbolic link to point to the root device in
-# some situations. This is on by default because some software relies on
-# it,. However, this software should be fixed to not do this.
-# For more information, see
-# https://bugs.gentoo.org/show_bug.cgi?id=438380.
-# If you are not using any affected software, you do not need this, so
-# feel free to turn it off.
-#rc_dev_root_symlink="YES"
-
-# Expert options:
-
-# Timeout in seconds to wait for processing of uevents at boot.
-# There should be no need to change this.
-#udev_settle_timeout="60"
-
# Add extra command line options to udevd, use with care
# udevd --help for possible values
#udev_opts=""
# Run udevd --debug and write output to /run/udevdebug.log
# Should not be kept on as it fills diskspace slowly
#udev_debug="YES"
-
-# Run udevadmin monitor to get a log of all events
-# in /run/udevmonitor.log
-#udev_monitor="YES"
-
-# Keep udevmonitor running after populating /dev.
-#udev_monitor_keep_running="no"
-
-# Set cmdline options for udevmonitor.
-# could be some of --env --kernel --udev
-#udev_monitor_opts="--env"
-
--- /dev/null
+# /etc/conf.d/udev-settle: config file for udev-settle
+
+# Timeout in seconds to wait for processing of uevents at boot.
+# There should be no need to change this.
+#udev_settle_timeout=120
--- /dev/null
+# /etc/conf.d/udev-trigger: config file for udev-trigger
+
+# udev can trigger coldplug events which cause services to start and
+# kernel modules to be loaded.
+# Services are deferred to start in the boot runlevel.
+# Set rc_coldplug="NO" if you don't want this.
+# If you want module coldplugging but not coldplugging of services then you
+# can disable service coldplugging in baselayout/openrc config files.
+# The setting is named different in different versions.
+# in /etc/rc.conf: rc_hotplug="!*" or
+# in /etc/conf.d/rc: rc_plug_services="!*"
+#rc_coldplug="YES"
+
+# We can create a /dev/root symbolic link to point to the root device in
+# some situations. This is on by default because some software relies on
+# it,. However, this software should be fixed to not do this.
+# For more information, see
+# https://bugs.gentoo.org/show_bug.cgi?id=438380.
+# If you are not using any affected software, you do not need this, so
+# feel free to turn it off.
+#rc_dev_root_symlink="YES"
+
+# Run udevadmin monitor to get a log of all events
+# in /run/udevmonitor.log
+#udev_monitor="YES"
+
+# Keep udevmonitor running after populating /dev.
+#udev_monitor_keep_running="no"
+
+# Set cmdline options for udevmonitor.
+# could be some of --env --kernel --udev
+#udev_monitor_opts="--env"
-#!/sbin/runscript
+#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
extra_started_commands="reload"
description_reload="Reload the udev rules and databases"
-udev_monitor="${udev_monitor:-no}"
-udevmonitor_log=/run/udevmonitor.log
-udevmonitor_pid=/run/udevmonitor.pid
-
depend()
{
- provide dev
need sysfs dev-mount
before checkfs fsck
+ keyword -lxc -systemd-nspawn -vserver
+}
- # udev does not work inside vservers
- keyword -vserver -lxc
+get_udevd_binary() {
+ local bins="/sbin/udevd /lib/systemd/systemd-udevd /usr/lib/systemd/systemd-udevd"
+ for f in ${bins}; do
+ if [ -x "$f" -a ! -L "$f" ]; then
+ command="$f"
+ fi
+ done
+ if [ -z "$command" ]; then
+ eerror "Unable to find udev executable."
+ return 1
+ fi
}
start_pre()
fi
fi
- bins="/sbin/udevd /lib/systemd/systemd-udevd /usr/lib/systemd/systemd-udevd"
- for f in ${bins}; do
- if [ -x "$f" -a ! -L "$f" ]; then
- command="$f"
- fi
- done
- if [ -z "$command" ]; then
- eerror "Unable to find udev executable."
- return 1
- fi
+ get_udevd_binary || return 1
if [ -e /proc/sys/kernel/hotplug ]; then
echo "" >/proc/sys/kernel/hotplug
return 0
}
-start_udevmonitor()
-{
- yesno "${udev_monitor}" || return 0
-
- einfo "udev: Running udevadm monitor ${udev_monitor_opts} to log all events"
- start-stop-daemon --start --stdout "${udevmonitor_log}" \
- --make-pidfile --pidfile "${udevmonitor_pid}" \
- --background --exec /bin/udevadm -- monitor ${udev_monitor_opts}
-}
-
-# This is here because some software expects /dev/root to exist.
-# For more information, see this bug:
-# https://bugs.gentoo.org/show_bug.cgi?id=438380
-dev_root_link()
-{
- local RULESDIR=/run/udev/rules.d
- [ -d $RULESDIR ] || mkdir -p $RULESDIR
- eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ ||
- true)
- [ "$ROOT_MAJOR" -a "$ROOT_MINOR" ] || return 0
-
- # btrfs filesystems have bogus major/minor numbers
- [ "$ROOT_MAJOR" != 0 ] || return 0
-
- echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > $RULESDIR/61-dev-root-link.rules
-}
-
-populate_dev()
-{
- if yesno ${rc_dev_root_symlink:-yes}; then
- ebegin "Generating a rule to create a /dev/root symlink"
- dev_root_link
- eend $?
- fi
-
- get_bootparam "nocoldplug" && rc_coldplug="no"
- if ! yesno ${rc_coldplug:-${RC_COLDPLUG:-yes}}; then
- einfo "Setting /dev permissions and symbolic links"
- udevadm trigger --attr-match=dev --action=add
- udevadm trigger --subsystem-match=net --action=add
- ewarn "Skipping udev coldplug sequence"
- return 0
- fi
-
- ebegin "Populating /dev with existing devices through uevents"
- udevadm trigger --type=subsystems --action=add
- udevadm trigger --type=devices --action=add
- eend $?
-
- ebegin "Waiting for uevents to be processed"
- udevadm settle --timeout=${udev_settle_timeout:-60}
- eend $?
- return 0
-}
-
-stop_udevmonitor()
-{
- yesno "${udev_monitor}" || return 0
-
- if yesno "${udev_monitor_keep_running:-no}"; then
- ewarn "udev: udevmonitor is still running and writing into ${udevmonitor_log}"
- else
- einfo "udev: Stopping udevmonitor: Log is in ${udevmonitor_log}"
- start-stop-daemon --stop --pidfile "${udevmonitor_pid}" --exec /bin/udevadm
- fi
-}
-
-display_hotplugged_services()
-{
- local svcfile= svc= services=
- for svcfile in "${RC_SVCDIR}"/hotplugged/*; do
- svc="${svcfile##*/}"
- [ -x "${svcfile}" ] || continue
-
- services="${services} ${svc}"
- done
- [ -n "${services}" ] && einfo "Device initiated services:${HILITE}${services}${NORMAL}"
-}
-
-start_post()
-{
- start_udevmonitor
- populate_dev
- stop_udevmonitor
- display_hotplugged_services
- return 0
-}
-
stop()
{
local rc=0
rc=$?
if [ $rc -ne 0 ]; then
eend $rc "Failed to stop $RC_SVCNAME using udevadm"
+ get_udevd_binary || return 1
ebegin "Trying with start-stop-daemon"
- start-stop-daemon --stop --exec /sbin/udevd
+ start-stop-daemon --stop --exec ${command}
rc=$?
fi
eend $rc "Failed to stop $RC_SVCNAME"
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend()
+{
+ need udev
+ after udev-trigger
+ provide dev-settle
+ keyword -lxc -systemd-nspawn -vserver
+}
+
+start()
+{
+ ebegin "Waiting for uevents to be processed"
+ udevadm settle \
+ ${udev_settle_timeout:+--timeout=}$udev_settle_timeout
+ eend $?
+}
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="udev Coldplug all Devices"
+
+udevmonitor_log=/run/udevmonitor.log
+udevmonitor_pid=/run/udevmonitor.pid
+
+depend()
+{
+ need udev
+ provide dev
+ keyword -lxc -systemd-nspawn -vserver
+}
+
+start_pre()
+{
+ if yesno "${udev_monitor:-no}"; then
+ einfo "Running udevadm monitor ${udev_monitor_opts} to log all events"
+ start-stop-daemon --start --stdout "${udevmonitor_log}" \
+ --make-pidfile --pidfile "${udevmonitor_pid}" \
+ --background --exec /bin/udevadm -- monitor ${udev_monitor_opts}
+ fi
+ return 0
+}
+
+display_hotplugged_services()
+{
+ local svcfile= svc= services=
+ for svcfile in "${RC_SVCDIR}"/hotplugged/*; do
+ svc="${svcfile##*/}"
+ [ -x "${svcfile}" ] || continue
+
+ services="${services} ${svc}"
+ done
+ [ -n "${services}" ] && einfo "Device initiated services:${HILITE}${services}${NORMAL}"
+ return 0
+}
+
+start_post()
+{
+ if yesno "${udev_monitor:-no}"; then
+ if yesno "${udev_monitor_keep_running:-no}"; then
+ ewarn "udevmonitor is still writing into ${udevmonitor_log}"
+ else
+ einfo "Stopping udevmonitor: Log is in ${udevmonitor_log}"
+ start-stop-daemon --stop --pidfile "${udevmonitor_pid}" \
+ --exec /bin/udevadm
+ fi
+ fi
+ display_hotplugged_services
+ return 0
+}
+
+# This is here because some software expects /dev/root to exist.
+# For more information, see this bug:
+# https://bugs.gentoo.org/show_bug.cgi?id=438380
+dev_root_link()
+{
+ local RULESDIR=/run/udev/rules.d
+ [ -d $RULESDIR ] || mkdir -p $RULESDIR
+ eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ ||
+ true)
+ [ "$ROOT_MAJOR" -a "$ROOT_MINOR" ] || return 0
+
+ # btrfs filesystems have bogus major/minor numbers
+ [ "$ROOT_MAJOR" != 0 ] || return 0
+
+ echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > $RULESDIR/61-dev-root-link.rules
+ return 0
+}
+
+start()
+{
+ if yesno ${rc_dev_root_symlink:-yes}; then
+ ebegin "Generating a rule to create a /dev/root symlink"
+ dev_root_link
+ eend $?
+ fi
+
+ get_bootparam "nocoldplug" && rc_coldplug="no"
+ if ! yesno ${rc_coldplug:-${RC_COLDPLUG:-yes}}; then
+ einfo "Setting /dev permissions and symbolic links"
+ udevadm trigger --attr-match=dev --action=add
+ udevadm trigger --subsystem-match=net --action=add
+ rc=$?
+ ewarn "Skipping udev coldplug sequence"
+ return $rc
+ fi
+
+ ebegin "Populating /dev with existing devices through uevents"
+ udevadm trigger --type=subsystems --action=add
+ udevadm trigger --type=devices --action=add
+ eend $?
+}