[Clfs-dev] Recent Updates to CLFS builds

Martin Ward macros_the_black at ntlworld.com
Tue Aug 28 13:20:46 PDT 2012


On 28/08/12 18:14, William Harrington wrote:
>
> On Aug 28, 2012, at 10:51 AM, Martin Ward wrote:
>
>> On 28/08/12 15:43, William Harrington wrote:
>>> Some more updates since I've gone through the pure64 bit book.
>>>
>>> I've been trying different udev configurations that make sense, but 
>>> our udev bootscript isn't matching.
>>>
>>> Our bootscript expects /lib/udev/udevadm   (that is fixed with 
>>> --libexecdir=/lib)
>>>                           expects /bin/udevadm              (not a 
>>> problem for now)
>>>
>>> We do need to update our bootscript for udev; however. I think 
>>> udevadm needs to be in /sbin and so the udev bootscript would need 
>>> to be updated since it runs: /bin/udevadm and not /sbin/udevadm like 
>>> it should be.
>>>
>> this is what i do
>> ./configure --prefix=/usr --libdir=/lib --bindir=/sbin 
>> --sysconfdir=/etc --libexecdir=/lib  --disable-rule_generator 
>> --disable-introspection --disable-keymap --disable-gudev 
>> --with-usb-ids-path=no --with-pci-ids-path=no    
>> --with-systemdsystemunitdir=no   --with-firmware-path=/lib/firmware
>>
>> move the pkg-config file to /usr/lib/
>>
>> ln -sfv /lib/udev/udevd /sbin/udevd
>>
>
> pkg-config file is taken care of with our make install command so that 
> is well in CLFS.
>
> is it proper to link udevd ?
did it for convenience really, saved changing the bootscripts

> In the FHS I don't see /libexec anyway, we should maybe make the 
> libexec directory /sbin.
> or /sbin/udev. /lib/udev is fine, but then why link it to /sbin ?
>
> I agree we need the bindir to be /sbin.
>
> The rule generator we need for people who want persistent devices, 
> unless I'm wrong, that's what it is for. systemdsystemunitdir is no 
> anyway with our builds.  Thanks for some confirmations, still unsure 
> on libexec and udevd.
>
true
>
>>> What is the community's thought on this?
>>>
>>> I used this configure option the last round:
>>>
>>> --prefix=/usr --with-rootprefix="" --sysconfdir=/etc 
>>> --libexecdir=/lib --enable-rule_generator
>>> --disable-introspection --disable-keymap --disable-gudev 
>>> --with-usb-ids-path=no
>>> --with-pci-ids-path=no
>>>
>>> Althouh this will put libudev into /usr/lib.   Do we need to make 
>>> sure the libs get put into /lib in case someone has /usr as a 
>>> separate partition and it is not yet mounted when the udev script is 
>>> ran?
>>>
>>> I was looking to see what all may be linked to /usr/lib/libudev 
>>> libraries but I don't see anything that would harm that. But I would 
>>> like to make all of this proper.
>>>
>>>
>> see above
>>> =================BOOTING================
>>>
>>> DEVTMPFS issues.
>>>
>>> I've had issues with this and the bootscripts as well.
>>>
>> i've changed the bootscripts slightly to take into account , devtmps 
>> on /dev, the /run dir, udev just being a permission and group 
>> changing util now, my /tmp is also a tmpfs so i don't need to clean 
>> it out every time i reboot
>>
>> could send you a patch to see what you think
>>
>
> A patch would be good. We need to update the bootscripts.
>
> I can test it and see what goes on then communicate with Jonathan when 
> I see him as he oversees the bootscripts.
>>>
>> cheers
>>
>> Martin
>> _______________________________________________
>> Clfs-dev mailing list
>> Clfs-dev at lists.cross-lfs.org
>> http://lists.cross-lfs.org/listinfo.cgi/clfs-dev-cross-lfs.org
>
> Thanks for the input Martin,
>
> Sincerely,
>
> William Harrington
> _______________________________________________
> Clfs-dev mailing list
> Clfs-dev at lists.cross-lfs.org
> http://lists.cross-lfs.org/listinfo.cgi/clfs-dev-cross-lfs.org
>
patch attached , it's a bit rough, but i think you can get the idea from it

martin
-------------- next part --------------
diff -Naur bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/cleanfs bootscripts-cross-lfs-2.0-pre1/clfs/init.d/cleanfs
--- bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/cleanfs	2012-08-09 08:19:10.281075893 +0100
+++ bootscripts-cross-lfs-2.0-pre1/clfs/init.d/cleanfs	2012-08-09 08:21:00.794670946 +0100
@@ -78,23 +78,15 @@
 		find . -xdev -mindepth 1 ! -name lost+found \
 			-delete || failed=1
 
-		boot_mesg -n " /var/lock" ${NORMAL}
-		cd /var/lock &&
-		find . -type f ! -newer /proc -exec rm -f {} \; || failed=1
-
-		boot_mesg " /run" ${NORMAL}
-		cd /run &&
-		find . ! -type d ! -name utmp ! -newer /proc \
-			-exec rm -f {} \; || failed=1
-		> /run/utmp
+		> /var/run/utmp
 		if grep -q '^utmp:' /etc/group ; then
-			chmod 664 /run/utmp
-			chgrp utmp /run/utmp
+			chmod 664 /var/run/utmp
+			chgrp utmp /var/run/utmp
 		fi
 
 		(exit ${failed})
 		evaluate_retval
-
+                boot_mesg "" ${NORMAL}
 		if [ -e /etc/sysconfig/createfiles ]; then
 			if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then
 				boot_mesg "Creating files and directories..."
diff -Naur bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/mountfs bootscripts-cross-lfs-2.0-pre1/clfs/init.d/mountfs
--- bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/mountfs	2012-08-09 08:19:10.281075893 +0100
+++ bootscripts-cross-lfs-2.0-pre1/clfs/init.d/mountfs	2012-08-09 08:20:10.263407580 +0100
@@ -29,6 +29,8 @@
 		mount -f / || failed=1
 		mount -f /proc || failed=1
 		mount -f /sys || failed=1
+		mount -f /run || failed=1
+		mount -f /dev || failed=1
 		(exit ${failed})
 		evaluate_retval
 
diff -Naur bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/mountkernfs bootscripts-cross-lfs-2.0-pre1/clfs/init.d/mountkernfs
--- bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/mountkernfs	2012-08-09 08:19:10.281075893 +0100
+++ bootscripts-cross-lfs-2.0-pre1/clfs/init.d/mountkernfs	2012-08-09 08:21:43.408835447 +0100
@@ -2,7 +2,7 @@
 ########################################################################
 # Begin $rc_base/init.d/mountkernfs
 #
-# Description : Mount proc, sysfs and run (tmpfs)
+# Description : Mount proc and sysfs
 #
 # Authors     : Gerard Beekmans - gerard at linuxfromscratch.org
 #
@@ -21,23 +21,25 @@
 
 		if ! mountpoint /proc >/dev/null; then
 			boot_mesg -n " /proc" ${NORMAL}
-			mount -n /proc || failed=1
+			mount -n -o nosuid,noexec,nodev -t proc proc /proc || failed=1
 		fi
 
 		if ! mountpoint /sys >/dev/null; then
 			boot_mesg -n " /sys" ${NORMAL}
-			mount -n /sys || failed=1
+			mount -n -o nosuid,noexec,nodev -t sysfs sys /sys || failed=1
+		fi
+		if ! mountpoint /run >/dev/null; then
+			boot_mesg -n " /run" ${NORMAL}
+			mount -n -o mode=0755,nosuid,nodev -t tmpfs run /run || failed=1
+		fi
+		if ! mountpoint /dev >/dev/null; then
+			boot_mesg -n " /dev" ${NORMAL}
+			mount -n -o mode=0755,nosuid -t devtmpfs dev /dev || failed=1
 		fi
-
-                if ! mountpoint /run >/dev/null; then
-                        boot_mesg -n " /run" ${NORMAL}
-                        mount -n /run || failed=1
-                fi
-
-		boot_mesg "" ${NORMAL}
-
 		(exit ${failed})
-		evaluate_retval
+					
+                mkdir -m 1777 /run/lock
+                mkdir -p /dev/{pts,shm}           
 		;;
 
 	*)
diff -Naur bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/sendsignals bootscripts-cross-lfs-2.0-pre1/clfs/init.d/sendsignals
--- bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/sendsignals	2012-08-09 08:19:10.281075893 +0100
+++ bootscripts-cross-lfs-2.0-pre1/clfs/init.d/sendsignals	2012-08-09 08:21:59.374913669 +0100
@@ -23,7 +23,7 @@
 
 		sleep ${KILLDELAY}
 
-		if [ "${error_value}" = 0 ]; then
+		if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then
 			echo_ok
 		else
 			echo_failure
@@ -35,7 +35,7 @@
 
 		sleep ${KILLDELAY}
 
-		if [ "${error_value}" = 0 ]; then
+		if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then
 			echo_ok
 		else
 			echo_failure
diff -Naur bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/udev bootscripts-cross-lfs-2.0-pre1/clfs/init.d/udev
--- bootscripts-cross-lfs-2.0-pre1.old/clfs/init.d/udev	2012-08-09 08:19:10.281075893 +0100
+++ bootscripts-cross-lfs-2.0-pre1/clfs/init.d/udev	2012-08-09 08:20:23.827113607 +0100
@@ -21,67 +21,43 @@
 
 case "$1" in
     start)
-	boot_mesg "Copying static entries..."
-	cp --preserve=all --recursive --remove-destination /lib/udev/devices/* /dev
-	evaluate_retval
-	
-	boot_mesg "Setting Permissons on /dev/shm..."
-	chmod 1777 /dev/shm
-	evaluate_retval
-
 	echo "" > /sys/kernel/uevent_helper
 
 	# start udevd
-	boot_mesg "Starting udevd..."
-	/lib/udev/udevd --daemon
+	boot_mesg "\nStarting udevd..."
+	/sbin/udevd --daemon
 	evaluate_retval
 
 	# start coldplugging
 	boot_mesg "Performing Coldplugging..."
 
 	# unlikely, but we may be faster than the first event
-	mkdir -p /run/udev/queue
+	#mkdir -p /run/.udev/queue
 
 	# configure all devices
-	/bin/udevadm trigger --action=add
+	/sbin/udevadm trigger --action=add --type=subsystems
+	/sbin/udevadm trigger --action=add --type=devices
 	
 	# this replaces the old loop, exits after all devices are done
-	/bin/udevadm settle
+	/sbin/udevadm settle
 
 	echo_ok
 	;;
 
     stop)
 	boot_mesg "Stopping udevd..."
-	killproc /lib/udev/udevd
+	killproc /sbin/udevd
 	;;
 
     restart)
 	boot_mesg "Restarting udevd..."
-	killproc /lib/udev/udevd
-	loadproc /lib/udev/udevd --daemon
+	killproc /sbin/udevd
+	loadproc /sbin/udevd --daemon
 	evaluate_retval
 	;;
 
     status)
-	statusproc /lib/udev/udevd
-	;;
-
-    reload)
-	boot_mesg "Reloading udev rules..."
-	udevadm control reload_rules
-	cp --preserve=all --recursive --update /lib/udev/devices/* /dev
-	evaluate_retval
-	;;
-
-    force-reload)
-	boot_mesg "Updating all available device nodes in /dev..."
-	udevadm control reload_rules
-	rm -rf /run/udev /dev/disk
-	cp --preserve=all --recursive --update /lib/udev/devices/* /dev
-	/bin/udevadm trigger
-	/bin/udevadm settle
-	evaluate_retval
+	statusproc /sbin/udevd
 	;;
 
     *)


More information about the Clfs-dev mailing list