Hi all,
after digging around to get LFS booting on a mdadm-raid (based on a
fakeraid on C236 chipset) I've collected a few changes to some
essentials files.
LFS bootscripts
Problem was that after every reboot, the array has been rebuild. While
rebuild, the system is nearly unusable slow and the rebuild takes a
good amount of time (here 1.5h). The reason seems to be that the
initscripts - here especially sendsignals - do not really take care of
raid services. sendsignals sends SIGTERM/SIGKILL to any running
process, including a mdmon process started earlier in initramfs. This
makes it impossible for mdmon to mark the array as clean. Booting an
dirty array forces a rebuild automatically. The patch to sendsignals
simply omits the pid of mdmon from being killed.
Next, in mountfs I added a wait-clean after the root filesystem has
been remounted to be read-only on shutdown. Even though mdmon should
mark the array clean when no writes has occured for a certain amount of
time, it is kind of "forced" by calling mdadm to do so.
Initramfs
This patch belongs to BLFS. It simply adds readlink and basename to
initramsfs as some udev rules do refer to them. Unfortunatly, they are
called qualified in /usr/bin so it was not enough to simply add them to
$binfiles or $sbinfiles. A symlink in /usr to /bin makes those pgms
accessable via /usr/bin.
Would you mind to have a look to the patches and discuss whether they
could applied?
--
Thomas
diff -Naur lfs-bootscripts-20170626.orig/lfs/init.d/mountfs lfs-bootscripts-20170626/lfs/init.d/mountfs
--- lfs-bootscripts-20170626.orig/lfs/init.d/mountfs 2017-08-18 20:41:57.000000000 +0200
+++ lfs-bootscripts-20170626/lfs/init.d/mountfs 2017-11-26 05:48:08.618518870 +0100
@@ -64,6 +64,13 @@
# Make all LVM volume groups unavailable, if appropriate
# This fails if swap or / are on an LVM partition
#if [ -x /sbin/vgchange ]; then /sbin/vgchange -an > /dev/null; fi
+
+ if [ -n "$(pidof mdmon)" ]; then
+ # No longer possible to write to bootlog. Use "echo".
+ echo -n " Wait for clean array ... "
+ /sbin/mdadm --wait-clean --scan
+ echo "rc=$?"
+ fi
;;
*)
diff -Naur lfs-bootscripts-20170626.orig/lfs/init.d/sendsignals lfs-bootscripts-20170626/lfs/init.d/sendsignals
--- lfs-bootscripts-20170626.orig/lfs/init.d/sendsignals 2017-08-18 20:41:57.000000000 +0200
+++ lfs-bootscripts-20170626/lfs/init.d/sendsignals 2017-11-26 05:48:08.671852575 +0100
@@ -29,8 +29,11 @@
case "${1}" in
stop)
+ omit=$(pidof mdmon)
+ [ -n "$omit" ] && omit="-o $omit"
+
log_info_msg "Sending all processes the TERM signal..."
- killall5 -15
+ killall5 -15 $omit
error_value=${?}
sleep ${KILLDELAY}
@@ -42,7 +45,7 @@
fi
log_info_msg "Sending all processes the KILL signal..."
- killall5 -9
+ killall5 -9 $omit
error_value=${?}
sleep ${KILLDELAY}
--- BOOK/postlfs/filesystems/initramfs.xml (Revision 19536)
+++ BOOK/postlfs/filesystems/initramfs.xml (Arbeitskopie)
@@ -93,6 +93,7 @@
binfiles="sh cat cp dd killall ls mkdir mknod mount "
binfiles="$binfiles umount sed sleep ln rm uname"
+binfiles="$binfiles readlink basename"
# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin
if [ -x /bin/udevadm ] ; then binfiles="$binfiles udevadm"; fi
@@ -113,10 +114,11 @@
WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX)
# Create base directory structure
-mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc}
+mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc,usr}
mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d}
touch $WDIR/etc/modprobe.d/modprobe.conf
ln -s lib $WDIR/lib64
+ln -s ../bin $WDIR/usr/bin
# Create necessary device nodes
mknod -m 640 $WDIR/dev/console c 5 1
@@ -153,7 +155,8 @@
# Install basic binaries
for f in $binfiles ; do
- ldd /bin/$f | sed "s/\t//" | cut -d " " -f1 >> $unsorted
+ if [ -x /bin/$f ]; then f="/bin/$f"; else f="/usr/bin/$f"; fi
+ ldd $f | sed "s/\t//" | cut -d " " -f1 >> $unsorted
copy $f bin
done
--
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page