Changeset cba2d4e


Ignore:
Timestamp:
04/03/2014 09:52:09 PM (10 years ago)
Author:
Bruce Dubbs <bdubbs@…>
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
Message:

Added systemd and dbus to the book.
Set up systemd and System V side-by-side with the
ability to reboot to either system.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10520 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Files:
3 added
11 deleted
34 edited

Legend:

Unmodified
Added
Removed
  • appendices/scripts.xml

    r008436e rcba2d4e  
    66  <!ENTITY cleanfs            SYSTEM "cleanfs.script">
    77  <!ENTITY console            SYSTEM "console.script">
    8   <!ENTITY functions          SYSTEM "functions.script">
    98  <!ENTITY halt               SYSTEM "halt.script">
    109  <!ENTITY initfunctions      SYSTEM "init-functions.script">
     
    6160    <title>/lib/lsb/init-functions</title>
    6261    <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>
    6862  </sect1>
    6963
  • appendices/udev-rules.xml

    r008436e rcba2d4e  
    1515  <para>The rules from <!-- &eudev-lfs;.tar.bz2 -->in this appendix are listed for
    1616  convenience.  Installation is normally done via instructions in <xref
    17   linkend='ch-system-eudev'/>.  </para>
     17  linkend='ch-system-systemd'/>.  </para>
    1818
    1919  <sect1 id="lfsrules" role="wrap">
  • bootscripts/ChangeLog

    r008436e rcba2d4e  
     12014-03-31 Bruce Dubbs <bdubbs@linuxfromscratch.org>
     2   * Changes made to be consistent with common systemd functions
     3
    142013-08-21 Bruce Dubbs <bdubbs@linuxfromscratch.org>
    25   * Delete duplicate entry in rc.site file.
  • bootscripts/Makefile

    r008436e rcba2d4e  
    1 EXTDIR=${DESTDIR}/etc
    2 LIBDIR=${DESTDIR}/lib/services
     1ETCDIR=${DESTDIR}/etc
     2LIBDIR=${DESTDIR}/lib
     3SERVICEDIR=${LIBDIR}/services
     4UNITDIR=${LIBDIR}/systemd/system
    35MAN8=${DESTDIR}/usr/share/man/man8
    46SBIN=${DESTDIR}/sbin
     
    1214
    1315create-dirs:
    14         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc0.d
    15         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc1.d
    16         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc2.d
    17         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc3.d
    18         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc4.d
    19         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc5.d
    20         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rc6.d
    21         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/rcS.d
    22         install -d -m ${DIRMODE}  ${EXTDIR}/rc.d/init.d
    23         install -d -m ${DIRMODE}  ${EXTDIR}/sysconfig
     16        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
    2426        install -d -m ${DIRMODE}  ${LIBDIR}
     27        install -d -m ${DIRMODE}  ${SERVICEDIR}
     28        install -d -m ${DIRMODE}  ${UNITDIR}
    2529        install -d -m ${DIRMODE}  ${MAN8}
    2630        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
    2934
    3035files: 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/
    5155        install -m ${MODE} lfs/sbin/ifup            ${SBIN}
    5256        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}
    5458        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/ ;\
    6066        fi
    61         if [ ! -f ${EXTDIR}/sysconfig/modules     ]; then \
    62           install -m ${CONFMODE} lfs/sysconfig/modules     ${EXTDIR}/sysconfig/ ;\
     67        if [ ! -f ${ETCDIR}/sysconfig/modules     ]; then \
     68          install -m ${CONFMODE} lfs/sysconfig/modules     ${ETCDIR}/sysconfig/ ;\
    6369        fi
    64         if [ ! -f ${EXTDIR}/sysconfig/udev_retry  ]; then \
    65           install -m ${CONFMODE} lfs/sysconfig/udev_retry  ${EXTDIR}/sysconfig/ ;\
     70        if [ ! -f ${ETCDIR}/sysconfig/udev_retry  ]; then \
     71          install -m ${CONFMODE} lfs/sysconfig/udev_retry  ${ETCDIR}/sysconfig/ ;\
    6672        fi
    67         if [ ! -f ${EXTDIR}/sysconfig/rc.site     ]; then \
    68           install -m ${CONFMODE} lfs/sysconfig/rc.site     ${EXTDIR}/sysconfig/ ;\
     73        if [ ! -f ${ETCDIR}/sysconfig/rc.site     ]; then \
     74          install -m ${CONFMODE} lfs/sysconfig/rc.site     ${ETCDIR}/sysconfig/ ;\
    6975        fi
    7076
     
    7278
    7379rcS: files
    74         ln -sf ../init.d/mountvirtfs ${EXTDIR}/rc.d/rcS.d/S00mountvirtfs
    75         ln -sf ../init.d/modules     ${EXTDIR}/rc.d/rcS.d/S05modules
    76         ln -sf ../init.d/localnet    ${EXTDIR}/rc.d/rcS.d/S08localnet
    77         ln -sf ../init.d/udev        ${EXTDIR}/rc.d/rcS.d/S10udev
    78         ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rcS.d/S20swap
    79         ln -sf ../init.d/checkfs     ${EXTDIR}/rc.d/rcS.d/S30checkfs
    80         ln -sf ../init.d/mountfs     ${EXTDIR}/rc.d/rcS.d/S40mountfs
    81         ln -sf ../init.d/cleanfs     ${EXTDIR}/rc.d/rcS.d/S45cleanfs
    82         ln -sf ../init.d/udev_retry  ${EXTDIR}/rc.d/rcS.d/S50udev_retry
    83         ln -sf ../init.d/console     ${EXTDIR}/rc.d/rcS.d/S70console
    84         ln -sf ../init.d/sysctl      ${EXTDIR}/rc.d/rcS.d/S90sysctl
     80        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
    8591
    8692rc0: files
    87         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc0.d/K80network
    88         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc0.d/K90sysklogd
    89         ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc0.d/S60sendsignals
    90         ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rc0.d/S65swap
    91         ln -sf ../init.d/mountfs     ${EXTDIR}/rc.d/rc0.d/S70mountfs
    92         ln -sf ../init.d/localnet    ${EXTDIR}/rc.d/rc0.d/S90localnet
    93         ln -sf ../init.d/halt        ${EXTDIR}/rc.d/rc0.d/S99halt
     93        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
    94100
    95101rc1: files
    96         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc1.d/K80network
    97         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc1.d/K90sysklogd
     102        ln -sf ../init.d/network     ${ETCDIR}/rc.d/rc1.d/K80network
     103        ln -sf ../init.d/sysklogd    ${ETCDIR}/rc.d/rc1.d/K90sysklogd
    98104
    99105rc2: files
    100         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc2.d/K80network
    101         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc2.d/K90sysklogd
     106        ln -sf ../init.d/network     ${ETCDIR}/rc.d/rc2.d/K80network
     107        ln -sf ../init.d/sysklogd    ${ETCDIR}/rc.d/rc2.d/K90sysklogd
    102108
    103109rc3: files
    104         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc3.d/S10sysklogd
    105         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc3.d/S20network
     110        ln -sf ../init.d/sysklogd    ${ETCDIR}/rc.d/rc3.d/S10sysklogd
     111        ln -sf ../init.d/network     ${ETCDIR}/rc.d/rc3.d/S20network
    106112
    107113rc4: files
    108         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc4.d/S10sysklogd
    109         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc4.d/S20network
     114        ln -sf ../init.d/sysklogd    ${ETCDIR}/rc.d/rc4.d/S10sysklogd
     115        ln -sf ../init.d/network     ${ETCDIR}/rc.d/rc4.d/S20network
    110116
    111117rc5: files
    112         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc5.d/S10sysklogd
    113         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc5.d/S20network
     118        ln -sf ../init.d/sysklogd    ${ETCDIR}/rc.d/rc5.d/S10sysklogd
     119        ln -sf ../init.d/network     ${ETCDIR}/rc.d/rc5.d/S20network
    114120
    115121rc6: files
    116         ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc6.d/K80network
    117         ln -sf ../init.d/sysklogd    ${EXTDIR}/rc.d/rc6.d/K90sysklogd
    118         ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc6.d/S60sendsignals
    119         ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rc6.d/S65swap
    120         ln -sf ../init.d/mountfs     ${EXTDIR}/rc.d/rc6.d/S70mountfs
    121         ln -sf ../init.d/localnet    ${EXTDIR}/rc.d/rc6.d/S90localnet
    122         ln -sf ../init.d/reboot      ${EXTDIR}/rc.d/rc6.d/S99reboot
     122        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
    123129
    124130uninstall:
    125         rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${EXTDIR}/rc.d ${EXTDIR}/init.d \
    126                ${SBIN}/ifup ${SBIN}/ifdown ${MAN8}/ifup.8 ${MAN8}/ifdown.8 \
    127                ${EXTDIR}/sysconfig/rc
     131        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
    128134
    129135.PHONY: all create-dirs install files links rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 uninstall
  • bootscripts/lfs/init.d/localnet

    r008436e rcba2d4e  
    2929. /lib/lsb/init-functions
    3030[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
     31[ -r /etc/hostname ] && HOSTNAME=`cat /etc/hostname`
    3132
    3233case "${1}" in
  • bootscripts/lfs/init.d/mountfs

    r008436e rcba2d4e  
    4040      rm -f /fastboot /forcefsck
    4141
     42      # Make sure /dev/pts exists
     43      mkdir -p /dev/pts
     44
    4245      # This will mount all filesystems that do not have _netdev in
    4346      # their option list.  _netdev denotes a network filesystem.
  • bootscripts/lfs/init.d/mountvirtfs

    r008436e rcba2d4e  
    3232case "${1}" in
    3333   start)
    34       # Make sure /run/var is available before logging any messages
     34      # Make sure /run is available before logging any messages
    3535      if ! mountpoint /run >/dev/null; then
    3636         mount /run || failed=1
    3737      fi
    3838
    39       mkdir -p /run/var /run/lock /run/shm
     39      mkdir -p /run/lock /run/shm
    4040      chmod 1777 /run/shm
    4141
  • bootscripts/lfs/init.d/rc

    r008436e rcba2d4e  
    218218# Copy the boot log on initial boot only
    219219if [ "${previous}" == "N" -a  "${runlevel}" != "S" ]; then
    220    cat /run/var/bootlog >> /var/log/boot.log
     220   cat $BOOTLOG >> /var/log/boot.log
    221221     
    222222   # Mark the end of boot
     
    224224   
    225225   # Remove the temporary file
    226    rm -f /run/var/bootlog 2> /dev/null
     226   rm -f $BOOTLOG 2> /dev/null
    227227fi
    228228
  • bootscripts/lfs/init.d/udev

    r008436e rcba2d4e  
    5050      # Start the udev daemon to continually watch for, and act on,
    5151      # uevents
    52       /sbin/udevd --daemon
     52      /lib/systemd-udevd --daemon
    5353
    5454      # Now traverse /sys in order to "coldplug" devices that have
    5555      # already been discovered
    56       /sbin/udevadm trigger --action=add    --type=subsystems
    57       /sbin/udevadm trigger --action=add    --type=devices
    58       /sbin/udevadm trigger --action=change --type=devices
     56      /bin/udevadm trigger --action=add    --type=subsystems
     57      /bin/udevadm trigger --action=add    --type=devices
     58      /bin/udevadm trigger --action=change --type=devices
    5959
    6060      # Now wait for udevd to process the uevents we triggered
    6161      if ! is_true "$OMIT_UDEV_SETTLE"; then
    62          /sbin/udevadm settle
     62         /bin/udevadm settle
    6363      fi
    6464
  • bootscripts/lfs/init.d/udev_retry

    r008436e rcba2d4e  
    3636
    3737      # As of udev-186, the --run option is no longer valid
    38       #rundir=$(/sbin/udevadm info --run)
     38      #rundir=$(/bin/udevadm info --run)
    3939      rundir=/run/udev
    4040      # From Debian: "copy the rules generated before / was mounted
     
    5353      while read line ; do
    5454         for subsystem in $line ; do
    55             /sbin/udevadm trigger --subsystem-match=$subsystem --action=add
     55            /bin/udevadm trigger --subsystem-match=$subsystem --action=add
    5656         done
    5757      done
     
    5959      # Now wait for udevd to process the uevents we triggered
    6060      if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then
    61          /sbin/udevadm settle
     61         /bin/udevadm settle
    6262      fi
    6363
  • bootscripts/lfs/lib/services/init-functions

    r008436e rcba2d4e  
    7272WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
    7373
    74 BOOTLOG=/run/var/bootlog
     74BOOTLOG=/run/bootlog
    7575KILLDELAY=3
    7676
  • chapter01/changelog.xml

    r008436e rcba2d4e  
    3636    </listitem>
    3737-->
     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
    3851    <listitem>
    3952      <para>2014-03-31</para>
  • chapter01/whatsnew.xml

    r008436e rcba2d4e  
    234234    </listitem>
    235235    <listitem>
    236       <para>eudev-&eudev-version;</para>
    237     </listitem>
    238     <listitem>
    239       <para>eudev-&eudev-version;-manpages</para>
     236      <para>dbus-&dbus-version;</para>
    240237    </listitem>
    241238    <listitem>
     
    250247    <listitem>
    251248      <para>libcap-&libcap-version;</para>
     249    </listitem>
     250    <listitem>
     251      <para>systemd-&systemd-version;</para>
    252252    </listitem>
    253253    <listitem>
  • chapter03/packages.xml

    r008436e rcba2d4e  
    115115
    116116    <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>
    117126      <term>DejaGNU (&dejagnu-version;) - <token>&dejagnu-size;</token>:</term>
    118127      <listitem>
     
    158167      </listitem>
    159168    </varlistentry>
    160 
     169<!--
    161170    <varlistentry>
    162171      <term>Eudev (&eudev-version;) - <token>&eudev-size;</token>:</term>
     
    175184      </listitem>
    176185    </varlistentry>
    177 
     186-->
    178187    <varlistentry>
    179188      <term>File (&file-version;) - <token>&file-size;</token>:</term>
     
    597606
    598607    <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>
    599617      <term>Sysvinit (&sysvinit-version;) - <token>&sysvinit-size;</token>:</term>
    600618      <listitem>
     
    640658      </listitem>
    641659    </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>
    654663      <listitem>
    655664        <para>Download: <ulink url="&udev-lfs-url;"/></para>
     
    657666      </listitem>
    658667    </varlistentry>
    659 -->
     668
    660669    <varlistentry>
    661670      <term>Util-linux (&util-linux-version;) - <token>&util-linux-size;</token>:</term>
  • chapter03/patches.xml

    r008436e rcba2d4e  
    6666      </listitem>
    6767    </varlistentry>
    68 <!--
     68
    6969    <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>
    7171      <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>
    7474      </listitem>
    7575    </varlistentry>
    76 -->
     76
    7777    <varlistentry>
    7878      <term>Sysvinit Consolidated Patch - <token>&sysvinit-consolidated-patch-size;</token>:</term>
  • chapter06/chapter06.xml

    r008436e rcba2d4e  
    8585  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>
    8686
    87 
    88   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit-header.xml"/>
    89 
    9087  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit.xml"/>
    9188  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    9289  <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"/>-->
    9595  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
    9696  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-db.xml"/>
  • chapter06/systemd.xml

    r008436e rcba2d4e  
    66]>
    77
    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"?>
    1010
    1111  <sect1info condition="script">
    12     <productname>udev</productname>
     12    <productname>systemd</productname>
    1313    <productnumber>&systemd-version;</productnumber>
    1414    <address>&systemd-url;</address>
    1515  </sect1info>
    1616
    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>
    2121  </indexterm>
    2222
     
    2424    <title/>
    2525
    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>
    3028
    3129    <segmentedlist>
     
    4139
    4240  <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 &gt; config.cache &lt;&lt; "EOF"
     47<literal>KILL=/bin/kill
     48HAVE_BLKID=1
     49BLKID_LIBS="-lblkid"
     50BLKID_CFLAGS="-I/tools/include/blkid"</literal>
     51EOF</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>
    66146
    67147    <para>Install the package:</para>
    68148
    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
     167done
     168
     169ln -sfv ../lib/systemd/systemd /sbin/init-systemd
     170mv -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
     184make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
    95185
    96186  </sect2>
    97187
    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>
    100190
    101191    <segmentedlist>
     
    105195
    106196      <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>
    113213      </seglistitem>
    114214    </segmentedlist>
     
    119219      <?dbhtml list-presentation="table"?>
    120220
    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>
    163578          </indexterm>
    164579        </listitem>
     
    168583        <term><command>udevadm</command></term>
    169584        <listitem>
    170           <para>Generic udev administration tool: controls the udevd daemon,
     585          <para>Generic Udev administration tool: controls the udevd daemon,
    171586          provides info from the Udev database, monitors uevents, waits for
    172587          uevents to finish, tests Udev configuration, and triggers uevents
    173           for a given device</para>
    174           <indexterm zone="ch-system-udev udevadm">
     588          for a given device.</para>
     589          <indexterm zone="ch-system-systemd udevadm">
    175590            <primary sortas="b-udevadm">udevadm</primary>
    176591          </indexterm>
     
    178593      </varlistentry>
    179594
    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>
    188601          </indexterm>
    189602        </listitem>
     
    193606        <term><filename class="libraryfile">libudev</filename></term>
    194607        <listitem>
    195           <para>A library interface to udev device information</para>
    196           <indexterm zone="ch-system-udev libudev">
     608          <para>A library to access Udev device information.</para>
     609          <indexterm zone="ch-system-systemd libudev">
    197610            <primary sortas="c-libudev">libudev</primary>
    198611          </indexterm>
     
    200613      </varlistentry>
    201614
    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 
    213615    </variablelist>
    214616
  • chapter06/sysvinit.xml

    r008436e rcba2d4e  
    8383<screen><userinput remap="install">make -C src install</userinput></screen>
    8484
     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
     91done</userinput></screen>
     92
    8593  </sect2>
    8694
     
    123131      </varlistentry>
    124132
    125       <varlistentry id="halt">
     133      <varlistentry id="halt-sysv">
    126134        <term><command>halt</command></term>
    127135        <listitem>
     
    131139          file <filename>/var/log/wtmp</filename> that the system is being
    132140          brought down</para>
    133           <indexterm zone="ch-system-sysvinit halt">
     141          <indexterm zone="ch-system-sysvinit halt-sysv">
    134142            <primary sortas="b-halt">halt</primary>
    135143          </indexterm>
     
    137145      </varlistentry>
    138146
    139       <varlistentry id="init">
     147      <varlistentry id="init-sysv">
    140148        <term><command>init</command></term>
    141149        <listitem>
     
    143151          the hardware which takes over the boot process and starts all the
    144152          proceses it is instructed to</para>
    145           <indexterm zone="ch-system-sysvinit init">
     153          <indexterm zone="ch-system-sysvinit init-sysv">
    146154            <primary sortas="b-init">init</primary>
    147155          </indexterm>
     
    161169      </varlistentry>
    162170
    163       <varlistentry id="poweroff">
     171      <varlistentry id="poweroff-sysv">
    164172        <term><command>poweroff</command></term>
    165173        <listitem>
    166174          <para>Tells the kernel to halt the system and switch off the computer
    167175          (see <command>halt</command>)</para>
    168           <indexterm zone="ch-system-sysvinit poweroff">
     176          <indexterm zone="ch-system-sysvinit poweroff-sysv">
    169177            <primary sortas="b-poweroff">poweroff</primary>
    170178          </indexterm>
     
    172180      </varlistentry>
    173181
    174       <varlistentry id="reboot">
     182      <varlistentry id="reboot-sysv">
    175183        <term><command>reboot</command></term>
    176184        <listitem>
    177185          <para>Tells the kernel to reboot the system (see
    178186          <command>halt</command>)</para>
    179           <indexterm zone="ch-system-sysvinit reboot">
     187          <indexterm zone="ch-system-sysvinit reboot-sysv">
    180188            <primary sortas="b-reboot">reboot</primary>
    181189          </indexterm>
     
    183191      </varlistentry>
    184192
    185       <varlistentry id="runlevel">
     193      <varlistentry id="runlevel-sysv">
    186194        <term><command>runlevel</command></term>
    187195        <listitem>
    188196          <para>Reports the previous and the current run-level, as noted in the
    189197          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">
    191199            <primary sortas="b-runlevel">runlevel</primary>
    192200          </indexterm>
     
    194202      </varlistentry>
    195203
    196       <varlistentry id="shutdown">
     204      <varlistentry id="shutdown-sysv">
    197205        <term><command>shutdown</command></term>
    198206        <listitem>
    199207          <para>Brings the system down in a secure way, signaling all processes
    200208          and notifying all logged-in users</para>
    201           <indexterm zone="ch-system-sysvinit shutdown">
     209          <indexterm zone="ch-system-sysvinit shutdown-sysv">
    202210            <primary sortas="b-shutdown">shutdown</primary>
    203211          </indexterm>
     
    205213      </varlistentry>
    206214
    207       <varlistentry id="telinit">
     215      <varlistentry id="telinit-sysv">
    208216        <term><command>telinit</command></term>
    209217        <listitem>
    210218          <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">
    212220            <primary sortas="b-telinit">telinit</primary>
    213221          </indexterm>
  • chapter07/bootscripts.xml

    r008436e rcba2d4e  
    2424    <title/>
    2525
    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>
    2829
    2930    <segmentedlist>
     
    5253    <segmentedlist>
    5354      <segtitle>Installed scripts</segtitle>
     55      <segtitle>Installed unit</segtitle>
    5456      <segtitle>Installed directories</segtitle>
    5557
     
    5961        sendsignals, setclock, ipv4-static, swap, sysctl, sysklogd, template,
    6062        udev, and udev_retry</seg>
     63        <seg>ifupdown@.service</seg>
    6164        <seg>/etc/rc.d, /etc/init.d (symbolic link), /etc/sysconfig,
    6265        /lib/services, /lib/lsb (symbolic link)</seg>
  • chapter07/chapter07.xml

    r008436e rcba2d4e  
    1010  <?dbhtml filename="chapter07.html"?>
    1111
    12   <title>Setting Up System Bootscripts</title>
     12  <title>System Configuration and Bootscripts</title>
    1313
    1414  <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"/>
    1516  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/>
    1617  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>
    1718  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/>
    1819  <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"/>
    2020  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/>
    2121  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>
  • chapter07/hostname.xml

    r008436e rcba2d4e  
    1616  </indexterm>
    1717
    18   <para>Part of the job of the <command>localnet</command> script is setting the
    19   system's hostname. This needs to be configured in the
    20   <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>
    2121
    22   <para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
     22  <para>Create the <filename>/etc/hostname</filename> file and enter a
    2323  hostname by running:</para>
    2424
    25 <screen><userinput>echo "HOSTNAME=<replaceable>&lt;lfs&gt;</replaceable>" &gt; /etc/sysconfig/network</userinput></screen>
     25<screen><userinput>echo "<replaceable>&lt;lfs&gt;</replaceable>" &gt; /etc/hostname</userinput></screen>
    2626
    2727  <para><replaceable>&lt;lfs&gt;</replaceable> needs to be replaced with the name given
  • chapter07/introduction.xml

    r008436e rcba2d4e  
    1111  <title>Introduction</title>
    1212
    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 &mdash; halt</para></listitem>
     44      <listitem><para>1 &mdash; Single user mode</para></listitem>
     45      <listitem><para>2 &mdash; Multiuser, without networking</para></listitem>
     46      <listitem><para>3 &mdash; Full multiuser mode</para></listitem>
     47      <listitem><para>4 &mdash; User definable</para></listitem>
     48      <listitem><para>5 &mdash; Full multiuser mode with display manager</para></listitem>
     49      <listitem><para>6 &mdash; 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 &gt; /usr/local/sbin/set-systemd &lt;&lt; "EOF"
     179#! /bin/bash
     180
     181ln -svfn init-systemd   /sbin/init
     182ln -svfn init.d-systemd /etc/init.d
     183
     184for 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
     187done
     188
     189echo "Now reboot with /sbin/reboot-sysv"
     190EOF
     191
     192chmod 0744 /usr/local/sbin/set-systemd
     193
     194cat &gt; /usr/local/sbin/set-sysv &lt;&lt; "EOF"
     195ln -sfvn init-sysv    /sbin/init
     196ln -svfn init.d-sysv  /etc/init.d
     197
     198for 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
     201done
     202
     203echo "Now reboot with /sbin/reboot-systemd"
     204EOF
     205
     206chmod 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>
    90216
    91217</sect1>
  • chapter07/network.xml

    r008436e rcba2d4e  
    4343    to network cards based on their MAC address.</para>
    4444
    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
    4751    <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to
    4852    find out which name was assigned to which network device:</para>
     
    123127    class="directory">/etc/sysconfig/</filename>.  This directory should
    124128    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>
    130143
    131144    <para>The following command creates a sample file for the
     
    137150IFACE=eth0
    138151SERVICE=ipv4-static
    139 IP=192.168.1.1
    140 GATEWAY=192.168.1.2
     152IP=192.168.1.2
     153GATEWAY=192.168.1.1
    141154PREFIX=24
    142155BROADCAST=192.168.1.255</literal>
     
    147160
    148161    <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) during
     162    System V network script will bring up the Network Interface Card (NIC) during
    150163    booting of the system. If set to anything but <quote>yes</quote> the NIC
    151164    will be ignored by the network script and not be automatically brought up.
     
    182195  </sect2>
    183196
     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 &lt;device&gt;</command> or
     221    <command>ifdown &lt;device&gt;</command> commands.</para></note>
     222
     223  </sect2>
     224
    184225  <sect2 id="resolv.conf">
    185226    <title>Creating the /etc/resolv.conf File</title>
  • chapter07/setclock.xml

    r008436e rcba2d4e  
    66]>
    77
    8 <sect1 id="ch-scripts-setclock">
    9   <?dbhtml filename="setclock.html"?>
     8<sect1 id="ch-scripts-clock">
     9  <?dbhtml filename="clock.html"?>
    1010
    11   <title>Configuring the setclock Script</title>
     11  <title>Configuring the System Clock</title>
    1212
    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>
    1616
    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>
    2519
    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>
    3023
    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>
    4132
    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>
    4537
    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>
    4855
    4956<screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
     
    5966EOF</userinput></screen>
    6067
    61   <para>A good hint explaining how to deal with time on LFS is available
    62   at <ulink url="&hints-root;time.txt"/>. It explains issues such as
    63   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>
    6471
    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 &gt; /etc/adjtime &lt;&lt; "EOF"
     95<literal>0.0 0 0.0
     960
     97LOCAL</literal>
     98EOF</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>
    67131
    68132</sect1>
  • chapter07/site.xml

    r008436e rcba2d4e  
    1717
    1818  <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains
    19   settings that are automatically set for each boot script.  It can alternatively
    20   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>,
    2121  <filename>console</filename>, and <filename>clock</filename> files in the
    2222  <filename class='directory'>/etc/sysconfig/</filename> directory.  If the
  • chapter07/sysklogd.xml

    r008436e rcba2d4e  
    1717
    1818  <para>The <filename>sysklogd</filename> script invokes the
    19   <command>syslogd</command> program with the <parameter>-m 0</parameter>
    20   option.  This option turns off the periodic timestamp mark that
     19  <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
    2121  <command>syslogd</command> writes to the log files every 20 minutes by
    2222  default.  If you want to turn on this periodic timestamp mark, edit
  • chapter07/usage.xml

    r008436e rcba2d4e  
    99  <?dbhtml filename="usage.html"?>
    1010
    11   <title>How Do These Bootscripts Work?</title>
     11  <title>How Do the System V Bootscripts Work?</title>
    1212
    1313  <indexterm zone="ch-scripts-usage">
  • chapter08/kernel.xml

    r008436e rcba2d4e  
    7171    into account.</para>
    7272
    73     <para>Due to recent changes in <application>udev</application>, be sure to
    74     select:</para>
    75 
    76     <screen role="nodump">Device Drivers  ---&gt;
     73    <para>Be sure to enable or disable following features:</para>
     74
     75        <screen role="nodump">General setup  ---&gt;
     76  [*] open by fhandle syscalls
     77  [*] Control Group support
     78Processor type and features  ---&gt;
     79  [*] Enable seccomp to safely compute untrusted bytecode
     80Networking support  ---&gt;
     81  Networking options  ---&gt;
     82    &lt;*&gt; The IPv6 protocol
     83Device Drivers  ---&gt;
    7784  Generic Driver Options  ---&gt;
    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
     88File systems  ---&gt;
     89  [*] Inotify support for userspace
     90  &lt;*&gt; Kernel automounter version 4 support (also supports v3)
     91  Pseudo filesystems  ---&gt;
     92    [*] Tmpfs POSIX Access Control Lists
     93    [*] Tmpfs extended attributes</screen></note>
    7994
    8095<screen role="nodump"><userinput>make LANG=<replaceable>&lt;host_LANG_value&gt;</replaceable> LC_ALL= menuconfig</userinput></screen>
  • general.ent

    r008436e rcba2d4e  
    1 <!ENTITY version         "SVN-20140331">
    2 <!ENTITY releasedate     "March 31, 2014">
     1<!ENTITY version         "SVN-20140403">
     2<!ENTITY releasedate     "April 3, 2014">
    33<!ENTITY copyrightdate   "1999-2014"><!-- jhalfs needs a literal dash, not &ndash; -->
    4 <!ENTITY milestone       "7.6">
     4<!ENTITY milestone       "8.0">
    55<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
    66
  • packages.ent

    r008436e rcba2d4e  
    129129<!ENTITY diffutils-ch6-sbu "0.5 SBU">
    130130
     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
    131139<!-- NOTE: When updating e2fsprogs, remember to check the list
    132140     of acceptable features that can be shown by debugfs in
     
    363371<!ENTITY less-ch6-sbu "less than 0.1 SBU">
    364372
    365 <!ENTITY lfs-bootscripts-version "20140321">              <!-- Scripts depend on this format -->
     373<!ENTITY lfs-bootscripts-version "20140331">              <!-- Scripts depend on this format -->
    366374<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">         <!-- Updated in Makefile -->
    367375<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
     
    599607<!ENTITY texinfo-ch6-sbu "0.6 SBU">
    600608
    601 <!ENTITY systemd-version "208">
    602 <!ENTITY systemd-size    "2,328 KB">
     609<!ENTITY systemd-version "211">
     610<!ENTITY systemd-size    "2,604 KB">
    603611<!ENTITY systemd-url     "http://www.freedesktop.org/software/systemd/systemd-&systemd-version;.tar.xz">
    604 <!ENTITY systemd-md5     "df64550d92afbffb4f67a434193ee165">
     612<!ENTITY systemd-md5     "0a70c382b6089526f98073b4ee85ef75">
    605613<!ENTITY systemd-home    "http://www.freedesktop.org/wiki/Software/systemd/">
    606 <!ENTITY systemd-ch6-du  "29 MB">
    607 <!ENTITY systemd-ch6-sbu "0.1 SBU">
     614<!ENTITY systemd-ch6-du  "410 MB">
     615<!ENTITY systemd-ch6-sbu "4.5 SBU">
    608616
    609617<!ENTITY tzdata-version "2014a">
     
    615623<!ENTITY tzdata-ch6-sbu "less than 0.1 SBU">
    616624
    617 <!ENTITY udev-lfs        "udev-lfs-&systemd-version;-3">
    618 <!ENTITY udev-lfs-size   "29 KB">
    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    " ">
    622630
    623631<!ENTITY util-linux-version "2.24.1">
  • patches.ent

    r008436e rcba2d4e  
    2727<!ENTITY sysvinit-consolidated-patch-size "3.9 KB">
    2828
     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
    2933<!ENTITY tar-manpage-patch "tar-&tar-version;-manpage-1.patch">
    3034<!ENTITY tar-manpage-patch-md5 "321f85ec32733b1a9399e788714a5156">
  • udev-lfs/ChangeLog

    r008436e rcba2d4e  
     12014-03-02  <bdubbs@linuxfromscratch.org>
     2   * Makefile.lfs: Remove build procedures leaving only LFS rules
     3
    142014-02-16  <bdubbs@linuxfromscratch.org>
    25   * Makefile.lfs: Adjust warning flags.  Adjust linking rules to
  • udev-lfs/Makefile.lfs

    r008436e rcba2d4e  
    1 # Custom systemd Makefile that builds/installs udev only for LFS
    2 # Bruce Dubbs 2012-07-11
     1# Custom systemd Makefile that installs udev rules for LFS
     2# Bruce Dubbs 2014-04-02
    33
    44# vim: tabstop=3
    55
     6VERSION=20140302
    67SHELL=/bin/bash
    7 SYSTEMD_VERSION=208
    8 VERSION=$(SYSTEMD_VERSION)-3
    98
    109ifeq ($(V),)
     
    1413endif
    1514
    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
     15all:
     16        @echo "Use the install target"
    2517
    26 OPTIONS = -O2 -pipe -ffast-math -fno-common -fdiagnostics-show-option \
    27 -fno-strict-aliasing -ffunction-sections -fdata-sections -fPIC -std=gnu99
     18install:
     19        @mkdir -pv $(DESTDIR)/lib/udev/rules.d \
     20              $(DESTDIR)/etc/udev/rules.d \
     21              $(DESTDIR)/usr/share/doc/udev-$(VERSION)/lfs
    2822
    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
    31827
    31928   # 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  
    11The udev-lfs set of files is a customization of systemd.
    22In 2012, udev was merged with systemd and a build methodology
    3 incompatible with LFS.  These files extract the udev
    4 code from systemd for LFS.
     3incompatible with LFS.  These files add cusom udev rules
     4for LFS.
    55
    66These files are distributed in the form of a tar file available
     
    1111tar -jcf /tmp/udev-lfs-$VERSION.tar.bz2 -C /tmp udev-lfs-$VERSION
    1212
    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 
     13Makefile.lfs         - The LFS Makefile.  Installs udev rules for LFS.
    2014
    2115contrib              - Useful rules from debian
     
    322655-lfs.txt           - Documentation for LFS installed rules
    3327
    34 cfg.h                - Basic info needed for udev compilation
    35 
    3628ChangeLog            - Log of changes to 55-lfs-rules
    3729
Note: See TracChangeset for help on using the changeset viewer.