bootscripts: changed mountvirtfs, udev, udev_retry

This commit is contained in:
Poltern 2023-08-09 18:34:23 +05:00
parent 7249ed1863
commit 7573f4cb93
4 changed files with 53 additions and 12 deletions

View File

@ -1,3 +1,17 @@
2023-07-28 Xi Ruoyao <xry111@xry111.site>
* In mountvirtfs, mount /sys/fs/cgroup for udev from systemd-254.
2023-07-22 Xi Ruoyao <xry111@xry111.site>
* In mountvirtfs, create symlinks /dev/{fd,std{in,out,err}} and
/dev/core (optional).
2023-07-16 Xi Ruoyao <xry111@xry111.site>
* In udev, set SYSTEMD_LOG_TARGET=kmsg so systemd-udevd will correctly
log messages.
2023-07-15 Xi Ruoyao <xry111@xry111.site>
* Use /bin/udevadm instead of /sbin/udevadm.
2022-09-30 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* Mount /dev/shm as a tmpfs.
@ -1135,7 +1149,7 @@ n/a - January 30, 2004:
* Changed the loadkeys script to run "loadkeys -d" and removed the need
for the /etc/sysconfig/keyboard file. The kbd patch fixes the
"loadkeys -d" behaviour.
"loadkeys -d" behavior.
1.6 - February 26th, 2002:

View File

@ -7,8 +7,9 @@
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Xi Ruoyao - xry111@xry111.site
#
# Version : LFS 7.0
# Version : LFS 12.0
#
########################################################################
@ -62,6 +63,33 @@ case "${1}" in
log_info_msg2 " ${INFO}/dev/shm"
mount -o nosuid,nodev /dev/shm || failed=1
mkdir -p /sys/fs/cgroup
log_info_msg2 " ${INFO}/sys/fs/cgroup"
mount -o nosuid,noexec,nodev /sys/fs/cgroup || failed=1
(exit ${failed})
evaluate_retval
if [ "${failed}" = 1 ]; then
exit 1
fi
log_info_msg "Create symlinks in /dev targeting /proc: ${INFO}/dev/stdin"
ln -sf /proc/self/fd/0 /dev/stdin || failed=1
log_info_msg2 " ${INFO}/dev/stdout"
ln -sf /proc/self/fd/1 /dev/stdout || failed=1
log_info_msg2 " ${INFO}/dev/stderr"
ln -sf /proc/self/fd/2 /dev/stderr || failed=1
log_info_msg2 " ${INFO}/dev/fd"
ln -sf /proc/self/fd /dev/fd || failed=1
if [ -e /proc/kcore ]; then
log_info_msg2 " ${INFO}/dev/core"
ln -sf /proc/kcore /dev/core || failed=1
fi
(exit ${failed})
evaluate_retval
exit $failed

View File

@ -7,8 +7,9 @@
# Authors : Zack Winkles, Alexander E. Patrakov
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Xi Ruoyao - xry111@xry111.site
#
# Version : LFS 7.0
# Version : LFS 12.0
#
########################################################################
@ -45,17 +46,17 @@ case "${1}" in
# Start the udev daemon to continually watch for, and act on,
# uevents
/sbin/udevd --daemon
SYSTEMD_LOG_TARGET=kmsg /sbin/udevd --daemon
# Now traverse /sys in order to "coldplug" devices that have
# already been discovered
/sbin/udevadm trigger --action=add --type=subsystems
/sbin/udevadm trigger --action=add --type=devices
/sbin/udevadm trigger --action=change --type=devices
/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
if ! is_true "$OMIT_UDEV_SETTLE"; then
/sbin/udevadm settle
/bin/udevadm settle
fi
# If any LVM based partitions are on the system, ensure they

View File

@ -34,8 +34,6 @@ case "${1}" in
start)
log_info_msg "Retrying failed uevents, if any..."
# As of udev-186, the --run option is no longer valid
#rundir=$(/sbin/udevadm info --run)
rundir=/run/udev
# From Debian: "copy the rules generated before / was mounted
# read-write":
@ -52,13 +50,13 @@ case "${1}" in
/bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \
while read line ; do
for subsystem in $line ; do
/sbin/udevadm trigger --subsystem-match=$subsystem --action=add
/bin/udevadm trigger --subsystem-match=$subsystem --action=add
done
done
# Now wait for udevd to process the uevents we triggered
if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then
/sbin/udevadm settle
/bin/udevadm settle
fi
evaluate_retval