Changeset cba2d4e
- Timestamp:
- 04/03/2014 09:52:09 PM (10 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 9839808
- Parents:
- 008436e
- Files:
-
- 3 added
- 11 deleted
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
appendices/scripts.xml
r008436e rcba2d4e 6 6 <!ENTITY cleanfs SYSTEM "cleanfs.script"> 7 7 <!ENTITY console SYSTEM "console.script"> 8 <!ENTITY functions SYSTEM "functions.script">9 8 <!ENTITY halt SYSTEM "halt.script"> 10 9 <!ENTITY initfunctions SYSTEM "init-functions.script"> … … 61 60 <title>/lib/lsb/init-functions</title> 62 61 <screen>&initfunctions;</screen> 63 </sect1>64 65 <sect1 id="functions" role="wrap">66 <title>/etc/rc.d/init.d/functions</title>67 <screen>&functions;</screen>68 62 </sect1> 69 63 -
appendices/udev-rules.xml
r008436e rcba2d4e 15 15 <para>The rules from <!-- &eudev-lfs;.tar.bz2 -->in this appendix are listed for 16 16 convenience. Installation is normally done via instructions in <xref 17 linkend='ch-system- eudev'/>. </para>17 linkend='ch-system-systemd'/>. </para> 18 18 19 19 <sect1 id="lfsrules" role="wrap"> -
bootscripts/ChangeLog
r008436e rcba2d4e 1 2014-03-31 Bruce Dubbs <bdubbs@linuxfromscratch.org> 2 * Changes made to be consistent with common systemd functions 3 1 4 2013-08-21 Bruce Dubbs <bdubbs@linuxfromscratch.org> 2 5 * Delete duplicate entry in rc.site file. -
bootscripts/Makefile
r008436e rcba2d4e 1 EXTDIR=${DESTDIR}/etc 2 LIBDIR=${DESTDIR}/lib/services 1 ETCDIR=${DESTDIR}/etc 2 LIBDIR=${DESTDIR}/lib 3 SERVICEDIR=${LIBDIR}/services 4 UNITDIR=${LIBDIR}/systemd/system 3 5 MAN8=${DESTDIR}/usr/share/man/man8 4 6 SBIN=${DESTDIR}/sbin … … 12 14 13 15 create-dirs: 14 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc0.d15 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc1.d16 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc2.d17 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc3.d18 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc4.d19 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc5.d20 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rc6.d21 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/rcS.d22 install -d -m ${DIRMODE} ${E XTDIR}/rc.d/init.d23 install -d -m ${DIRMODE} ${E XTDIR}/sysconfig16 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc0.d 17 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc1.d 18 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc2.d 19 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc3.d 20 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc4.d 21 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc5.d 22 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc6.d 23 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rcS.d 24 install -d -m ${DIRMODE} ${ETCDIR}/rc.d/init.d 25 install -d -m ${DIRMODE} ${ETCDIR}/sysconfig 24 26 install -d -m ${DIRMODE} ${LIBDIR} 27 install -d -m ${DIRMODE} ${SERVICEDIR} 28 install -d -m ${DIRMODE} ${UNITDIR} 25 29 install -d -m ${DIRMODE} ${MAN8} 26 30 install -d -m ${DIRMODE} ${SBIN} 27 ln -sfn services ${DESTDIR}/lib/lsb 28 ln -sfn rc.d/init.d ${EXTDIR}/init.d 31 ln -sfn services ${LIBDIR}/lsb 32 ln -sfn rc.d/init.d ${ETCDIR}/init.d-sysv 33 ln -sfn init.d-sysv ${ETCDIR}/init.d 29 34 30 35 files: create-dirs 31 install -m ${MODE} lfs/init.d/checkfs ${EXTDIR}/rc.d/init.d/ 32 install -m ${MODE} lfs/init.d/cleanfs ${EXTDIR}/rc.d/init.d/ 33 install -m ${MODE} lfs/init.d/halt ${EXTDIR}/rc.d/init.d/ 34 install -m ${MODE} lfs/init.d/console ${EXTDIR}/rc.d/init.d/ 35 install -m ${CONFMODE} lfs/init.d/functions ${EXTDIR}/rc.d/init.d/ 36 install -m ${MODE} lfs/init.d/localnet ${EXTDIR}/rc.d/init.d/ 37 install -m ${MODE} lfs/init.d/modules ${EXTDIR}/rc.d/init.d/ 38 install -m ${MODE} lfs/init.d/mountfs ${EXTDIR}/rc.d/init.d/ 39 install -m ${MODE} lfs/init.d/mountvirtfs ${EXTDIR}/rc.d/init.d/ 40 install -m ${MODE} lfs/init.d/network ${EXTDIR}/rc.d/init.d/ 41 install -m ${MODE} lfs/init.d/rc ${EXTDIR}/rc.d/init.d/ 42 install -m ${MODE} lfs/init.d/reboot ${EXTDIR}/rc.d/init.d/ 43 install -m ${MODE} lfs/init.d/sendsignals ${EXTDIR}/rc.d/init.d/ 44 install -m ${MODE} lfs/init.d/setclock ${EXTDIR}/rc.d/init.d/ 45 install -m ${MODE} lfs/init.d/swap ${EXTDIR}/rc.d/init.d/ 46 install -m ${MODE} lfs/init.d/sysctl ${EXTDIR}/rc.d/init.d/ 47 install -m ${MODE} lfs/init.d/sysklogd ${EXTDIR}/rc.d/init.d/ 48 install -m ${MODE} lfs/init.d/template ${EXTDIR}/rc.d/init.d/ 49 install -m ${MODE} lfs/init.d/udev ${EXTDIR}/rc.d/init.d/ 50 install -m ${MODE} lfs/init.d/udev_retry ${EXTDIR}/rc.d/init.d/ 36 install -m ${MODE} lfs/init.d/checkfs ${ETCDIR}/rc.d/init.d/ 37 install -m ${MODE} lfs/init.d/cleanfs ${ETCDIR}/rc.d/init.d/ 38 install -m ${MODE} lfs/init.d/halt ${ETCDIR}/rc.d/init.d/ 39 install -m ${MODE} lfs/init.d/console ${ETCDIR}/rc.d/init.d/ 40 install -m ${MODE} lfs/init.d/localnet ${ETCDIR}/rc.d/init.d/ 41 install -m ${MODE} lfs/init.d/modules ${ETCDIR}/rc.d/init.d/ 42 install -m ${MODE} lfs/init.d/mountfs ${ETCDIR}/rc.d/init.d/ 43 install -m ${MODE} lfs/init.d/mountvirtfs ${ETCDIR}/rc.d/init.d/ 44 install -m ${MODE} lfs/init.d/network ${ETCDIR}/rc.d/init.d/ 45 install -m ${MODE} lfs/init.d/rc ${ETCDIR}/rc.d/init.d/ 46 install -m ${MODE} lfs/init.d/reboot ${ETCDIR}/rc.d/init.d/ 47 install -m ${MODE} lfs/init.d/sendsignals ${ETCDIR}/rc.d/init.d/ 48 install -m ${MODE} lfs/init.d/setclock ${ETCDIR}/rc.d/init.d/ 49 install -m ${MODE} lfs/init.d/swap ${ETCDIR}/rc.d/init.d/ 50 install -m ${MODE} lfs/init.d/sysctl ${ETCDIR}/rc.d/init.d/ 51 install -m ${MODE} lfs/init.d/sysklogd ${ETCDIR}/rc.d/init.d/ 52 install -m ${MODE} lfs/init.d/template ${ETCDIR}/rc.d/init.d/ 53 install -m ${MODE} lfs/init.d/udev ${ETCDIR}/rc.d/init.d/ 54 install -m ${MODE} lfs/init.d/udev_retry ${ETCDIR}/rc.d/init.d/ 51 55 install -m ${MODE} lfs/sbin/ifup ${SBIN} 52 56 install -m ${MODE} lfs/sbin/ifdown ${SBIN} 53 install -m ${ MODE} lfs/sbin/ifup.8${MAN8}57 install -m ${CONFMODE} lfs/sbin/ifup.8 ${MAN8} 54 58 ln -sf ifup.8 ${MAN8}/ifdown.8 55 install -m ${MODE} lfs/lib/services/ipv4-static-route ${LIBDIR} 56 install -m ${MODE} lfs/lib/services/ipv4-static ${LIBDIR} 57 install -m ${CONFMODE} lfs/lib/services/init-functions ${LIBDIR} 58 if [ ! -f ${EXTDIR}/sysconfig/createfiles ]; then \ 59 install -m ${CONFMODE} lfs/sysconfig/createfiles ${EXTDIR}/sysconfig/ ;\ 59 install -m ${MODE} lfs/lib/services/ipv4-static-route ${SERVICEDIR} 60 install -m ${MODE} lfs/lib/services/ipv4-static ${SERVICEDIR} 61 install -m ${CONFMODE} lfs/lib/services/init-functions ${SERVICEDIR} 62 install -m ${CONFMODE} lfs/units/ifupdownat.service ${UNITDIR}/ifupdown@.service 63 64 if [ ! -f ${ETCDIR}/sysconfig/createfiles ]; then \ 65 install -m ${CONFMODE} lfs/sysconfig/createfiles ${ETCDIR}/sysconfig/ ;\ 60 66 fi 61 if [ ! -f ${E XTDIR}/sysconfig/modules ]; then \62 install -m ${CONFMODE} lfs/sysconfig/modules ${E XTDIR}/sysconfig/ ;\67 if [ ! -f ${ETCDIR}/sysconfig/modules ]; then \ 68 install -m ${CONFMODE} lfs/sysconfig/modules ${ETCDIR}/sysconfig/ ;\ 63 69 fi 64 if [ ! -f ${E XTDIR}/sysconfig/udev_retry ]; then \65 install -m ${CONFMODE} lfs/sysconfig/udev_retry ${E XTDIR}/sysconfig/ ;\70 if [ ! -f ${ETCDIR}/sysconfig/udev_retry ]; then \ 71 install -m ${CONFMODE} lfs/sysconfig/udev_retry ${ETCDIR}/sysconfig/ ;\ 66 72 fi 67 if [ ! -f ${E XTDIR}/sysconfig/rc.site ]; then \68 install -m ${CONFMODE} lfs/sysconfig/rc.site ${E XTDIR}/sysconfig/ ;\73 if [ ! -f ${ETCDIR}/sysconfig/rc.site ]; then \ 74 install -m ${CONFMODE} lfs/sysconfig/rc.site ${ETCDIR}/sysconfig/ ;\ 69 75 fi 70 76 … … 72 78 73 79 rcS: files 74 ln -sf ../init.d/mountvirtfs ${E XTDIR}/rc.d/rcS.d/S00mountvirtfs75 ln -sf ../init.d/modules ${E XTDIR}/rc.d/rcS.d/S05modules76 ln -sf ../init.d/localnet ${E XTDIR}/rc.d/rcS.d/S08localnet77 ln -sf ../init.d/udev ${E XTDIR}/rc.d/rcS.d/S10udev78 ln -sf ../init.d/swap ${E XTDIR}/rc.d/rcS.d/S20swap79 ln -sf ../init.d/checkfs ${E XTDIR}/rc.d/rcS.d/S30checkfs80 ln -sf ../init.d/mountfs ${E XTDIR}/rc.d/rcS.d/S40mountfs81 ln -sf ../init.d/cleanfs ${E XTDIR}/rc.d/rcS.d/S45cleanfs82 ln -sf ../init.d/udev_retry ${E XTDIR}/rc.d/rcS.d/S50udev_retry83 ln -sf ../init.d/console ${E XTDIR}/rc.d/rcS.d/S70console84 ln -sf ../init.d/sysctl ${E XTDIR}/rc.d/rcS.d/S90sysctl80 ln -sf ../init.d/mountvirtfs ${ETCDIR}/rc.d/rcS.d/S00mountvirtfs 81 ln -sf ../init.d/modules ${ETCDIR}/rc.d/rcS.d/S05modules 82 ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rcS.d/S08localnet 83 ln -sf ../init.d/udev ${ETCDIR}/rc.d/rcS.d/S10udev 84 ln -sf ../init.d/swap ${ETCDIR}/rc.d/rcS.d/S20swap 85 ln -sf ../init.d/checkfs ${ETCDIR}/rc.d/rcS.d/S30checkfs 86 ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rcS.d/S40mountfs 87 ln -sf ../init.d/cleanfs ${ETCDIR}/rc.d/rcS.d/S45cleanfs 88 ln -sf ../init.d/udev_retry ${ETCDIR}/rc.d/rcS.d/S50udev_retry 89 ln -sf ../init.d/console ${ETCDIR}/rc.d/rcS.d/S70console 90 ln -sf ../init.d/sysctl ${ETCDIR}/rc.d/rcS.d/S90sysctl 85 91 86 92 rc0: files 87 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc0.d/K80network88 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc0.d/K90sysklogd89 ln -sf ../init.d/sendsignals ${E XTDIR}/rc.d/rc0.d/S60sendsignals90 ln -sf ../init.d/swap ${E XTDIR}/rc.d/rc0.d/S65swap91 ln -sf ../init.d/mountfs ${E XTDIR}/rc.d/rc0.d/S70mountfs92 ln -sf ../init.d/localnet ${E XTDIR}/rc.d/rc0.d/S90localnet93 ln -sf ../init.d/halt ${E XTDIR}/rc.d/rc0.d/S99halt93 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc0.d/K80network 94 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc0.d/K90sysklogd 95 ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/S60sendsignals 96 ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/S65swap 97 ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/S70mountfs 98 ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/S90localnet 99 ln -sf ../init.d/halt ${ETCDIR}/rc.d/rc0.d/S99halt 94 100 95 101 rc1: files 96 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc1.d/K80network97 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc1.d/K90sysklogd102 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc1.d/K80network 103 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc1.d/K90sysklogd 98 104 99 105 rc2: files 100 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc2.d/K80network101 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc2.d/K90sysklogd106 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/K80network 107 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/K90sysklogd 102 108 103 109 rc3: files 104 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc3.d/S10sysklogd105 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc3.d/S20network110 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc3.d/S10sysklogd 111 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc3.d/S20network 106 112 107 113 rc4: files 108 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc4.d/S10sysklogd109 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc4.d/S20network114 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc4.d/S10sysklogd 115 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc4.d/S20network 110 116 111 117 rc5: files 112 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc5.d/S10sysklogd113 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc5.d/S20network118 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc5.d/S10sysklogd 119 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc5.d/S20network 114 120 115 121 rc6: files 116 ln -sf ../init.d/network ${E XTDIR}/rc.d/rc6.d/K80network117 ln -sf ../init.d/sysklogd ${E XTDIR}/rc.d/rc6.d/K90sysklogd118 ln -sf ../init.d/sendsignals ${E XTDIR}/rc.d/rc6.d/S60sendsignals119 ln -sf ../init.d/swap ${E XTDIR}/rc.d/rc6.d/S65swap120 ln -sf ../init.d/mountfs ${E XTDIR}/rc.d/rc6.d/S70mountfs121 ln -sf ../init.d/localnet ${E XTDIR}/rc.d/rc6.d/S90localnet122 ln -sf ../init.d/reboot ${E XTDIR}/rc.d/rc6.d/S99reboot122 ln -sf ../init.d/network ${ETCDIR}/rc.d/rc6.d/K80network 123 ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc6.d/K90sysklogd 124 ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc6.d/S60sendsignals 125 ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc6.d/S65swap 126 ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc6.d/S70mountfs 127 ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc6.d/S90localnet 128 ln -sf ../init.d/reboot ${ETCDIR}/rc.d/rc6.d/S99reboot 123 129 124 130 uninstall: 125 rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${E XTDIR}/rc.d ${EXTDIR}/init.d \126 127 ${EXTDIR}/sysconfig/rc131 rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${ETCDIR}/rc.d ${ETCDIR}/init.d \ 132 ${SBIN}/ifup ${SBIN}/ifdown ${MAN8}/ifup.8 ${MAN8}/ifdown.8 \ 133 ${ETCDIR}/sysconfig/rc 128 134 129 135 .PHONY: all create-dirs install files links rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 uninstall -
bootscripts/lfs/init.d/localnet
r008436e rcba2d4e 29 29 . /lib/lsb/init-functions 30 30 [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network 31 [ -r /etc/hostname ] && HOSTNAME=`cat /etc/hostname` 31 32 32 33 case "${1}" in -
bootscripts/lfs/init.d/mountfs
r008436e rcba2d4e 40 40 rm -f /fastboot /forcefsck 41 41 42 # Make sure /dev/pts exists 43 mkdir -p /dev/pts 44 42 45 # This will mount all filesystems that do not have _netdev in 43 46 # their option list. _netdev denotes a network filesystem. -
bootscripts/lfs/init.d/mountvirtfs
r008436e rcba2d4e 32 32 case "${1}" in 33 33 start) 34 # Make sure /run /varis available before logging any messages34 # Make sure /run is available before logging any messages 35 35 if ! mountpoint /run >/dev/null; then 36 36 mount /run || failed=1 37 37 fi 38 38 39 mkdir -p /run/ var /run/lock /run/shm39 mkdir -p /run/lock /run/shm 40 40 chmod 1777 /run/shm 41 41 -
bootscripts/lfs/init.d/rc
r008436e rcba2d4e 218 218 # Copy the boot log on initial boot only 219 219 if [ "${previous}" == "N" -a "${runlevel}" != "S" ]; then 220 cat /run/var/bootlog>> /var/log/boot.log220 cat $BOOTLOG >> /var/log/boot.log 221 221 222 222 # Mark the end of boot … … 224 224 225 225 # Remove the temporary file 226 rm -f /run/var/bootlog2> /dev/null226 rm -f $BOOTLOG 2> /dev/null 227 227 fi 228 228 -
bootscripts/lfs/init.d/udev
r008436e rcba2d4e 50 50 # Start the udev daemon to continually watch for, and act on, 51 51 # uevents 52 / sbin/udevd --daemon52 /lib/systemd-udevd --daemon 53 53 54 54 # Now traverse /sys in order to "coldplug" devices that have 55 55 # already been discovered 56 / sbin/udevadm trigger --action=add --type=subsystems57 / sbin/udevadm trigger --action=add --type=devices58 / sbin/udevadm trigger --action=change --type=devices56 /bin/udevadm trigger --action=add --type=subsystems 57 /bin/udevadm trigger --action=add --type=devices 58 /bin/udevadm trigger --action=change --type=devices 59 59 60 60 # Now wait for udevd to process the uevents we triggered 61 61 if ! is_true "$OMIT_UDEV_SETTLE"; then 62 / sbin/udevadm settle62 /bin/udevadm settle 63 63 fi 64 64 -
bootscripts/lfs/init.d/udev_retry
r008436e rcba2d4e 36 36 37 37 # As of udev-186, the --run option is no longer valid 38 #rundir=$(/ sbin/udevadm info --run)38 #rundir=$(/bin/udevadm info --run) 39 39 rundir=/run/udev 40 40 # From Debian: "copy the rules generated before / was mounted … … 53 53 while read line ; do 54 54 for subsystem in $line ; do 55 / sbin/udevadm trigger --subsystem-match=$subsystem --action=add55 /bin/udevadm trigger --subsystem-match=$subsystem --action=add 56 56 done 57 57 done … … 59 59 # Now wait for udevd to process the uevents we triggered 60 60 if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then 61 / sbin/udevadm settle61 /bin/udevadm settle 62 62 fi 63 63 -
bootscripts/lfs/lib/services/init-functions
r008436e rcba2d4e 72 72 WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}" 73 73 74 BOOTLOG=/run/ var/bootlog74 BOOTLOG=/run/bootlog 75 75 KILLDELAY=3 76 76 -
chapter01/changelog.xml
r008436e rcba2d4e 36 36 </listitem> 37 37 --> 38 <listitem> 39 <para>2014-03-31</para> 40 <itemizedlist> 41 <listitem> 42 <para>[bdubbs] - THIS IS A MAJOR CHANGE. 43 Added systemd and dbus to the book. 44 Rewrote Chapters 6 and 7 to install systemd and 45 SystemV side by side with the option to reconfigure 46 and come up in the other boot method upon reboot.</para> 47 </listitem> 48 </itemizedlist> 49 </listitem> 50 38 51 <listitem> 39 52 <para>2014-03-31</para> -
chapter01/whatsnew.xml
r008436e rcba2d4e 234 234 </listitem> 235 235 <listitem> 236 <para>eudev-&eudev-version;</para> 237 </listitem> 238 <listitem> 239 <para>eudev-&eudev-version;-manpages</para> 236 <para>dbus-&dbus-version;</para> 240 237 </listitem> 241 238 <listitem> … … 250 247 <listitem> 251 248 <para>libcap-&libcap-version;</para> 249 </listitem> 250 <listitem> 251 <para>systemd-&systemd-version;</para> 252 252 </listitem> 253 253 <listitem> -
chapter03/packages.xml
r008436e rcba2d4e 115 115 116 116 <varlistentry> 117 <term>D-Bus (&dbus-version;) - <token>&dbus-size;</token>:</term> 118 <listitem> 119 <para>Home page: <ulink url="&dbus-home;"/></para> 120 <para>Download: <ulink url="&dbus-url;"/></para> 121 <para>MD5 sum: <literal>&dbus-md5;</literal></para> 122 </listitem> 123 </varlistentry> 124 125 <varlistentry> 117 126 <term>DejaGNU (&dejagnu-version;) - <token>&dejagnu-size;</token>:</term> 118 127 <listitem> … … 158 167 </listitem> 159 168 </varlistentry> 160 169 <!-- 161 170 <varlistentry> 162 171 <term>Eudev (&eudev-version;) - <token>&eudev-size;</token>:</term> … … 175 184 </listitem> 176 185 </varlistentry> 177 186 --> 178 187 <varlistentry> 179 188 <term>File (&file-version;) - <token>&file-size;</token>:</term> … … 597 606 598 607 <varlistentry> 608 <term>Systemd (&systemd-version;) - <token>&systemd-size;</token>:</term> 609 <listitem> 610 <para>Home page: <ulink url="&systemd-home;"/></para> 611 <para>Download: <ulink url="&systemd-url;"/></para> 612 <para>MD5 sum: <literal>&systemd-md5;</literal></para> 613 </listitem> 614 </varlistentry> 615 616 <varlistentry> 599 617 <term>Sysvinit (&sysvinit-version;) - <token>&sysvinit-size;</token>:</term> 600 618 <listitem> … … 640 658 </listitem> 641 659 </varlistentry> 642 <!-- 643 <varlistentry> 644 <term>Systemd (&systemd-version;) - <token>&systemd-size;</token>:</term> 645 <listitem> 646 <para>Home page: <ulink url="&systemd-home;"/></para> 647 <para>Download: <ulink url="&systemd-url;"/></para> 648 <para>MD5 sum: <literal>&systemd-md5;</literal></para> 649 </listitem> 650 </varlistentry> 651 652 <varlistentry> 653 <term>Udev-lfs Tarball (&systemd-version;) - <token>&udev-lfs-size;</token>:</term> 660 661 <varlistentry> 662 <term>Udev-lfs Tarball (&udev-lfs-version;) - <token>&udev-lfs-size;</token>:</term> 654 663 <listitem> 655 664 <para>Download: <ulink url="&udev-lfs-url;"/></para> … … 657 666 </listitem> 658 667 </varlistentry> 659 --> 668 660 669 <varlistentry> 661 670 <term>Util-linux (&util-linux-version;) - <token>&util-linux-size;</token>:</term> -
chapter03/patches.xml
r008436e rcba2d4e 66 66 </listitem> 67 67 </varlistentry> 68 <!-- 68 69 69 <varlistentry> 70 <term> Readline Upstream Fixes Patch - <token>&readline-fixes-patch-size;</token>:</term>70 <term>Systemd Compat Patch - <token>&systemd-compat-patch-size;</token>:</term> 71 71 <listitem> 72 <para>Download: <ulink url="&patches-root;& readline-fixes-patch;"/></para>73 <para>MD5 sum: <literal>& readline-fixes-patch-md5;</literal></para>72 <para>Download: <ulink url="&patches-root;&systemd-compat-patch;"/></para> 73 <para>MD5 sum: <literal>&systemd-compat-patch-md5;</literal></para> 74 74 </listitem> 75 75 </varlistentry> 76 --> 76 77 77 <varlistentry> 78 78 <term>Sysvinit Consolidated Patch - <token>&sysvinit-consolidated-patch-size;</token>:</term> -
chapter06/chapter06.xml
r008436e rcba2d4e 85 85 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/> 86 86 87 88 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit-header.xml"/>89 90 87 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit.xml"/> 91 88 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/> 92 89 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/> 93 <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>--> 94 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/> 90 91 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/> 92 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/> 93 94 <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>--> 95 95 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/> 96 96 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-db.xml"/> -
chapter06/systemd.xml
r008436e rcba2d4e 6 6 ]> 7 7 8 <sect1 id="ch-system- udev" role="wrap">9 <?dbhtml filename=" udev.html"?>8 <sect1 id="ch-system-systemd" role="wrap"> 9 <?dbhtml filename="systemd.html"?> 10 10 11 11 <sect1info condition="script"> 12 <productname> udev</productname>12 <productname>systemd</productname> 13 13 <productnumber>&systemd-version;</productnumber> 14 14 <address>&systemd-url;</address> 15 15 </sect1info> 16 16 17 <title> Udev-&systemd-version; (Extracted from systemd-&systemd-version;)</title>18 19 <indexterm zone="ch-system- udev">20 <primary sortas="a- Udev">Udev</primary>17 <title>Systemd-&systemd-version;</title> 18 19 <indexterm zone="ch-system-systemd"> 20 <primary sortas="a-Systemd">Systemd</primary> 21 21 </indexterm> 22 22 … … 24 24 <title/> 25 25 26 <para>The Udev package contains programs for dynamic creation of device 27 nodes. The development of udev has been merged with systemd, but 28 most of systemd is incompatible with LFS. Here we build and install just 29 the needed udev files.</para> 26 <para>The Systemd package contains programs for controlling the startup, 27 running, and shutdown of the system.</para> 30 28 31 29 <segmentedlist> … … 41 39 42 40 <sect2 role="installation"> 43 <title>Installation of Udev</title> 44 45 <note><para>This package is a little different from other packages. The 46 initial package that is extracted is 47 <filename>systemd-&systemd-version;.tar.xz</filename> even though the 48 application we are installing is udev. After changing to the 49 systemd directory, follow the instructions below.</para></note> 50 51 <para>The udev-lfs tarball contains LFS-specific files used to build 52 Udev. Unpack it into the systemd source directory:</para> 53 54 <screen><userinput remap="pre">tar -xvf ../&udev-lfs;.tar.bz2</userinput></screen> 55 56 <para>Create two symbolic links to header files and set an 57 environment variable to properly use <xref linkend="ch-tools-util-linux"/>.</para> 58 59 <screen><userinput remap="pre">ln -svf /tools/include/blkid /usr/include 60 ln -svf /tools/include/uuid /usr/include 61 export LD_LIBRARY_PATH=/tools/lib</userinput></screen> 62 63 <para>Build the package:</para> 64 65 <screen><userinput remap="make">make -f &udev-lfs;/Makefile.lfs</userinput></screen> 41 <title>Installation of Systemd</title> 42 43 <para>First, create a file to allow Systemd to build when using Util-Linux 44 built in Chapter 5:</para> 45 46 <screen><userinput remap="pre">cat > config.cache << "EOF" 47 <literal>KILL=/bin/kill 48 HAVE_BLKID=1 49 BLKID_LIBS="-lblkid" 50 BLKID_CFLAGS="-I/tools/include/blkid"</literal> 51 EOF</userinput></screen> 52 53 <para>Aditionally, fix a build error when using Util-Linux built in 54 Chapter 5:</para> 55 56 <screen><userinput remap="pre">sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h")</userinput></screen> 57 58 <para>Apply a patch so that compat <command>pkg-config</command> files get 59 installed without installing compat libs which are useless on LFS:</para> 60 61 <screen><userinput remap="pre">patch -Np1 -i ../&systemd-compat-patch;</userinput></screen> 62 63 <para>Prepare Systemd for compilation:</para> 64 65 <screen><userinput remap="configure">./configure --prefix=/usr \ 66 --sysconfdir=/etc \ 67 --localstatedir=/var \ 68 --config-cache \ 69 --with-rootprefix= \ 70 --with-rootlibdir=/lib \ 71 --enable-split-usr \ 72 --disable-gudev \ 73 --without-python \ 74 --docdir=/usr/share/doc/systemd-&systemd-version; \ 75 --with-dbuspolicydir=/etc/dbus-1/system.d \ 76 --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \ 77 --with-dbussessionservicedir=/usr/share/dbus-1/services \ 78 --with-dbussystemservicedir=/usr/share/dbus-1/system-services</userinput></screen> 79 80 <variablelist> 81 <title>The meaning of the configure options:</title> 82 83 <varlistentry> 84 <term><parameter>--config-cache</parameter></term> 85 <listitem> 86 <para>This switch tells the build system to use 87 the <filename>config.cache</filename> file which 88 was created earlier.</para> 89 </listitem> 90 </varlistentry> 91 92 <varlistentry> 93 <term><parameter>--with-root*</parameter></term> 94 <listitem> 95 <para>These switches ensure that core programs and 96 shared libraries are installed in the subdirectories 97 of the root partition.</para> 98 </listitem> 99 </varlistentry> 100 101 <varlistentry> 102 <term><parameter>--enable-split-usr</parameter></term> 103 <listitem> 104 <para>This switch ensures that Systemd will work on 105 systems where /bin, /lib and /sbin directories are not 106 symlinks to their /usr counterparts.</para> 107 </listitem> 108 </varlistentry> 109 110 <varlistentry> 111 <term><parameter>--disable-gudev --without-python</parameter></term> 112 <listitem> 113 <para>These switches disable optional features because 114 LFS does not provide their dependencies.</para> 115 </listitem> 116 </varlistentry> 117 118 <varlistentry> 119 <term><parameter>--with-dbus*</parameter></term> 120 <listitem> 121 <para>These switches ensure that D-Bus configuratil files 122 get installed in the correct locations.</para> 123 </listitem> 124 </varlistentry> 125 126 </variablelist> 127 128 <para>Compile the package:</para> 129 130 <screen><userinput remap="make">make LIBRARY_PATH=/tools/lib</userinput></screen> 131 132 <para>First prevent few broken test cases from running:</para> 133 134 <screen><userinput remap="test">sed -e "s:test/udev-test.pl::g" \ 135 -e "s:test-bus-cleanup\$(EXEEXT) ::g" \ 136 -e "s:test-bus-gvariant\$(EXEEXT) ::g" \ 137 -i Makefile</userinput></screen> 138 139 <para>To test the results, issue:</para> 140 141 <screen><userinput remap="test">make -k check</userinput></screen> 142 143 <para>Note that some tests might fail because the test are being run in a 144 chroot environment. For full test coverage, the test suite should be run 145 from a system booted using Systemd.</para> 66 146 67 147 <para>Install the package:</para> 68 148 69 <screen><userinput remap="install">make -f &udev-lfs;/Makefile.lfs install</userinput></screen> 70 71 <caution><para>There are several places within the 72 <application>systemd</application> source code that have explicit directory 73 paths embedded. For instance, the binary version of the hardware 74 database's path and file name used at run time, 75 <filename>/etc/udev/hwdb.bin</filename>, cannot be changed without explicit 76 changes to the source code.</para></caution> 77 78 <para>Now initialize the hardware database:</para> 79 80 <screen><userinput remap="install">build/udevadm hwdb --update</userinput></screen> 81 82 <para>Finally set up the persistent network udev rules. This task will be 83 explained in detail in <xref linkend='stable-net-names'/>. Note that the 84 <filename class='directory'>/sys</filename> and <filename 85 class='directory'>/proc</filename> filesystems must be mounted in the 86 chroot environment as explained at the beginning of this chapter for the 87 following script to work.</para> 88 89 <screen><userinput remap="install">bash &udev-lfs;/init-net-rules.sh</userinput></screen> 90 91 <para>Do some cleanup:</para> 92 93 <screen><userinput remap="install">rm -fv /usr/include/{uuid,blkid} 94 unset LD_LIBRARY_PATH</userinput></screen> 149 <screen><userinput remap="install">make LD_LIBRARY_PATH=/tools/lib install</userinput></screen> 150 151 <para>Move NSS myhostname library to <filename 152 class="directory">/lib</filename>:</para> 153 154 <screen><userinput remap="install">mv -v /usr/lib/libnss_myhostname.so.2 /lib</userinput></screen> 155 156 <para>Remove an unnecessary directory:</para> 157 158 <screen><userinput remap="install">rm -rfv /usr/lib/rpm</userinput></screen> 159 160 <para>Create the Sysvinit compatibility symlinks, and move some man pages 161 and a library that conflict with <xref linkend="ch-system-sysvinit"/> so 162 both systems can be installed side-by-side:</para> 163 164 <screen><userinput remap="install">for tool in runlevel reboot shutdown poweroff halt telinit; do 165 ln -sfv ../bin/systemctl /sbin/${tool}-systemd 166 mv -v /usr/share/man/man8/${tool}.8 /usr/share/man/man8/${tool}-systemd.8 167 done 168 169 ln -sfv ../lib/systemd/systemd /sbin/init-systemd 170 mv -v /etc/init.d /etc/init.d-systemd</userinput></screen> 171 172 <para>Remove a reference to a non-existent group:</para> 173 174 <screen><userinput remap="install">sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen> 175 176 <para>Create the <filename>/etc/machine-id</filename> file needed by 177 Journald:</para> 178 179 <screen><userinput remap="install">systemd-machine-id-setup</userinput></screen> 180 181 <para>Finally install some LFS specific udev rules:</para> 182 183 <screen><userinput remap="install">tar -xf ../&udev-lfs-version;.tar.bz2 184 make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen> 95 185 96 186 </sect2> 97 187 98 <sect2 id="contents- udev" role="content">99 <title>Contents of Udev</title>188 <sect2 id="contents-systemd" role="content"> 189 <title>Contents of Systemd</title> 100 190 101 191 <segmentedlist> … … 105 195 106 196 <seglistitem> 107 <seg>accelerometer, ata_id, cdrom_id, collect, mtd_probe, 108 scsi_id, v4l_id, udevadm, and udevd</seg> 109 110 <seg>libudev.so</seg> 111 112 <seg>/etc/udev, /lib/udev, /lib/firmware, /usr/share/doc/udev</seg> 197 <seg>bootctl, busctl, halt, hostnamectl, init, journalctl, kernel-install, 198 localectl, loginctl, machinectl, poweroff, reboot, runlevel, shutdown, 199 systemctl, systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls, 200 systemd-cgtop, systemd-coredumpctl, systemd-delta, systemd-detect-virt, 201 systemd-inhibit, systemd-machine-id-setup, systemd-notify, systemd-nspawn, 202 systemd-run, systemd-stdio-bridge, systemd-tmpfiles, systemd-tty-ask-password-agent, 203 telinit, timedatectl, and udevadm</seg> 204 205 <seg>libnss_myhostname.so.2, libsystemd.so, libudev.so</seg> 206 <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d, 207 /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev, 208 /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd, 209 /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d, 210 /usr/lib/sysctl.d, /usr/lib/systemd, /usr/lib/tmpfiles.d, 211 /usr/share/doc/systemd-&systemd-version;, /usr/share/systemd, 212 /var/lib/systemd, /var/log/journal</seg> 113 213 </seglistitem> 114 214 </segmentedlist> … … 119 219 <?dbhtml list-presentation="table"?> 120 220 121 <varlistentry id="ata_id"> 122 <term><command>ata_id</command></term> 123 <listitem> 124 <para>Provides Udev with a unique string and 125 additional information (uuid, label) for an ATA drive</para> 126 <indexterm zone="ch-system-udev ata_id"> 127 <primary sortas="b-ata_id">ata_id</primary> 128 </indexterm> 129 </listitem> 130 </varlistentry> 131 132 <varlistentry id="cdrom_id"> 133 <term><command>cdrom_id</command></term> 134 <listitem> 135 <para>Provides Udev with the capabilities of a 136 CD-ROM or DVD-ROM drive</para> 137 <indexterm zone="ch-system-udev cdrom_id"> 138 <primary sortas="b-cdrom_id">cdrom_id</primary> 139 </indexterm> 140 </listitem> 141 </varlistentry> 142 143 <varlistentry id="collect"> 144 <term><command>collect</command></term> 145 <listitem> 146 <para>Given an ID for the current uevent and a list of 147 IDs (for all target uevents), registers the current ID 148 and indicates whether all target IDs have been registered</para> 149 <indexterm zone="ch-system-udev collect"> 150 <primary sortas="b-collect">collect</primary> 151 </indexterm> 152 </listitem> 153 </varlistentry> 154 155 <varlistentry id="scsi_id"> 156 <term><command>scsi_id</command></term> 157 <listitem> 158 <para>Provides Udev with a unique SCSI identifier 159 based on the data returned from sending a SCSI INQUIRY command to 160 the specified device</para> 161 <indexterm zone="ch-system-udev scsi_id"> 162 <primary sortas="b-scsi_id">scsi_id</primary> 221 <varlistentry id="bootctl"> 222 <term><command>bootctl</command></term> 223 <listitem> 224 <para>used to query the firmware and boot manager settings.</para> 225 <indexterm zone="ch-system-systemd bootctl"> 226 <primary sortas="b-bootctl">bootctl</primary> 227 </indexterm> 228 </listitem> 229 </varlistentry> 230 231 <varlistentry id="busctl"> 232 <term><command>busctl</command></term> 233 <listitem> 234 <para>used to introspect and monitor the D-Bus bus.</para> 235 <indexterm zone="ch-system-systemd busctl"> 236 <primary sortas="b-busctl">busctl</primary> 237 </indexterm> 238 </listitem> 239 </varlistentry> 240 241 <varlistentry id="halt"> 242 <term><command>halt</command></term> 243 <listitem> 244 <para>Normally invokes <command>shutdown</command> with the 245 <parameter>-h</parameter> option, except when already in run-level 0, 246 then it tells the kernel to halt the system; it notes in the 247 file <filename>/var/log/wtmp</filename> that the system is being 248 brought down.</para> 249 <indexterm zone="ch-system-systemd halt"> 250 <primary sortas="b-halt">halt</primary> 251 </indexterm> 252 </listitem> 253 </varlistentry> 254 255 <varlistentry id="hostnamectl"> 256 <term><command>hostnamectl</command></term> 257 <listitem> 258 <para>used to query and change the system hostname and related 259 settings.</para> 260 <indexterm zone="ch-system-systemd hostnamectl"> 261 <primary sortas="b-hostnamectl">hostnamectl</primary> 262 </indexterm> 263 </listitem> 264 </varlistentry> 265 266 <varlistentry id="init"> 267 <term><command>init</command></term> 268 <listitem> 269 <para>The first process to be started when the kernel has initialized 270 the hardware which takes over the boot process and starts all the 271 proceses it is instructed to.</para> 272 <indexterm zone="ch-system-systemd init"> 273 <primary sortas="b-init">init</primary> 274 </indexterm> 275 </listitem> 276 </varlistentry> 277 278 <varlistentry id="journalctl"> 279 <term><command>journalctl</command></term> 280 <listitem> 281 <para>used to query the contents of the Systemd Journal.</para> 282 <indexterm zone="ch-system-systemd journalctl"> 283 <primary sortas="b-journalctl">journalctl</primary> 284 </indexterm> 285 </listitem> 286 </varlistentry> 287 288 <varlistentry id="kernel-install"> 289 <term><command>kernel-install</command></term> 290 <listitem> 291 <para>used to add and remove kernel and initramfs images to and 292 from /boot.</para> 293 <indexterm zone="ch-system-systemd kernel-install"> 294 <primary sortas="b-kernel-install">kernel-install</primary> 295 </indexterm> 296 </listitem> 297 </varlistentry> 298 299 <varlistentry id="localectl"> 300 <term><command>localectl</command></term> 301 <listitem> 302 <para>used to query and change the system locale and keyboard layout 303 settings.</para> 304 <indexterm zone="ch-system-systemd localectl"> 305 <primary sortas="b-localectl">localectl</primary> 306 </indexterm> 307 </listitem> 308 </varlistentry> 309 310 <varlistentry id="loginctl"> 311 <term><command>loginctl</command></term> 312 <listitem> 313 <para>used to introspect and control the state of the Systemd Login 314 Manager.</para> 315 <indexterm zone="ch-system-systemd loginctl"> 316 <primary sortas="b-loginctl">loginctl</primary> 317 </indexterm> 318 </listitem> 319 </varlistentry> 320 321 <varlistentry id="machinectl"> 322 <term><command>machinectl</command></term> 323 <listitem> 324 <para>used to introspect and control the state of the Systemd Virtual 325 Machine and Container Registration Manager</para> 326 <indexterm zone="ch-system-systemd machinectl"> 327 <primary sortas="b-machinectl">machinectl</primary> 328 </indexterm> 329 </listitem> 330 </varlistentry> 331 332 <varlistentry id="poweroff"> 333 <term><command>poweroff</command></term> 334 <listitem> 335 <para>Tells the kernel to halt the system and switch off the computer 336 (see <command>halt</command>).</para> 337 <indexterm zone="ch-system-systemd poweroff"> 338 <primary sortas="b-poweroff">poweroff</primary> 339 </indexterm> 340 </listitem> 341 </varlistentry> 342 343 <varlistentry id="reboot"> 344 <term><command>reboot</command></term> 345 <listitem> 346 <para>Tells the kernel to reboot the system (see 347 <command>halt</command>).</para> 348 <indexterm zone="ch-system-systemd reboot"> 349 <primary sortas="b-reboot">reboot</primary> 350 </indexterm> 351 </listitem> 352 </varlistentry> 353 354 <varlistentry id="runlevel"> 355 <term><command>runlevel</command></term> 356 <listitem> 357 <para>Reports the previous and the current run-level, as noted in the 358 last run-level record in <filename>/var/run/utmp</filename>.</para> 359 <indexterm zone="ch-system-systemd runlevel"> 360 <primary sortas="b-runlevel">runlevel</primary> 361 </indexterm> 362 </listitem> 363 </varlistentry> 364 365 <varlistentry id="shutdown"> 366 <term><command>shutdown</command></term> 367 <listitem> 368 <para>Brings the system down in a secure way, signaling all processes 369 and notifying all logged-in users.</para> 370 <indexterm zone="ch-system-systemd shutdown"> 371 <primary sortas="b-shutdown">shutdown</primary> 372 </indexterm> 373 </listitem> 374 </varlistentry> 375 376 <varlistentry id="systemctl"> 377 <term><command>systemctl</command></term> 378 <listitem> 379 <para>used to introspect and control the state of the Systemd system and 380 service manager.</para> 381 <indexterm zone="ch-system-systemd systemctl"> 382 <primary sortas="b-systemctl">systemctl</primary> 383 </indexterm> 384 </listitem> 385 </varlistentry> 386 387 <varlistentry id="systemd-analyze"> 388 <term><command>systemd-analyze</command></term> 389 <listitem> 390 <para>used to determine system boot-up performance of the current boot. 391 </para> 392 <indexterm zone="ch-system-systemd systemd-analyze"> 393 <primary sortas="b-systemd-analyze">systemd-analyze</primary> 394 </indexterm> 395 </listitem> 396 </varlistentry> 397 398 <varlistentry id="systemd-ask-password"> 399 <term><command>systemd-ask-password</command></term> 400 <listitem> 401 <para>used to query a system password or passphrase from the user, using a 402 question message specified on the command line.</para> 403 <indexterm zone="ch-system-systemd systemd-ask-password"> 404 <primary sortas="b-systemd-ask-password">systemd-ask-password</primary> 405 </indexterm> 406 </listitem> 407 </varlistentry> 408 409 <varlistentry id="systemd-cat"> 410 <term><command>systemd-cat</command></term> 411 <listitem> 412 <para>used to connect STDOUT and STDERR of a process with the Journal. 413 </para> 414 <indexterm zone="ch-system-systemd systemd-cat"> 415 <primary sortas="b-systemd-cat">systemd-cat</primary> 416 </indexterm> 417 </listitem> 418 </varlistentry> 419 420 <varlistentry id="systemd-cgls"> 421 <term><command>systemd-cgls</command></term> 422 <listitem> 423 <para>recursively shows the contents of the selected Linux control group 424 hierarchy in a tree.</para> 425 <indexterm zone="ch-system-systemd systemd-cgls"> 426 <primary sortas="b-systemd-cgls">systemd-cgls</primary> 427 </indexterm> 428 </listitem> 429 </varlistentry> 430 431 <varlistentry id="systemd-cgtop"> 432 <term><command>systemd-cgtop</command></term> 433 <listitem> 434 <para>shows the top control groups of the local Linux control group hierarchy, 435 ordered by their CPU, memory and disk I/O load.</para> 436 <indexterm zone="ch-system-systemd systemd-cgtop"> 437 <primary sortas="b-systemd-cgtop">systemd-cgtop</primary> 438 </indexterm> 439 </listitem> 440 </varlistentry> 441 442 <varlistentry id="systemd-coredumpctl"> 443 <term><command>systemd-coredumpctl</command></term> 444 <listitem> 445 <para>used to retrieve coredumps from the Systemd Journal</para> 446 <indexterm zone="ch-system-systemd systemd-coredumpctl"> 447 <primary sortas="b-systemd-coredumpctl">systemd-coredumpctl</primary> 448 </indexterm> 449 </listitem> 450 </varlistentry> 451 452 <varlistentry id="systemd-delta"> 453 <term><command>systemd-delta</command></term> 454 <listitem> 455 <para>used to identify and compare configuration files in 456 <filename class="directory">/etc</filename> that override default 457 counterparts in <filename class="directory">/usr</filename>.</para> 458 <indexterm zone="ch-system-systemd systemd-delta"> 459 <primary sortas="b-systemd-delta">systemd-delta</primary> 460 </indexterm> 461 </listitem> 462 </varlistentry> 463 464 <varlistentry id="systemd-detect-virt"> 465 <term><command>systemd-detect-virt</command></term> 466 <listitem> 467 <para>detects execution in a virtualized environment.</para> 468 <indexterm zone="ch-system-systemd systemd-detect-virt"> 469 <primary sortas="b-systemd-detect-virt">systemd-detect-virt</primary> 470 </indexterm> 471 </listitem> 472 </varlistentry> 473 474 <varlistentry id="systemd-inhibit"> 475 <term><command>systemd-inhibit</command></term> 476 <listitem> 477 <para>used to execute a program with a shutdown, sleep or idle inhibitor lock 478 taken.</para> 479 <indexterm zone="ch-system-systemd systemd-inhibit"> 480 <primary sortas="b-systemd-inhibit">systemd-inhibit</primary> 481 </indexterm> 482 </listitem> 483 </varlistentry> 484 485 <varlistentry id="systemd-machine-id-setup"> 486 <term><command>systemd-machine-id-setup</command></term> 487 <listitem> 488 <para>used by system installer tools to initialize the machine ID stored in 489 <filename>/etc/machine-id</filename> at install time with a randomly 490 generated ID.</para> 491 <indexterm zone="ch-system-systemd systemd-machine-id-setup"> 492 <primary sortas="b-systemd-machine-id-setup">systemd-machine-id-setup</primary> 493 </indexterm> 494 </listitem> 495 </varlistentry> 496 497 <varlistentry id="systemd-notify"> 498 <term><command>systemd-notify</command></term> 499 <listitem> 500 <para>used by daemon scripts to notify the init system about status changes. 501 </para> 502 <indexterm zone="ch-system-systemd systemd-notify"> 503 <primary sortas="b-systemd-notify">systemd-notify</primary> 504 </indexterm> 505 </listitem> 506 </varlistentry> 507 508 <varlistentry id="systemd-nspawn"> 509 <term><command>systemd-nspawn</command></term> 510 <listitem> 511 <para>used to run a command or OS in a light-weight namespace container.</para> 512 <indexterm zone="ch-system-systemd systemd-nspawn"> 513 <primary sortas="b-systemd-nspawn">systemd-nspawn</primary> 514 </indexterm> 515 </listitem> 516 </varlistentry> 517 518 <varlistentry id="systemd-run"> 519 <term><command>systemd-run</command></term> 520 <listitem> 521 <para>used to create and start a transient .service or a .scope unit and 522 run the specified command in it.</para> 523 <indexterm zone="ch-system-systemd systemd-run"> 524 <primary sortas="b-systemd-run">systemd-run</primary> 525 </indexterm> 526 </listitem> 527 </varlistentry> 528 529 <!-- <varlistentry id="systemd-stdio-bridge"> 530 <term><command>systemd-stdio-bridge</command></term> 531 <listitem> 532 <para>To be completed</para> 533 <indexterm zone="ch-system-systemd systemd-stdio-bridge"> 534 <primary sortas="b-systemd-stdio-bridge">systemd-stdio-bridge</primary> 535 </indexterm> 536 </listitem> 537 </varlistentry> --> 538 539 <varlistentry id="systemd-tmpfiles"> 540 <term><command>systemd-tmpfiles</command></term> 541 <listitem> 542 <para>creates, deletes and cleans up volatile and temporary files and directories, 543 based on the configuration file format and location specified in 544 <filename class="directory">tmpfiles.d</filename> directories.</para> 545 <indexterm zone="ch-system-systemd systemd-tmpfiles"> 546 <primary sortas="b-systemd-tmpfiles">systemd-tmpfiles</primary> 547 </indexterm> 548 </listitem> 549 </varlistentry> 550 551 <varlistentry id="systemd-tty-ask-password-agent"> 552 <term><command>systemd-tty-ask-password-agent</command></term> 553 <listitem> 554 <para>used to list or process pending Systemd password requests</para> 555 <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent"> 556 <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary> 557 </indexterm> 558 </listitem> 559 </varlistentry> 560 561 <varlistentry id="telinit"> 562 <term><command>telinit</command></term> 563 <listitem> 564 <para>Tells <command>init</command> which run-level to change to.</para> 565 <indexterm zone="ch-system-systemd telinit"> 566 <primary sortas="b-telinit">telinit</primary> 567 </indexterm> 568 </listitem> 569 </varlistentry> 570 571 <varlistentry id="timedatectl"> 572 <term><command>timedatectl</command></term> 573 <listitem> 574 <para>used to query and change the system clock and its settings. 575 </para> 576 <indexterm zone="ch-system-systemd timedatectl"> 577 <primary sortas="b-timedatectl">timedatectl</primary> 163 578 </indexterm> 164 579 </listitem> … … 168 583 <term><command>udevadm</command></term> 169 584 <listitem> 170 <para>Generic udev administration tool: controls the udevd daemon,585 <para>Generic Udev administration tool: controls the udevd daemon, 171 586 provides info from the Udev database, monitors uevents, waits for 172 587 uevents to finish, tests Udev configuration, and triggers uevents 173 for a given device </para>174 <indexterm zone="ch-system- udevudevadm">588 for a given device.</para> 589 <indexterm zone="ch-system-systemd udevadm"> 175 590 <primary sortas="b-udevadm">udevadm</primary> 176 591 </indexterm> … … 178 593 </varlistentry> 179 594 180 <varlistentry id="udevd"> 181 <term><command>udevd</command></term> 182 <listitem> 183 <para>A daemon that listens for uevents on the netlink socket, 184 creates devices and runs the configured external programs in 185 response to these uevents</para> 186 <indexterm zone="ch-system-udev udevd"> 187 <primary sortas="b-udevd">udevd</primary> 595 <varlistentry id="libsystemd"> 596 <term><filename class="libraryfile">libsystemd</filename></term> 597 <listitem> 598 <para>Systemd utility library.</para> 599 <indexterm zone="ch-system-systemd libsystemd"> 600 <primary sortas="c-libsystemd">libsystemd</primary> 188 601 </indexterm> 189 602 </listitem> … … 193 606 <term><filename class="libraryfile">libudev</filename></term> 194 607 <listitem> 195 <para>A library interface to udev device information</para>196 <indexterm zone="ch-system- udevlibudev">608 <para>A library to access Udev device information.</para> 609 <indexterm zone="ch-system-systemd libudev"> 197 610 <primary sortas="c-libudev">libudev</primary> 198 611 </indexterm> … … 200 613 </varlistentry> 201 614 202 <varlistentry id="etc-udev">203 <term><filename class="directory">/etc/udev</filename></term>204 <listitem>205 <para>Contains Udev configuration files,206 device permissions, and rules for device naming</para>207 <indexterm zone="ch-system-udev etc-udev">208 <primary sortas="e-/etc/udev">/etc/udev</primary>209 </indexterm>210 </listitem>211 </varlistentry>212 213 615 </variablelist> 214 616 -
chapter06/sysvinit.xml
r008436e rcba2d4e 83 83 <screen><userinput remap="install">make -C src install</userinput></screen> 84 84 85 <para>Move files that have a name conflict with <xref linkend="ch-system-systemd"/> 86 so that both packages can be installed side-by-side:</para> 87 88 <screen><userinput remap="install">for p in init halt poweroff reboot runlevel shutdown telinit; do 89 mv -v /sbin/$p /sbin/$p-sysv 90 mv -v /usr/share/man/man8/$p.8 /usr/share/man/man8/$p-sysv.8 91 done</userinput></screen> 92 85 93 </sect2> 86 94 … … 123 131 </varlistentry> 124 132 125 <varlistentry id="halt ">133 <varlistentry id="halt-sysv"> 126 134 <term><command>halt</command></term> 127 135 <listitem> … … 131 139 file <filename>/var/log/wtmp</filename> that the system is being 132 140 brought down</para> 133 <indexterm zone="ch-system-sysvinit halt ">141 <indexterm zone="ch-system-sysvinit halt-sysv"> 134 142 <primary sortas="b-halt">halt</primary> 135 143 </indexterm> … … 137 145 </varlistentry> 138 146 139 <varlistentry id="init ">147 <varlistentry id="init-sysv"> 140 148 <term><command>init</command></term> 141 149 <listitem> … … 143 151 the hardware which takes over the boot process and starts all the 144 152 proceses it is instructed to</para> 145 <indexterm zone="ch-system-sysvinit init ">153 <indexterm zone="ch-system-sysvinit init-sysv"> 146 154 <primary sortas="b-init">init</primary> 147 155 </indexterm> … … 161 169 </varlistentry> 162 170 163 <varlistentry id="poweroff ">171 <varlistentry id="poweroff-sysv"> 164 172 <term><command>poweroff</command></term> 165 173 <listitem> 166 174 <para>Tells the kernel to halt the system and switch off the computer 167 175 (see <command>halt</command>)</para> 168 <indexterm zone="ch-system-sysvinit poweroff ">176 <indexterm zone="ch-system-sysvinit poweroff-sysv"> 169 177 <primary sortas="b-poweroff">poweroff</primary> 170 178 </indexterm> … … 172 180 </varlistentry> 173 181 174 <varlistentry id="reboot ">182 <varlistentry id="reboot-sysv"> 175 183 <term><command>reboot</command></term> 176 184 <listitem> 177 185 <para>Tells the kernel to reboot the system (see 178 186 <command>halt</command>)</para> 179 <indexterm zone="ch-system-sysvinit reboot ">187 <indexterm zone="ch-system-sysvinit reboot-sysv"> 180 188 <primary sortas="b-reboot">reboot</primary> 181 189 </indexterm> … … 183 191 </varlistentry> 184 192 185 <varlistentry id="runlevel ">193 <varlistentry id="runlevel-sysv"> 186 194 <term><command>runlevel</command></term> 187 195 <listitem> 188 196 <para>Reports the previous and the current run-level, as noted in the 189 197 last run-level record in <filename>/var/run/utmp</filename></para> 190 <indexterm zone="ch-system-sysvinit runlevel ">198 <indexterm zone="ch-system-sysvinit runlevel-sysv"> 191 199 <primary sortas="b-runlevel">runlevel</primary> 192 200 </indexterm> … … 194 202 </varlistentry> 195 203 196 <varlistentry id="shutdown ">204 <varlistentry id="shutdown-sysv"> 197 205 <term><command>shutdown</command></term> 198 206 <listitem> 199 207 <para>Brings the system down in a secure way, signaling all processes 200 208 and notifying all logged-in users</para> 201 <indexterm zone="ch-system-sysvinit shutdown ">209 <indexterm zone="ch-system-sysvinit shutdown-sysv"> 202 210 <primary sortas="b-shutdown">shutdown</primary> 203 211 </indexterm> … … 205 213 </varlistentry> 206 214 207 <varlistentry id="telinit ">215 <varlistentry id="telinit-sysv"> 208 216 <term><command>telinit</command></term> 209 217 <listitem> 210 218 <para>Tells <command>init</command> which run-level to change to</para> 211 <indexterm zone="ch-system-sysvinit telinit ">219 <indexterm zone="ch-system-sysvinit telinit-sysv"> 212 220 <primary sortas="b-telinit">telinit</primary> 213 221 </indexterm> -
chapter07/bootscripts.xml
r008436e rcba2d4e 24 24 <title/> 25 25 26 <para>The LFS-Bootscripts package contains a set of scripts to start/stop the 27 LFS system at bootup/shutdown.</para> 26 <para>The LFS-Bootscripts package contains a set of scripts to start/stop 27 the LFS system at bootup/shutdown. The networking systemd unit file is 28 also installed.</para> 28 29 29 30 <segmentedlist> … … 52 53 <segmentedlist> 53 54 <segtitle>Installed scripts</segtitle> 55 <segtitle>Installed unit</segtitle> 54 56 <segtitle>Installed directories</segtitle> 55 57 … … 59 61 sendsignals, setclock, ipv4-static, swap, sysctl, sysklogd, template, 60 62 udev, and udev_retry</seg> 63 <seg>ifupdown@.service</seg> 61 64 <seg>/etc/rc.d, /etc/init.d (symbolic link), /etc/sysconfig, 62 65 /lib/services, /lib/lsb (symbolic link)</seg> -
chapter07/chapter07.xml
r008436e rcba2d4e 10 10 <?dbhtml filename="chapter07.html"?> 11 11 12 <title>S etting Up SystemBootscripts</title>12 <title>System Configuration and Bootscripts</title> 13 13 14 14 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/> 15 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/> 15 16 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/> 16 17 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/> 17 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/> 18 19 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/> 19 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/>20 20 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/> 21 21 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/> -
chapter07/hostname.xml
r008436e rcba2d4e 16 16 </indexterm> 17 17 18 <para> Part of the job of the <command>localnet</command> script is setting the19 system's hostname. This needs to be configured in the20 <filename>/etc/sysconfig/network</filename> file.</para>18 <para>Durein gthe boot process, both Systemd and System V use the same 19 file for establixhg the system's hostname.This needs to be configured by 20 creating <filename>/etc/hostname</filename>.</para> 21 21 22 <para>Create the <filename>/etc/ sysconfig/network</filename> file and enter a22 <para>Create the <filename>/etc/hostname</filename> file and enter a 23 23 hostname by running:</para> 24 24 25 <screen><userinput>echo " HOSTNAME=<replaceable><lfs></replaceable>" > /etc/sysconfig/network</userinput></screen>25 <screen><userinput>echo "<replaceable><lfs></replaceable>" > /etc/hostname</userinput></screen> 26 26 27 27 <para><replaceable><lfs></replaceable> needs to be replaced with the name given -
chapter07/introduction.xml
r008436e rcba2d4e 11 11 <title>Introduction</title> 12 12 13 <para>This chapter discusses configuration files and boot scripts. 14 First, the general configuration files needed to set up networking are 15 presented.</para> 16 17 <itemizedlist> 18 <listitem> 19 <para><xref linkend="ch-scripts-network" role="."/></para> 20 </listitem> 21 <listitem> 22 <para><xref linkend="ch-scripts-hosts" role="."/></para> 23 </listitem> 24 </itemizedlist> 25 26 <para>Second, issues that affect the proper setup of devices are 27 discussed.</para> 28 29 <itemizedlist> 30 <listitem> 31 <para><xref linkend="ch-scripts-udev" role="."/></para> 32 </listitem> 33 <listitem> 34 <para><xref linkend="ch-scripts-symlinks" role="."/></para> 35 </listitem> 36 </itemizedlist> 37 38 <para>The next sections detail how to install and configure the LFS system 39 scripts needed during the boot process. Most of these scripts will work 40 without modification, but a few require additional configuration files 41 because they deal with hardware-dependent information.</para> 42 43 <para>System-V style init scripts are employed in this book because they are 44 widely used and relatively simple. For additional options, a hint detailing 45 the BSD style init setup is available at <ulink 46 url="&hints-root;bsd-init.txt"/>. Searching the LFS mailing lists for 47 <quote>depinit</quote>, <quote>upstart</quote>, or <quote>systemd</quote> 48 will also offer additional information.</para> 49 50 <para>If using an alternative style of init scripts, skip these sections.</para> 51 52 <para>A listing of the boot scripts are found in <xref linkend="scripts" 53 role="."/>.</para> 54 55 56 <itemizedlist> 57 <listitem> 58 <para><xref linkend="ch-scripts-bootscripts" role="."/></para> 59 </listitem> 60 <listitem> 61 <para><xref linkend="ch-scripts-usage" role="."/></para> 62 </listitem> 63 <listitem> 64 <para><xref linkend="ch-scripts-hostname" role="."/></para> 65 </listitem> 66 <listitem> 67 <para><xref linkend="ch-scripts-setclock" role="."/></para> 68 </listitem> 69 <listitem> 70 <para><xref linkend="ch-scripts-console" role="."/></para> 71 </listitem> 72 <listitem> 73 <para><xref linkend="ch-scripts-sysklogd" role="."/></para> 74 </listitem> 75 </itemizedlist> 76 77 78 <para>Finally, there is a brief introduction to the scripts and configuration 79 files used when the user logs into the system.</para> 80 81 <itemizedlist> 82 <listitem> 83 <para><xref linkend="ch-scripts-profile" role="."/></para> 84 </listitem> 85 <listitem> 86 <para><xref linkend="ch-scripts-inputrc" role="."/></para> 87 </listitem> 88 </itemizedlist> 89 13 <para>Booting a Linux system involves several tasks. The process must 14 mount both virtual and real file systems, initialize devices, activate swap, 15 check file systems for integrity, mount any swap partitions or files, set 16 the system clock, bring up networking, start any daemons required by the 17 system, and accomplish any other custom tasks needed by the user. This 18 process must be organized to ensure the tasks are performed in the correct 19 order but, at the same time, be executed as fast as possible.</para> 20 21 <para>In the packages that were installed in Chapter 6, there were two 22 different boot systems installed. LFS provides the ability to easily 23 select which system the user wants to use and to compare and contrast the 24 two systems by actually running each system on the local computer. The 25 advantages and disadvantages of these systems is presented below.</para> 26 27 <sect2 id='sysv-desc'> 28 <title>System V</title> 29 30 <para>System V is the classic boot process that has been used in Unix and 31 Unix-like systems such as Linux since about 1983. It consists of a small 32 program, <command>init</command>, that sets up basic programs such as 33 <command>login</command> (via getty) and runs a script. This script, 34 usually named <command>rc</command>, controls the execution of a set of 35 additional scripts that perform the tasks required to initialize the 36 system.</para> 37 38 <para>The <command>init</command> program is controlled by the 39 <filename>/etc/inittab</filename> file and is organized into run levels that 40 can be run by the user:</para> 41 42 <itemizedlist> 43 <listitem><para>0 — halt</para></listitem> 44 <listitem><para>1 — Single user mode</para></listitem> 45 <listitem><para>2 — Multiuser, without networking</para></listitem> 46 <listitem><para>3 — Full multiuser mode</para></listitem> 47 <listitem><para>4 — User definable</para></listitem> 48 <listitem><para>5 — Full multiuser mode with display manager</para></listitem> 49 <listitem><para>6 — reboot</para></listitem> 50 </itemizedlist> 51 52 <para>The usual default run level is 3 or 5.</para> 53 54 <bridgehead renderas="sect3">Advantages</bridgehead> 55 56 <itemizedlist> 57 <listitem> 58 <para>Established, well understood system.</para> 59 </listitem> 60 61 <listitem> 62 <para>Easy to customize.</para> 63 </listitem> 64 65 </itemizedlist> 66 67 68 <bridgehead renderas="sect3">Disadvantages</bridgehead> 69 70 <itemizedlist> 71 <listitem> 72 <para>Slower to boot. A medium speed base LFS system 73 takes 8-12 seconds where the boot time is measured from the 74 first kernel message to the login prompt. Network 75 connectivity is typically established about 2 seconds 76 after the login prompt.</para> 77 </listitem> 78 79 <listitem> 80 <para>Serial processing of boot tasks. This is related to the previous 81 point. A delay in any process such as a file system check, will 82 delay the entire boot process.</para> 83 </listitem> 84 85 <listitem> 86 <para>Does not directly support advanced features like 87 control groups (cgroups), and per-user fair share scheduling.</para> 88 </listitem> 89 90 <listitem> 91 <para>Adding scripts requires manual, static sequencing decisions.</para> 92 </listitem> 93 94 </itemizedlist> 95 96 </sect2> 97 98 <sect2 id='sysd-desc'> 99 <title>Systemd</title> 100 101 <para>Systemd is a group of interconnected programs that handles system and 102 individual process requests. It provides a dependency system between 103 various entities called "units". It automatically addresses dependencies 104 between units and can execute several startup tasks in parallel. It 105 provides login, inetd, logging, time, and networking services. </para> 106 107 <bridgehead renderas="sect3">Advantages</bridgehead> 108 109 <itemizedlist> 110 <listitem> 111 <para>Used on many established distributions by default.</para> 112 </listitem> 113 114 <listitem> 115 <para>There is extensive documentation. 116 See <ulink url="http://www.freedesktop.org/wiki/Software/systemd/"/>.</para> 117 </listitem> 118 119 <listitem> 120 <para>Parallel execution of boot processes. A medium speed 121 base LFS system takes 6-10 seconds from kernel start to a 122 login prompt. Network connectivity is typically established 123 about 2 seconds after the login prompt. More complex startup 124 procedures may show a greater speedup when compared to System V.</para> 125 </listitem> 126 127 <listitem> 128 <para>Implements advanced features such as control groups to 129 manage related processes.</para> 130 </listitem> 131 132 <listitem> 133 <para>Maintains backward compatibility with System V programs 134 and scripts.</para> 135 </listitem> 136 </itemizedlist> 137 138 <bridgehead renderas="sect3">Disadvantages</bridgehead> 139 140 <itemizedlist> 141 <listitem> 142 <para>There is a substantial learning curve.</para> 143 </listitem> 144 145 <listitem> 146 <para>Some advanced features such as dbus or cgroups cannot be 147 disabled if they are not otherwise needed.</para> 148 </listitem> 149 150 <listitem> 151 <para>Although implemented as several executable programs 152 the user cannot choose to implement only the portions desired.</para> 153 </listitem> 154 155 <listitem> 156 <para>Due to the nature of using compiled programs, systemd is 157 more difficult to debug.</para> 158 </listitem> 159 160 <listitem> 161 <para>Logging is done in a binary format. Extra tools must 162 be used to process logs or additional processes must be implemented 163 to duplicate traditional logging programs.</para> 164 </listitem> 165 166 </itemizedlist> 167 168 </sect2> 169 170 <sect2 id='sysv'> 171 <title>Selecting a Boot Method</title> 172 173 <para>Selecting a boot method in LFS is relatively easy. 174 Both systems are installed side-by-side. The only task needed is to 175 ensure the files that are needed by the system have the correct names. 176 The following scripts do that.</para> 177 178 <screen><userinput remap="install">cat > /usr/local/sbin/set-systemd << "EOF" 179 #! /bin/bash 180 181 ln -svfn init-systemd /sbin/init 182 ln -svfn init.d-systemd /etc/init.d 183 184 for tool in halt poweroff reboot runlevel shutdown telinit; do 185 ln -sfvn $(tool}-systemd /sbin/${tool} 186 ln -svfn ${tool}-systemd.8 /usr/share/man/man8/${tool}.8 187 done 188 189 echo "Now reboot with /sbin/reboot-sysv" 190 EOF 191 192 chmod 0744 /usr/local/sbin/set-systemd 193 194 cat > /usr/local/sbin/set-sysv << "EOF" 195 ln -sfvn init-sysv /sbin/init 196 ln -svfn init.d-sysv /etc/init.d 197 198 for tool in halt poweroff reboot runlevel shutdown telinit; do 199 ln -sfvn ${tool}-sysv /sbin/${tool} 200 ln -svfn ${tool}-sysv.8 /usr/share/man/man8/${tool}.8 201 done 202 203 echo "Now reboot with /sbin/reboot-systemd" 204 EOF 205 206 chmod 0744 /usr/local/sbin/set-sysv</userinput></screen> 207 208 <para>Now set the desired boot system. The default is System V:</para> 209 210 <screen><userinput remap="install">/usr/local/sbin/set-sysv</userinput></screen> 211 212 <para>Changing the boot system can be done at any time by running the 213 appropriate script above and rebooting.</para> 214 215 </sect2> 90 216 91 217 </sect1> -
chapter07/network.xml
r008436e rcba2d4e 43 43 to network cards based on their MAC address.</para> 44 44 45 <para>The rules were pre-generated in the build instructions for 46 <application>udev (systemd)</application> in the last chapter. Inspect the 45 <para>If using the traditional network interface names such as eth0 is desired, 46 generate a custom Udev rule:</para> 47 48 <screen><userinput>bash /lib/udev/init-net-rules.sh</userinput></screen> 49 50 <para> Now, inspect the 47 51 <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to 48 52 find out which name was assigned to which network device:</para> … … 123 127 class="directory">/etc/sysconfig/</filename>. This directory should 124 128 contain a file for each interface to be configured, such as 125 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is 126 meaningful to the administrator such as the device name (e.g. eth0). 127 Inside this file are attributes to this interface, such as its IP 128 address(es), subnet masks, and so forth. It is necessary that 129 the stem of the filename be <emphasis>ifconfig</emphasis>.</para> 129 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is required to 130 be a Network Card Interface name (e.g. eth0). Inside this file are 131 attributes to this interface, such as its IP address(es), subnet masks, and 132 so forth. It is necessary that the stem of the filename be 133 <emphasis>ifconfig</emphasis>.</para> 134 135 <note><para>If the procedure in the previous section was not used, Udev 136 will assign network card interface names based on system physical 137 characteristics such as enp2s1. If you are not sure what your interface 138 name is, you can always run <command>ip link</command> after you have 139 booted your system. Again, it is important that ifconfig.xyz is named 140 after correct network card interface name (e.g. ifconfig.enp2s1 or 141 ifconfig.eth0) or your network interface will not be initialized during 142 the boot process.</para></note> 130 143 131 144 <para>The following command creates a sample file for the … … 137 150 IFACE=eth0 138 151 SERVICE=ipv4-static 139 IP=192.168.1. 1140 GATEWAY=192.168.1. 2152 IP=192.168.1.2 153 GATEWAY=192.168.1.1 141 154 PREFIX=24 142 155 BROADCAST=192.168.1.255</literal> … … 147 160 148 161 <para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the 149 network script will bring up the Network Interface Card (NIC) during162 System V network script will bring up the Network Interface Card (NIC) during 150 163 booting of the system. If set to anything but <quote>yes</quote> the NIC 151 164 will be ignored by the network script and not be automatically brought up. … … 182 195 </sect2> 183 196 197 <sect2 id="systemd-net-enable"> 198 <title>Configuring the Network Interface Card at boot (systemd)</title> 199 200 <para>Enabling of the network interface card configuration 201 in systemd is done per interface. To enable network interface card 202 configuration at boot, run:</para> 203 204 <screen><userinput>systemctl enable ifupdown@eth0</userinput></screen> 205 206 <para>To disable a previously enabled network interface 207 card configuration at boot, run:</para> 208 209 <screen><userinput>systemctl disable ifupdown@eth0</userinput></screen> 210 211 <para>To manually start the network interface card configuration, 212 run:</para> 213 214 <screen><userinput>systemctl start ifupdown@eth0</userinput></screen> 215 216 <para>Replace eth0 with the correct network interface card 217 name as described on the beginning of this page.</para> 218 219 <note><para>The network card can also be started or stopped 220 with the traditional <command>ifup <device></command> or 221 <command>ifdown <device></command> commands.</para></note> 222 223 </sect2> 224 184 225 <sect2 id="resolv.conf"> 185 226 <title>Creating the /etc/resolv.conf File</title> -
chapter07/setclock.xml
r008436e rcba2d4e 6 6 ]> 7 7 8 <sect1 id="ch-scripts- setclock">9 <?dbhtml filename=" setclock.html"?>8 <sect1 id="ch-scripts-clock"> 9 <?dbhtml filename="clock.html"?> 10 10 11 <title>Configuring the setclock Script</title>11 <title>Configuring the System Clock</title> 12 12 13 < indexterm zone="ch-scripts-setclock">14 <primary sortas="d-setclock">setclock</primary>15 <secondary>configuring</secondary></indexterm>13 <para>Procedures for setting the system clock differ between systemd and 14 System V, however the separate procedures do not conflict so both 15 procedures should be accomplished to allow switching between systems.</para> 16 16 17 <para>The <command>setclock</command> script reads the time from the hardware 18 clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor 19 (CMOS) clock. If the hardware clock is set to UTC, this script will convert the 20 hardware clock's time to the local time using the 21 <filename>/etc/localtime</filename> file (which tells the 22 <command>hwclock</command> program which timezone the user is in). There is no 23 way to detect whether or not the hardware clock is set to UTC, so this 24 needs to be configured manually.</para> 17 <sect2 id="ch-scripts-setclock"> 18 <title>System V Clock Configuration</title> 25 19 26 <para>The <command>setclock</command> is run via 27 <application>udev</application> when the kernel detects the hardware 28 capability upon boot. It can also be run manually with the stop parameter to 29 store the system time to the CMOS clock.</para> 20 <indexterm zone="ch-scripts-setclock"> 21 <primary sortas="d-setclock">setclock</primary> 22 <secondary>configuring</secondary></indexterm> 30 23 31 <para>If you cannot remember whether or not the hardware clock is set to UTC, 32 find out by running the <userinput>hwclock --localtime --show</userinput> 33 command. This will display what the current time is according to the hardware 34 clock. If this time matches whatever your watch says, then the hardware clock is 35 set to local time. If the output from <command>hwclock</command> is not local 36 time, chances are it is set to UTC time. Verify this by adding or subtracting 37 the proper amount of hours for the timezone to the time shown by 38 <command>hwclock</command>. For example, if you are currently in the MST 39 timezone, which is also known as GMT -0700, add seven hours to the local 40 time.</para> 24 <para>The <command>setclock</command> script reads the time from the hardware 25 clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor 26 (CMOS) clock. If the hardware clock is set to UTC, this script will convert the 27 hardware clock's time to the local time using the 28 <filename>/etc/localtime</filename> file (which tells the 29 <command>hwclock</command> program which timezone the user is in). There is no 30 way to detect whether or not the hardware clock is set to UTC, so this 31 needs to be configured manually.</para> 41 32 42 <para>Change the value of the <envar>UTC</envar> variable below 43 to a value of <parameter>0</parameter> (zero) if the hardware clock 44 is <emphasis>not</emphasis> set to UTC time.</para> 33 <para>The <command>setclock</command> is run via 34 <application>udev</application> when the kernel detects the hardware 35 capability upon boot. It can also be run manually with the stop parameter to 36 store the system time to the CMOS clock.</para> 45 37 46 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running 47 the following:</para> 38 <para>If you cannot remember whether or not the hardware clock is set to UTC, 39 find out by running the <userinput>hwclock --localtime --show</userinput> 40 command. This will display what the current time is according to the hardware 41 clock. If this time matches whatever your watch says, then the hardware clock is 42 set to local time. If the output from <command>hwclock</command> is not local 43 time, chances are it is set to UTC time. Verify this by adding or subtracting 44 the proper amount of hours for the timezone to the time shown by 45 <command>hwclock</command>. For example, if you are currently in the MST 46 timezone, which is also known as GMT -0700, add seven hours to the local 47 time.</para> 48 49 <para>Change the value of the <envar>UTC</envar> variable below 50 to a value of <parameter>0</parameter> (zero) if the hardware clock 51 is <emphasis>not</emphasis> set to UTC time.</para> 52 53 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running 54 the following:</para> 48 55 49 56 <screen><userinput>cat > /etc/sysconfig/clock << "EOF" … … 59 66 EOF</userinput></screen> 60 67 61 <para>A good hint explaining how to deal with time on LFS is available62 at <ulink url="&hints-root;time.txt"/>. It explains issues such as63 time zones, UTC, and the <envar>TZ</envar> environment variable.</para>68 <para>A good hint explaining how to deal with time on LFS is available 69 at <ulink url="&hints-root;time.txt"/>. It explains issues such as 70 time zones, UTC, and the <envar>TZ</envar> environment variable.</para> 64 71 65 <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set 66 in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note> 72 <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set 73 in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note> 74 75 </sect2> 76 77 <sect2 id="ch-scripts-systemd-clock"> 78 <title>Systemd Clock Configuration</title> 79 80 <indexterm zone="ch-scripts-clock"> 81 <primary sortas="d-clock">clock</primary> 82 <secondary>configuring</secondary></indexterm> 83 84 <para>This section discusses how to configure the 85 <command>systemd-timedated</command> system service, which configures 86 system clock and timezone.</para> 87 88 <para><command>systemd-timedated</command> reads 89 <filename>/etc/adjtime</filename>, and depending on the contents of the file, 90 it sets the clock to either UTC or local time. Create the 91 <filename>/etc/adjtime</filename> file with the following contents <emphasis>if your 92 hardware clock is set to local time</emphasis>:</para> 93 94 <screen role="nodump"><userinput>cat > /etc/adjtime << "EOF" 95 <literal>0.0 0 0.0 96 0 97 LOCAL</literal> 98 EOF</userinput></screen> 99 100 <para>If <filename>/etc/adjtime</filename> isn't present at first boot, 101 <command>systemd-timedated</command> will assume that hardware clock is 102 set to UTC and create the file using that setting.</para> 103 104 <para>You can also use the <command>timedatectl</command> utility to tell 105 <command>systemd-timedated</command> if your hardware clock is set to 106 UTC or local time:</para> 107 108 <screen role="nodump"><userinput>timedatectl set-local-rtc 1</userinput></screen> 109 110 <para><command>timedatectl</command> can also be used to change system time and 111 time zone.</para> 112 113 <para>To change your current system time, issue:</para> 114 115 <screen role="nodump"><userinput>timedatectl set-time YYYY:MM:DD HH:MM:SS</userinput></screen> 116 117 <para>Hardware clock will also be updated accordingly.</para> 118 119 <para>To change your current time zone, issue:</para> 120 121 <screen role="nodump"><userinput>timedatectl set-timezone TIMEZONE</userinput></screen> 122 123 <para>You can get list of available time zones by running:</para> 124 125 <screen role="nodump"><userinput>timedatectl list-timezones</userinput></screen> 126 127 <note><para>Please note that <command>timedatectl</command> command can 128 be used only on a system booted with Systemd.</para></note> 129 130 </sect2> 67 131 68 132 </sect1> -
chapter07/site.xml
r008436e rcba2d4e 17 17 18 18 <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains 19 settings that are automatically set for each boot script. It can alternatively20 set the values specified in the <filename>hostname</filename>,19 settings that are automatically set for each SystemV boot script. It can 20 alternatively set the values specified in the <filename>hostname</filename>, 21 21 <filename>console</filename>, and <filename>clock</filename> files in the 22 22 <filename class='directory'>/etc/sysconfig/</filename> directory. If the -
chapter07/sysklogd.xml
r008436e rcba2d4e 17 17 18 18 <para>The <filename>sysklogd</filename> script invokes the 19 <command>syslogd</command> program with the <parameter>-m 0</parameter>20 option. Thisoption turns off the periodic timestamp mark that19 <command>syslogd</command> program as a part of System V initialization. The 20 <parameter>-m 0</parameter> option turns off the periodic timestamp mark that 21 21 <command>syslogd</command> writes to the log files every 20 minutes by 22 22 default. If you want to turn on this periodic timestamp mark, edit -
chapter07/usage.xml
r008436e rcba2d4e 9 9 <?dbhtml filename="usage.html"?> 10 10 11 <title>How Do TheseBootscripts Work?</title>11 <title>How Do the System V Bootscripts Work?</title> 12 12 13 13 <indexterm zone="ch-scripts-usage"> -
chapter08/kernel.xml
r008436e rcba2d4e 71 71 into account.</para> 72 72 73 <para>Due to recent changes in <application>udev</application>, be sure to 74 select:</para> 75 76 <screen role="nodump">Device Drivers ---> 73 <para>Be sure to enable or disable following features:</para> 74 75 <screen role="nodump">General setup ---> 76 [*] open by fhandle syscalls 77 [*] Control Group support 78 Processor type and features ---> 79 [*] Enable seccomp to safely compute untrusted bytecode 80 Networking support ---> 81 Networking options ---> 82 <*> The IPv6 protocol 83 Device Drivers ---> 77 84 Generic Driver Options ---> 78 Maintain a devtmpfs filesystem to mount at /dev</screen></note> 85 () path to uevent helper 86 [*] Maintain a devtmpfs filesystem to mount at /dev 87 [ ] Fallback user-helper invocation for firmware loading 88 File systems ---> 89 [*] Inotify support for userspace 90 <*> Kernel automounter version 4 support (also supports v3) 91 Pseudo filesystems ---> 92 [*] Tmpfs POSIX Access Control Lists 93 [*] Tmpfs extended attributes</screen></note> 79 94 80 95 <screen role="nodump"><userinput>make LANG=<replaceable><host_LANG_value></replaceable> LC_ALL= menuconfig</userinput></screen> -
general.ent
r008436e rcba2d4e 1 <!ENTITY version "SVN-20140 331">2 <!ENTITY releasedate " March 31, 2014">1 <!ENTITY version "SVN-20140403"> 2 <!ENTITY releasedate "April 3, 2014"> 3 3 <!ENTITY copyrightdate "1999-2014"><!-- jhalfs needs a literal dash, not – --> 4 <!ENTITY milestone " 7.6">4 <!ENTITY milestone "8.0"> 5 5 <!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" --> 6 6 -
packages.ent
r008436e rcba2d4e 129 129 <!ENTITY diffutils-ch6-sbu "0.5 SBU"> 130 130 131 <!ENTITY dbus-version "1.8.0"> 132 <!ENTITY dbus-size "1,820 KB"> 133 <!ENTITY dbus-url "http://dbus.freedesktop.org/releases/dbus/dbus-&dbus-version;.tar.gz"> 134 <!ENTITY dbus-md5 "059fbe84e39fc99c67a14f15b1f39dff"> 135 <!ENTITY dbus-home "http://www.freedesktop.org/wiki/Software/dbus"> 136 <!ENTITY dbus-ch6-du "35 MB"> 137 <!ENTITY dbus-ch6-sbu "less than 0.4 SBU"> 138 131 139 <!-- NOTE: When updating e2fsprogs, remember to check the list 132 140 of acceptable features that can be shown by debugfs in … … 363 371 <!ENTITY less-ch6-sbu "less than 0.1 SBU"> 364 372 365 <!ENTITY lfs-bootscripts-version "201403 21"> <!-- Scripts depend on this format -->373 <!ENTITY lfs-bootscripts-version "20140331"> <!-- Scripts depend on this format --> 366 374 <!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile --> 367 375 <!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2"> … … 599 607 <!ENTITY texinfo-ch6-sbu "0.6 SBU"> 600 608 601 <!ENTITY systemd-version "2 08">602 <!ENTITY systemd-size "2, 328KB">609 <!ENTITY systemd-version "211"> 610 <!ENTITY systemd-size "2,604 KB"> 603 611 <!ENTITY systemd-url "http://www.freedesktop.org/software/systemd/systemd-&systemd-version;.tar.xz"> 604 <!ENTITY systemd-md5 " df64550d92afbffb4f67a434193ee165">612 <!ENTITY systemd-md5 "0a70c382b6089526f98073b4ee85ef75"> 605 613 <!ENTITY systemd-home "http://www.freedesktop.org/wiki/Software/systemd/"> 606 <!ENTITY systemd-ch6-du " 29MB">607 <!ENTITY systemd-ch6-sbu " 0.1SBU">614 <!ENTITY systemd-ch6-du "410 MB"> 615 <!ENTITY systemd-ch6-sbu "4.5 SBU"> 608 616 609 617 <!ENTITY tzdata-version "2014a"> … … 615 623 <!ENTITY tzdata-ch6-sbu "less than 0.1 SBU"> 616 624 617 <!ENTITY udev-lfs "udev-lfs-&systemd-version;-3">618 <!ENTITY udev-lfs-size "29KB">619 <!ENTITY udev-lfs-url "&anduin-other;&udev-lfs;.tar.bz2">620 <!ENTITY udev-lfs-md5 "c0231ff619e567a9b11f912d8a7a404a">621 <!ENTITY udev-lfs-home " ">625 <!ENTITY udev-lfs-version "udev-lfs-20140302"> 626 <!ENTITY udev-lfs-size "11 KB"> 627 <!ENTITY udev-lfs-url "&anduin-other;&udev-lfs-version;.tar.bz2"> 628 <!ENTITY udev-lfs-md5 "81fd93e43e2c232932f38223ba2b740c"> 629 <!ENTITY udev-lfs-home " "> 622 630 623 631 <!ENTITY util-linux-version "2.24.1"> -
patches.ent
r008436e rcba2d4e 27 27 <!ENTITY sysvinit-consolidated-patch-size "3.9 KB"> 28 28 29 <!ENTITY systemd-compat-patch "systemd-&systemd-version;-compat-1.patch"> 30 <!ENTITY systemd-compat-patch-md5 "0edc54bbe9391cfb072bc737312e6b7a"> 31 <!ENTITY systemd-compat-patch-size "12 KB"> 32 29 33 <!ENTITY tar-manpage-patch "tar-&tar-version;-manpage-1.patch"> 30 34 <!ENTITY tar-manpage-patch-md5 "321f85ec32733b1a9399e788714a5156"> -
udev-lfs/ChangeLog
r008436e rcba2d4e 1 2014-03-02 <bdubbs@linuxfromscratch.org> 2 * Makefile.lfs: Remove build procedures leaving only LFS rules 3 1 4 2014-02-16 <bdubbs@linuxfromscratch.org> 2 5 * Makefile.lfs: Adjust warning flags. Adjust linking rules to -
udev-lfs/Makefile.lfs
r008436e rcba2d4e 1 # Custom systemd Makefile that builds/installs udev onlyfor LFS2 # Bruce Dubbs 201 2-07-111 # Custom systemd Makefile that installs udev rules for LFS 2 # Bruce Dubbs 2014-04-02 3 3 4 4 # vim: tabstop=3 5 5 6 VERSION=20140302 6 7 SHELL=/bin/bash 7 SYSTEMD_VERSION=2088 VERSION=$(SYSTEMD_VERSION)-39 8 10 9 ifeq ($(V),) … … 14 13 endif 15 14 16 WARN = -Wall -W -Wextra -Wno-inline -Wvla -Wundef -Wformat=2 \ 17 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs \ 18 -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self \ 19 -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes \ 20 -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations \ 21 -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align \ 22 -Wstrict-aliasing=2 -Wwrite-strings -Wno-overlength-strings \ 23 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result \ 24 -Werror=overflow -Wp,-D_FORTIFY_SOURCE=2 -Wno-long-long -Wno-vla 15 all: 16 @echo "Use the install target" 25 17 26 OPTIONS = -O2 -pipe -ffast-math -fno-common -fdiagnostics-show-option \ 27 -fno-strict-aliasing -ffunction-sections -fdata-sections -fPIC -std=gnu99 18 install: 19 @mkdir -pv $(DESTDIR)/lib/udev/rules.d \ 20 $(DESTDIR)/etc/udev/rules.d \ 21 $(DESTDIR)/usr/share/doc/udev-$(VERSION)/lfs 28 22 29 OPTIONS2 := $(OPTIONS) -fvisibility=hidden 30 31 LDFLAGS1 = -pthread -lrt -Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined 32 LDFLAGS2 := $(LDFLAGS1) -L /tools/lib -lblkid -lkmod 33 34 DEF = -include cfg.h \ 35 -DSYSCONFDIR=\"/etc\" \ 36 -DFIRMWARE_PATH="\"/lib/firmware/updates/\", \"/lib/firmware/\"" \ 37 -DHWDB_BIN=\"/etc/udev/hwdb.bin\" \ 38 -DROOTPREFIX= \ 39 -DUDEVLIBEXECDIR=\"/lib/udev\" \ 40 -D_LARGEFILE_SOURCE \ 41 -D_FILE_OFFSET_BITS=64 \ 42 -DHAVE_FIRMWARE 43 44 INCLUDE = -I src/libudev -I src/shared -I src -I src/login -I src/systemd \ 45 -I src/core -I udev-lfs-$(VERSION) 46 47 LIBUDEV_SRCS = libudev-device-private.c \ 48 libudev-device.c \ 49 libudev-enumerate.c \ 50 libudev-hwdb.c \ 51 libudev-list.c \ 52 libudev-monitor.c \ 53 libudev-queue-private.c \ 54 libudev-queue.c \ 55 libudev-util.c \ 56 libudev.c \ 57 test-device-nodes.c \ 58 device-nodes.c 59 60 LIBUDEV_OBJS := $(addprefix build/, $(LIBUDEV_SRCS:.c=.o)) 61 62 LIBUDEV = libudev 63 LIBUDEV_MAJOR = .1 64 LIBUDEV_MINOR = .3 65 LIBUDEV_PATCH = .2 66 LIBUDEV_SONAME := $(LIBUDEV).so 67 LIBUDEV_LINK_NAME := $(LIBUDEV_SONAME)$(LIBUDEV_MAJOR) 68 LIBUDEV_REAL_NAME := $(LIBUDEV_LINK_NAME)$(LIBUDEV_MINOR)$(LIBUDEV_PATCH) 69 70 COMMON_LIB = udev-local.a 71 72 COMMON_SRCS = log.c \ 73 label.c \ 74 mkdir.c \ 75 cgroup-util.c \ 76 strv.c \ 77 strbuf.c \ 78 path-util.c \ 79 conf-files.c \ 80 hashmap.c \ 81 set.c \ 82 exit-status.c \ 83 util.c \ 84 mkdir-label.c \ 85 dev-setup.c \ 86 sd-login.c \ 87 sd-daemon.c \ 88 time-util.c \ 89 fileio.c \ 90 strxcpyx.c \ 91 env-util.c \ 92 utf8.c 93 94 COMMON_OBJS := $(addprefix build/, $(COMMON_SRCS:.c=.o)) 95 96 UDEVD_SRCS = udev-ctrl.c \ 97 udev-rules.c \ 98 udev-watch.c \ 99 udev-event.c \ 100 udev-node.c \ 101 udev-builtin.c \ 102 udev-builtin-blkid.c \ 103 udev-builtin-firmware.c \ 104 udev-builtin-keyboard.c \ 105 udev-builtin-path_id.c \ 106 udev-builtin-hwdb.c \ 107 udev-builtin-kmod.c \ 108 udev-builtin-uaccess.c \ 109 udev-builtin-net_id.c \ 110 udev-builtin-usb_id.c \ 111 udev-builtin-input_id.c \ 112 udev-builtin-btrfs.c 113 114 UDEVD_OBJS := $(addprefix build/, $(UDEVD_SRCS:.c=.o)) 115 116 UDEV_ADMIN_SRCS = udevadm.c \ 117 udevadm-test.c \ 118 udevadm-monitor.c \ 119 udevadm-settle.c \ 120 udevadm-hwdb.c \ 121 udevadm-info.c \ 122 udevadm-test-builtin.c \ 123 udevadm-trigger.c \ 124 udevadm-control.c \ 125 udev-rules.c \ 126 udev-ctrl.c \ 127 udev-event.c \ 128 udev-node.c \ 129 udev-watch.c \ 130 udev-builtin.c \ 131 udev-builtin-blkid.c \ 132 udev-builtin-keyboard.c \ 133 udev-builtin-firmware.c \ 134 udev-builtin-path_id.c \ 135 udev-builtin-hwdb.c \ 136 udev-builtin-kmod.c \ 137 udev-builtin-uaccess.c \ 138 udev-builtin-net_id.c \ 139 udev-builtin-usb_id.c \ 140 udev-builtin-input_id.c \ 141 udev-builtin-btrfs.c 142 143 UDEV_ADMIN_OBJS := $(addprefix build/, $(UDEV_ADMIN_SRCS:.c=.o)) 144 145 LFS_RULES = 55-lfs.rules 146 147 VPATH = src/login src/udev src/udev/accelerometer \ 148 src/udev/scsi_id src/udev/cdrom_id src/udev/v4l_id \ 149 src/udev/mtd_probe src/udev/collect src/udev/ata_id \ 150 src/libudev src/test src/libsystemd-daemon 151 152 SED_PROCESS = \ 153 sed -e 's|@VERSION@|$(SYSTEMD_VERSION)|g' \ 154 -e 's|@prefix@|/usr|g' \ 155 -e 's|@udevlibexecdir@|/lib/udev|g' \ 156 -e 's|@libdir@|/usr/lib|g' \ 157 -e 's|@includedir@|/usr/include|g' \ 158 < $< > $@ 159 160 SECURE = $(shell if objdump -T /lib/libc.so.6 | grep -q " secure_getenv"; \ 161 then echo yes; fi) 162 163 ifeq "$(SECURE)" "yes" 164 SECURE_GETENV = SECURE_GETENV 165 else 166 SECURE_GETENV = __SECURE_GETENV 167 endif 168 169 udev: common \ 170 build/$(COMMON_LIB) \ 171 build/$(LIBUDEV_REAL_NAME) \ 172 build/udevd \ 173 build/udevadm \ 174 build/accelerometer \ 175 build/ata_id \ 176 build/cdrom_id \ 177 build/scsi_id \ 178 build/v4l_id \ 179 build/mtd_probe \ 180 build/collect \ 181 build/udev.pc \ 182 build/libudev.pc 183 184 cfg.h: udev-lfs-$(VERSION)/cfg.h 185 sed -e 's/LFS-VERSION/$(SYSTEMD_VERSION)/' \ 186 -e 's/SECURE_GETENV/$(SECURE_GETENV)/' \ 187 udev-lfs-$(VERSION)/cfg.h > ./cfg.h 188 @mkdir -p build 189 190 common: cfg.h 191 @touch common 192 193 build/%o: %c common 194 @echo CC $< 195 $(VB)gcc -c $(WARN) $(OPTIONS2) $(INCLUDE) $(DEF) -o $@ $< 196 197 # Sources from src/libudev use -fvisibility=hidden 198 build/%o: src/libudev/%c common 199 @echo CC $< 200 $(VB)gcc -c $(WARN) $(OPTIONS) $(INCLUDE) $(DEF) -o $@ $< 201 202 # Sources from src/shared use -fvisibility=hidden 203 build/%o: src/shared/%c common 204 @echo CC $< 205 $(VB)gcc -c $(WARN) $(OPTIONS) $(INCLUDE) $(DEF) -o $@ $< 206 207 # Build the dynamic library 208 build/$(LIBUDEV_REAL_NAME): $(LIBUDEV_OBJS) build/$(COMMON_LIB) 209 @echo LINK $@ 210 $(VB)gcc -shared -fPIC -DPIC \ 211 $(LIBUDEV_OBJS) \ 212 build/$(COMMON_LIB) \ 213 -Wl,--no-whole-archive -ldl -lrt -O2 \ 214 -Wl,--as-needed \ 215 -Wl,--gc-sections \ 216 -Wl,--no-undefined \ 217 -Wl,-soname,$(LIBUDEV_LINK_NAME) \ 218 -o build/$(LIBUDEV_REAL_NAME) 219 220 ln -sfn $(LIBUDEV_REAL_NAME) build/$(LIBUDEV_LINK_NAME) 221 ln -sfn $(LIBUDEV_REAL_NAME) build/$(LIBUDEV_SONAME) 222 223 #-Wl,--whole-archive \ 224 #-Wl,--version-script=./src/libudev/libudev.sym \ 225 226 # Build the static library for internal use 227 build/$(COMMON_LIB): $(COMMON_OBJS) $(LIBUDEV_OBJS) $(UDEVD_OBJS) 228 @echo AR $@ 229 $(VB)ar rcs build/$(COMMON_LIB) $(COMMON_OBJS) $(LIBUDEV_OBJS) 230 231 build/udevd: build/$(COMMON_LIB) build/udevd.o 232 @echo LINK $@ 233 $(VB)gcc build/udevd.o $(UDEVD_OBJS) -o $@ $(LDFLAGS2) \ 234 build/udev-local.a build/$(COMMON_LIB) 235 $(VB)strip --strip-unneeded $@ 236 237 build/udevadm: $(UDEV_ADMIN_OBJS) build/$(COMMON_LIB) 238 @echo LINK $@ 239 $(VB)gcc $(UDEV_ADMIN_OBJS) -o $@ $(LDFLAGS2) build/$(COMMON_LIB) 240 $(VB)strip --strip-unneeded $@ 241 242 build/accelerometer: build/accelerometer.o build/$(COMMON_LIB) 243 @echo LINK $@ 244 $(VB)gcc build/accelerometer.o -o $@ \ 245 build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) -lm 246 $(VB)strip --strip-unneeded $@ 247 248 build/scsi_id: build/scsi_id.o build/scsi_serial.o build/$(COMMON_LIB) 249 @echo LINK $@ 250 $(VB)gcc build/scsi_id.o build/scsi_serial.o -o $@ \ 251 build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) 252 $(VB)strip --strip-unneeded $@ 253 254 build/ata_id: build/ata_id.o build/$(COMMON_LIB) 255 @echo LINK $@ 256 $(VB)gcc build/ata_id.o -o $@ build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) 257 $(VB)strip --strip-unneeded $@ 258 259 build/cdrom_id: build/cdrom_id.o build/$(COMMON_LIB) 260 @echo LINK $@ 261 $(VB)gcc build/cdrom_id.o -o $@ build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) 262 $(VB)strip --strip-unneeded $@ 263 264 build/v4l_id: build/v4l_id.o build/$(COMMON_LIB) 265 @echo LINK $@ 266 $(VB)gcc build/v4l_id.o -o $@ build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) 267 $(VB)strip --strip-unneeded $@ 268 269 build/mtd_probe: build/mtd_probe.o build/probe_smartmedia.o build/$(COMMON_LIB) 270 @echo LINK $@ 271 $(VB)gcc build/mtd_probe.o build/probe_smartmedia.o -o $@ \ 272 build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) 273 $(VB)strip --strip-unneeded $@ 274 275 build/collect: build/collect.o build/$(COMMON_LIB) 276 @echo LINK $@ 277 $(VB)gcc build/collect.o -o $@ build/udev-local.a build/$(COMMON_LIB) $(LDFLAGS1) 278 $(VB)strip --strip-unneeded $@ 279 280 build/%pc: %pc.in common 281 @echo GEN $@ 282 @$(SED_PROCESS) 283 284 install: udev 285 @mkdir -pv $(DESTDIR)/lib/udev/devices/pts $(DESTDIR)/lib/udev/rules.d \ 286 $(DESTDIR){,/usr}/lib/firmware $(DESTDIR)/sbin \ 287 $(DESTDIR)/usr/lib/pkgconfig $(DESTDIR)/etc/udev/rules.d \ 288 $(DESTDIR)/usr/share/man/man{7,8} $(DESTDIR)/usr/include \ 289 $(DESTDIR)/usr/share/doc/udev-$(SYSTEMD_VERSION)/lfs \ 290 $(DESTDIR)/usr/share/gtk-doc/html/libudev 291 292 # Copy executables 293 @cp -v build/udevadm $(DESTDIR)/sbin 294 @cp -v build/{udevd,accelerometer,ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id} \ 295 $(DESTDIR)/lib/udev 296 @cp -v udev-lfs-$(VERSION)/write* $(DESTDIR)/lib/udev 297 @cp -v udev-lfs-$(VERSION)/*functions $(DESTDIR)/lib/udev 298 299 # Copy and set up library and associated files 300 @cp -v build/{lib,}udev.pc $(DESTDIR)/usr/lib/pkgconfig 301 @cp -v build/$(LIBUDEV_REAL_NAME) $(DESTDIR)/lib 302 303 ln -svfn ../../lib/$(LIBUDEV_REAL_NAME) $(DESTDIR)/usr/lib/$(LIBUDEV_SONAME) 304 ln -svfn $(LIBUDEV_REAL_NAME) $(DESTDIR)/lib/$(LIBUDEV_LINK_NAME) 305 306 # Copy the libudev header 307 @cp -v src/libudev/libudev.h $(DESTDIR)/usr/include 308 309 # Create null device and copy rules 310 @cp -v rules/* $(DESTDIR)/lib/udev/rules.d 311 @rm -v $(DESTDIR)/lib/udev/rules.d/99* 312 @cp -v udev-lfs-$(VERSION)/*.rules $(DESTDIR)/etc/udev/rules.d 313 314 # Set up hardware DB 315 @mkdir -pv $(DESTDIR)/lib/udev/hwdb.d 316 @cp hwdb/* $(DESTDIR)/lib/udev/hwdb.d 317 # @build/udevadm hwdb --update 23 # Copy rules 24 @cp -v udev-lfs-$(VERSION)/*.rules $(DESTDIR)/etc/udev/rules.d 25 @cp -v udev-lfs-$(VERSION)/*_rules $(DESTDIR)/lib/udev 26 @cp -v udev-lfs-$(VERSION)/init-net-rules.sh $(DESTDIR)/lib/udev 318 27 319 28 # Copy documentation 320 @cp -v udev-lfs-$(VERSION)/udev.7 $(DESTDIR)/usr/share/man/man7 321 @cp -v udev-lfs-$(VERSION)/udevadm.8 $(DESTDIR)/usr/share/man/man8 322 @cp -v udev-lfs-$(VERSION)/udevd.8 $(DESTDIR)/usr/share/man/man8 323 @cp -v udev-lfs-$(VERSION)/README $(DESTDIR)/usr/share/doc/udev-$(SYSTEMD_VERSION)/lfs 324 @cp -v udev-lfs-$(VERSION)/*.txt $(DESTDIR)/usr/share/doc/udev-$(SYSTEMD_VERSION)/lfs 325 @cp -v docs/libudev/*.{txt,types} $(DESTDIR)/usr/share/doc/udev-$(SYSTEMD_VERSION) 326 @cp -v docs/libudev/html/* $(DESTDIR)/usr/share/gtk-doc/html/libudev 327 328 # Copy misc 329 @cp -v udev-lfs-$(VERSION)/init-net-rules.sh $(DESTDIR)/lib/udev 330 331 include udev-lfs-$(VERSION)/makefile-incl.gudev 332 include udev-lfs-$(VERSION)/makefile-incl.gir 333 include udev-lfs-$(VERSION)/makefile-incl.keymap 334 335 all : udev keymap gudev gir-data 336 install-all: install install-keymap install-gudev install-gir-data 337 338 clean: 339 rm -rf build 340 rm -f cfg.h 341 rm -f common 342 rm -f src/gudev/gudevmarshal.h 343 rm -f src/gudev/gudevmarshal.c 344 rm -f src/gudev/gudevenumtypes.h 345 rm -f src/gudev/gudevenumtypes.c 346 rm -f src/udev/keymap/keys.txt 347 rm -f src/udev/keymap/keys-from-name.gperf 348 rm -f src/udev/keymap/keys-from-name.h 349 rm -f src/udev/keymap/keys-to-name.h 350 351 .PHONY: clean 352 29 @cp -v udev-lfs-$(VERSION)/README $(DESTDIR)/usr/share/doc/udev-$(VERSION)/lfs 30 @cp -v udev-lfs-$(VERSION)/*.txt $(DESTDIR)/usr/share/doc/udev-$(VERSION)/lfs -
udev-lfs/README
r008436e rcba2d4e 1 1 The udev-lfs set of files is a customization of systemd. 2 2 In 2012, udev was merged with systemd and a build methodology 3 incompatible with LFS. These files extract the udev4 code from systemdfor LFS.3 incompatible with LFS. These files add cusom udev rules 4 for LFS. 5 5 6 6 These files are distributed in the form of a tar file available … … 11 11 tar -jcf /tmp/udev-lfs-$VERSION.tar.bz2 -C /tmp udev-lfs-$VERSION 12 12 13 Makefile.lfs - The main LFS Makefile. Builds and installs 14 udev from systemd sources. 15 16 makefile-incl.keymap - BLFS makefile for keymap and supporting files 17 makefile-incl.gudev - BLFS makefile for libgudev 18 makefile-incl.gir - BLFS makefile for GObject files 19 13 Makefile.lfs - The LFS Makefile. Installs udev rules for LFS. 20 14 21 15 contrib - Useful rules from debian … … 32 26 55-lfs.txt - Documentation for LFS installed rules 33 27 34 cfg.h - Basic info needed for udev compilation35 36 28 ChangeLog - Log of changes to 55-lfs-rules 37 29
Note:
See TracChangeset
for help on using the changeset viewer.