[lfs] branch openrc updated: Usage: Fix up scripts, commands, and add Agetty configuration.

"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.book
Message-ID <177036346940.14392.9857423354024554722@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch openrc
in repository lfs.

The following commit(s) were added to refs/heads/openrc by this push:
     new 7d41f96b2 Usage: Fix up scripts, commands, and add Agetty configuration.
7d41f96b2 is described below

commit 7d41f96b2c95fc745d21d93c6206db856b0e5bd1
Author: Zeckmathederg <[email protected]>
AuthorDate: Fri Feb 6 00:35:56 2026 -0700

    Usage: Fix up scripts, commands, and add Agetty configuration.
    
    The Udev service(s) weren't what was causing shutdown hangs. It was the
    kernel. The system did not want to shut down if the kernel modules were
    loaded and devices hotplugged, no matter if udevd was killed before
    shutdown.
    
    I still don't know what the kernel option required for smooth operation
    is, but copying my main kernel config over made everything work fine.
    The base options must be edited.
    
    The changes to the udev services were much needed though to be more
    correct and reduce any complications.
---
 chapter09/usage.xml | 74 ++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 53 insertions(+), 21 deletions(-)

diff --git a/chapter09/usage.xml b/chapter09/usage.xml
index beaa8a193..3dede0b3d 100644
--- a/chapter09/usage.xml
+++ b/chapter09/usage.xml
@@ -90,7 +90,8 @@
   <literal>tty</literal> that's needed. Create and enable those
   services:</para>
 
-<screen><userinput>for i in $(seq 1 6); do
+<screen><userinput>rm -vf /etc/runlevels/default/agetty*
+for i in $(seq 1 6); do
   ln -sfv agetty /etc/init.d/agetty.tty$i
   rc-update add agetty.tty$i default
 done</userinput></screen>
@@ -107,52 +108,71 @@ done</userinput></screen>
       <primary sortas="d-udevd">udevd</primary>
     <secondary>configuring</secondary></indexterm>
 
-  <para>OpenRC doesn't ship a service for <command>udevd</command>, leading to
-  kernel modules not being loaded. Create and enable it now:</para>
+  <para>OpenRC doesn't ship services for <command>udevd</command>, leading to
+  kernel modules not being loaded. Create and enable them now:</para>
 
 <screen><userinput>cat &gt; /etc/init.d/udevd &lt;&lt; "EOF"
 <literal>#!/sbin/openrc-run
-# Starts the udevd daemon and adds device nods via udevadm.
+# Starts the udevd daemon.
 # Authors: Zeckma - [email protected]
 # Version: LFS 12.5
 
 description="starts the udevd daemon"
 
-depend()
-{
+supervisor=supervise-daemon
+command=/sbin/udevd
+command_args="--daemon"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
   after localnet
-  before modules
+  after modules
 }
 
-start()
-{
-  ebegin "Starting the udevd daemon"
+stop() {
+  ebegin "Stopping ${RC_SVCNAME}"
+  /bin/udevadm control --exit
+  eend $?
+}</literal>
+EOF
+
+cat &gt; /etc/init.d/udev-trigger &lt;&lt; "EOF"
+<literal>#!/sbin/openrc-run
+# Coldplugs devices and settles the udevd daemon.
+# Authors: Zeckma - [email protected]
+# Version: LFS 12.5
+
+description="coldplugs devices"
+
+depend() {
+  after udevd
+  provides dev
+  keyword -shutdown
+}
 
-# Start the udev daemon to continually watch for, and act on,
-# uevents
-  SYSTEMD_LOG_TARGET=kmsg /sbin/udevd --daemon
+start() {
+  ebegin "Coldplugging devices"
 
-# Now traverse /sys in order to "coldplug" devices that have
-# already been discovered
   /bin/udevadm trigger --action=add    --type=subsystems
   /bin/udevadm trigger --action=add    --type=devices
   /bin/udevadm trigger --action=change --type=devices
 
-# Now wait for udevd to process the uevents we triggered
-  /bin/udevadm settle
+# Wait for udevd to process the uevents we triggered
+  /bin/udevadm settle --timeout=5
 
 # If any LVM based partitions are on the system, ensure they
 # are activated so they can be used.
   if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi
-
 }</literal>
 EOF
 
-chmod +x /etc/init.d/udevd
-rc-update add udevd boot</userinput></screen>
+for i in udev{d,-trigger}; do
+  chmod 755 /etc/init.d/$i
+  rc-update add $i sysinit
+done</userinput></screen>
 
     <para>
-      This service should load most if not all modules automatically. If you
+      These services should load most if not all modules automatically. If you
       need to load a given module but it isn't being loaded, pass the module
       name to the <filename>/etc/conf.d/modules</filename> configuration file.
     </para>
@@ -237,6 +257,18 @@ rc-update add udevd boot</userinput></screen>
 
   </sect2>
 
+  <sect2 id="ch-config-agetty">
+    <title>Configuring Agetty</title>
+
+    <para>
+      If you don't want the boot logs to be cleared on the first TTY, which
+      Agetty will clear them by default, add <option>--noclear</option> to
+      <literal>agetty_options</literal> in the
+      <filename>/etc/conf.d/agetty</filename> file.
+    </para>
+
+  </sect2>
+
   <sect2 id="ch-config-rc">
     <title>The rc.conf File</title>
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.