Ticket #4914: replace-eudev-with-udev.patch

File replace-eudev-with-udev.patch, 20.2 KB (added by DJ Lucas, 3 years ago)

Patch to replace eudev with udev directly from systemd

  • appendices/dependencies.xml

    diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml
    index e2a8e2f06..9fbf06ec9 100644
    a b  
    463463      <segmentedlist id="coreutils-before">
    464464        <segtitle>&before;</segtitle>
    465465        <seglistitem>
    466           <seg>Bash, Diffutils, Eudev, Findutils, and Man-DB</seg>
     466          <seg>Bash, Diffutils, udev, Findutils, and Man-DB</seg>
    467467        </seglistitem>
    468468      </segmentedlist>
    469469
     
    632632        </seglistitem>
    633633      </segmentedlist>
    634634
    635 <!-- Begin Eudev dependency info -->
    636   <bridgehead renderas="sect2" id="eudev-dep">Eudev</bridgehead>
    637 
    638       <segmentedlist id="eudev-depends">
    639         <segtitle>&dependencies;</segtitle>
    640         <seglistitem>
    641           <seg>Bash, Binutils, Coreutils, Gawk, GCC, Glibc, Grep, Gperf, Make,
    642           Sed, and Util-linux</seg>
    643         </seglistitem>
    644       </segmentedlist>
    645 
    646       <segmentedlist id="eudev-rundeps">
    647         <segtitle>&runtime;</segtitle>
    648         <seglistitem>
    649           <seg>Glibc, Kmod, Xz, Util-linux, and Zlib.</seg>
    650         </seglistitem>
    651       </segmentedlist>
    652 
    653       <segmentedlist id="eudev-testdeps">
    654         <segtitle>&testsuites;</segtitle>
    655         <seglistitem>
    656           <seg>None</seg>
    657         </seglistitem>
    658       </segmentedlist>
    659 
    660       <segmentedlist id="eudev-before">
    661         <segtitle>&before;</segtitle>
    662         <seglistitem>
    663           <seg>None</seg>
    664         </seglistitem>
    665       </segmentedlist>
    666 
    667       <segmentedlist id="eudev-optdeps">
    668         <segtitle>&external;</segtitle>
    669         <seglistitem>
    670           <seg>None</seg>
    671         </seglistitem>
    672       </segmentedlist>
    673 
    674635<!-- Begin Expat dependency info -->
    675636  <bridgehead renderas="sect2" id="expat-dep">Expat</bridgehead>
    676637
     
    15781539      <segmentedlist id="kmod-before">
    15791540        <segtitle>&before;</segtitle>
    15801541        <seglistitem>
    1581           <seg>Eudev</seg>
     1542          <seg>udev</seg>
    15821543        </seglistitem>
    15831544      </segmentedlist>
    15841545
     
    29862947        </seglistitem>
    29872948      </segmentedlist>
    29882949
     2950<!-- Begin udev dependency info -->
     2951  <bridgehead renderas="sect2" id="udev-dep">systemd-udev</bridgehead>
     2952
     2953      <segmentedlist id="udev-depends">
     2954        <segtitle>&dependencies;</segtitle>
     2955        <seglistitem>
     2956         <seg>Acl, Attr, Bash, Binutils, Coreutils, Diffutils, Expat, Gawk,
     2957         GCC, Glibc, Gperf, Grep, Jinaa2, Libcap, Meson, Ninja, Sed, and
     2958         Util-linux</seg>
     2959        </seglistitem>
     2960      </segmentedlist>
     2961
     2962      <segmentedlist id="udev-rundeps">
     2963        <segtitle>&runtime;</segtitle>
     2964        <seglistitem>
     2965          <seg>Glibc, Kmod, Xz, Util-linux, and Zlib.</seg>
     2966        </seglistitem>
     2967      </segmentedlist>
     2968
     2969      <segmentedlist id="udev-testdeps">
     2970        <segtitle>&testsuites;</segtitle>
     2971        <seglistitem>
     2972          <seg>None</seg>
     2973        </seglistitem>
     2974      </segmentedlist>
     2975
     2976      <segmentedlist id="udev-before">
     2977        <segtitle>&before;</segtitle>
     2978        <seglistitem>
     2979          <seg>None</seg>
     2980        </seglistitem>
     2981      </segmentedlist>
     2982
     2983      <segmentedlist id="udev-optdeps">
     2984        <segtitle>&external;</segtitle>
     2985        <seglistitem>
     2986          <seg>None</seg>
     2987        </seglistitem>
     2988      </segmentedlist>
     2989
    29892990<!-- Begin Util-linux dependency info -->
    29902991  <bridgehead renderas="sect2" id="util-linux-dep">Util-linux</bridgehead>
    29912992
    29922993      <segmentedlist id="util-linux-depends">
    29932994        <segtitle>&dependencies;</segtitle>
    29942995        <seglistitem>
    2995           <seg>Bash, Binutils, Coreutils, Diffutils, Eudev, Findutils, Gawk,
     2996          <seg>Bash, Binutils, Coreutils, Diffutils, udev, Findutils, Gawk,
    29962997          GCC, Gettext, Glibc, Grep, Libcap, Make, Ncurses, Sed, and Zlib</seg>
    29972998        </seglistitem>
    29982999      </segmentedlist>
     
    31393140      <segmentedlist id="xz-before">
    31403141        <segtitle>&before;</segtitle>
    31413142        <seglistitem>
    3142           <seg>Eudev, File, GRUB, Kmod, and Man-DB</seg>
     3143          <seg>udev, File, GRUB, Kmod, and Man-DB</seg>
    31433144        </seglistitem>
    31443145      </segmentedlist>
    31453146
  • appendices/udev-rules.xml

    diff --git a/appendices/udev-rules.xml b/appendices/udev-rules.xml
    index d1ab70dcf..ca1a7c88b 100644
    a b  
    1313  <title>Udev configuration rules</title>
    1414
    1515  <para>The rules in this appendix are listed for convenience.  Installation is
    16   normally done via instructions in <xref linkend='ch-system-eudev'/>.  </para>
     16  normally done via instructions in <xref linkend='ch-system-udev'/>.  </para>
    1717
    1818  <sect1 id="lfsrules" role="wrap">
    1919    <title>55-lfs.rules</title>
  • chapter03/packages.xml

    diff --git a/chapter03/packages.xml b/chapter03/packages.xml
    index 191f7f921..2c3e04846 100644
    a b  
    159159      </listitem>
    160160    </varlistentry>
    161161
    162     <varlistentry revision="sysv">
    163       <term>Eudev (&eudev-version;) - <token>&eudev-size;</token>:</term>
    164       <listitem>
    165         <para>Download: <ulink url="&eudev-url;"/></para>
    166         <para>MD5 sum: <literal>&eudev-md5;</literal></para>
    167       </listitem>
    168     </varlistentry>
    169 
    170162    <varlistentry>
    171163      <term>Expat (&expat-version;) - <token>&expat-size;</token>:</term>
    172164      <listitem>
     
    349341      </listitem>
    350342    </varlistentry>
    351343
    352     <varlistentry revision="systemd">
     344    <varlistentry>
    353345      <term>Jinja2 (&jinja2-version;) - <token>&jinja2-size;</token>:</term>
    354346      <listitem>
    355347        <para>Home page: <ulink url="&jinja2-home;"/></para>
     
    489481      </listitem>
    490482    </varlistentry>
    491483
    492     <varlistentry revision="systemd">
     484    <varlistentry>
    493485      <term>MarkupSafe (&markupsafe-version;) - <token>&markupsafe-size;</token>:</term>
    494486      <listitem>
    495487        <para>Home page: <ulink url="&markupsafe-home;"/></para>
     
    650642      </listitem>
    651643    </varlistentry>
    652644
    653     <varlistentry revision="systemd">
     645    <varlistentry>
    654646      <term>Systemd (&systemd-version;) - <token>&systemd-size;</token>:</term>
    655647      <listitem>
    656648        <para>Home page: <ulink url="&systemd-home;"/></para>
     
    659651      </listitem>
    660652    </varlistentry>
    661653
    662     <varlistentry revision="systemd">
     654    <varlistentry>
    663655      <term>Systemd Man Pages(&systemd-version;) - <token>&systemd-man-size;</token>:</term>
    664656      <listitem>
    665657        <para>Home page: <ulink url="&systemd-home;"/></para>
  • chapter08/chapter08.xml

    diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml
    index e9cb2b2ce..e0d0cca01 100644
    a b  
    8181  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    8282  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
    8383  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="vim.xml"/>
    84 
    85   <!-- systemd only -->
    8684  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="markupsafe.xml"/>
    8785  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="jinja2.xml"/>
     86
     87  <!-- systemd only -->
    8888  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>
    8989  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/>
    9090
    9191  <!-- sysv only -->
    92   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>
     92  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/>
    9393
    9494  <!-- Both sysv on systemd builds -->
    9595  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-db.xml"/>
  • chapter08/jinja2.xml

    diff --git a/chapter08/jinja2.xml b/chapter08/jinja2.xml
    index 5e38154ad..4fec52af3 100644
    a b  
    55  %general-entities;
    66]>
    77
    8 <sect1 id="ch-system-jinja2" role="wrap" revision="systemd">
     8<sect1 id="ch-system-jinja2" role="wrap">
    99  <?dbhtml filename="jinja2.html"?>
    1010
    1111  <sect1info condition="script">
  • chapter08/markupsafe.xml

    diff --git a/chapter08/markupsafe.xml b/chapter08/markupsafe.xml
    index 7e07a112b..08c2ba7ff 100644
    a b  
    55  %general-entities;
    66]>
    77
    8 <sect1 id="ch-system-markupsafe" role="wrap" revision="systemd">
     8<sect1 id="ch-system-markupsafe" role="wrap">
    99  <?dbhtml filename="markupsafe.html"?>
    1010
    1111  <sect1info condition="script">
  • new file chapter08/udev.xml

    diff --git a/chapter08/udev.xml b/chapter08/udev.xml
    new file mode 100644
    index 000000000..7541b0673
    - +  
     1<?xml version="1.0" encoding="ISO-8859-1"?>
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
     4  <!ENTITY % general-entities SYSTEM "../general.ent">
     5  %general-entities;
     6]>
     7
     8<sect1 id="ch-system-udev" role="wrap" revision="sysv">
     9  <?dbhtml filename="udev.html"?>
     10
     11  <sect1info condition="script">
     12    <productname>udev</productname>
     13    <productnumber>&systemd-version;</productnumber>
     14    <address>&systemd-url;</address>
     15  </sect1info>
     16
     17  <title>udev-&systemd-version;</title>
     18
     19  <indexterm zone="ch-system-udev">
     20    <primary sortas="a-udev">udev</primary>
     21  </indexterm>
     22
     23  <sect2 role="package">
     24    <title/>
     25
     26    <para>The udev package (extracted from systemd) contains programs
     27    for dynamic creation of device nodes.</para>
     28
     29    <segmentedlist>
     30      <segtitle>&buildtime;</segtitle>
     31      <segtitle>&diskspace;</segtitle>
     32
     33      <seglistitem>
     34        <seg>&udev-fin-sbu;</seg>
     35        <seg>&udev-fin-du;</seg>
     36      </seglistitem>
     37    </segmentedlist>
     38  </sect2>
     39
     40  <sect2 role="installation">
     41    <title>Installation of udev</title>
     42
     43    <para>First, remove two unneeded groups,
     44    <systemitem class="groupname">render</systemitem> and
     45    <systemitem class="groupname">sgx</systemitem>, from the default udev
     46    rules:</para>
     47
     48 <screen><userinput remap="pre"> sed -i -e 's/GROUP="render"/GROUP="video"/' \
     49        -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in</userinput></screen>
     50
     51    <para>Prepare udev for compilation:</para>
     52
     53<screen><userinput remap="configure">mkdir -p build
     54cd       build
     55
     56LANG=en_US.UTF-8                    \
     57meson --prefix=/usr                 \
     58      --sysconfdir=/etc             \
     59      --localstatedir=/var          \
     60      --buildtype=release           \
     61      -Dblkid=true                  \
     62      -Ddefault-dnssec=no           \
     63      -Dfirstboot=false             \
     64      -Dinstall-tests=false         \
     65      -Dldconfig=false              \
     66      -Dlink-udev-shared=false      \
     67      -Dsysusers=false              \
     68      -Db_lto=false                 \
     69      -Drpmmacrosdir=no             \
     70      -Dhomed=false                 \
     71      -Duserdb=false                \
     72      -Dman=false                   \
     73      -Dmode=release                \
     74      -Ddocdir=/usr/share/doc/systemd-&systemd-version; \
     75      ..</userinput></screen>
     76
     77    <variablelist>
     78      <title>The meaning of the meson options:</title>
     79
     80      <varlistentry>
     81        <term><parameter>--buildtype=release</parameter></term>
     82        <listitem>
     83          <para>This switch overrides the default buildtype
     84          (<quote>debug</quote>), which would produce unoptimized
     85          binaries.</para>
     86        </listitem>
     87      </varlistentry>
     88
     89      <varlistentry>
     90        <term><parameter>-Ddefault-dnssec=no</parameter></term>
     91        <listitem>
     92          <para>This switch turns off the experimental DNSSEC support.</para>
     93        </listitem>
     94      </varlistentry>
     95
     96      <varlistentry>
     97        <term><parameter>-Dfirstboot=false</parameter></term>
     98        <listitem>
     99          <para>This switch prevents installation of systemd
     100          services responsible for setting up the system for
     101          the first time. They are not useful for LFS because
     102          everything is done manually.</para>
     103        </listitem>
     104      </varlistentry>
     105
     106      <varlistentry>
     107        <term><parameter>-Dinstall-tests=false</parameter></term>
     108        <listitem>
     109          <para>This switch prevents installation of the compiled tests.</para>
     110        </listitem>
     111      </varlistentry>
     112
     113      <varlistentry>
     114        <term><parameter>-Dldconfig=false</parameter></term>
     115        <listitem>
     116          <para>This switch prevents installation of a systemd unit that runs
     117          <command>ldconfig</command> at boot, which is not useful for source
     118          distributions such as LFS and makes the boot time longer. Remove it
     119          if the described feature is desired.</para>
     120        </listitem>
     121      </varlistentry>
     122
     123      <varlistentry>
     124        <term><parameter>-Dlink-udev-shared=false</parameter></term>
     125        <listitem>
     126          <para>This switch prevents udevadm from linking against the
     127          libsystemd.so library, and instead generates the libudev.so
     128          library.</para>
     129        </listitem>
     130      </varlistentry>
     131
     132      <varlistentry>
     133        <term><parameter>-Dsysusers=false</parameter></term>
     134        <listitem>
     135          <para>This switch prevents installation of systemd
     136          services responsible for setting up the
     137          <filename>/etc/group</filename> and
     138          <filename>/etc/passwd</filename> files. Both files
     139          were created earlier in this chapter.</para>
     140        </listitem>
     141      </varlistentry>
     142
     143      <varlistentry>
     144        <term><parameter>-Drpmmacrosdir=no</parameter></term>
     145        <listitem>
     146          <para>This switch disables installation of RPM Macros
     147          for use with systemd because LFS does not support RPM.</para>
     148        </listitem>
     149      </varlistentry>
     150
     151      <varlistentry>
     152        <term><parameter>-D{userdb,homed}=false</parameter></term>
     153        <listitem>
     154          <para>Remove two daemons that have dependencies that do not fit
     155          the scope of LFS.</para>
     156        </listitem>
     157      </varlistentry>
     158
     159      <varlistentry>
     160        <term><parameter>-Dman=false</parameter></term>
     161        <listitem>
     162          <para>Prevent the generation of man pages to avoid extra
     163          dependencies.  We will install pre-generated man pages for systemd
     164          from a tarball later.</para>
     165        </listitem>
     166      </varlistentry>
     167
     168      <varlistentry>
     169        <term><parameter>-Dmode=release</parameter></term>
     170        <listitem>
     171          <para>Disable some features considered experimental by upstream.
     172          </para>
     173        </listitem>
     174      </varlistentry>
     175
     176    </variablelist>
     177
     178    <para>Compile the package:</para>
     179
     180<screen><userinput remap="make">LANG=en_US.UTF-8 ninja udevadm \
     181    $(grep '^build' build.ninja | sed 's/build \([^:]*\).*/\1/' | \
     182    egrep "^src/libudev|^src/udev|^rules.d|^hwdb.d") \
     183    $(realpath libudev.so --relative-to .)</userinput></screen>
     184
     185    <para>Install the package:</para>
     186
     187<screen><userinput remap="install">install -vm755 udevadm /usr/sbin
     188ln -sv udevadm /usr/sbin/udevd
     189install -vm755 libudev.so{,*[0-9]} /usr/lib
     190install -vdm755 /usr/lib/udev
     191install -vm755 $(find src/udev -type f | fgrep -v ".") /usr/lib/udev
     192install -vm644 src/libudev/*.pc /usr/lib/pkgconfig
     193install -vm644 src/udev/*.pc /usr/share/pkgconfig
     194install -vdm755 {/usr/lib,/etc}/udev/{hwdb,rules}.d
     195install -vm644 ../src/udev/udev.conf /etc/udev
     196install -vm644 ../src/libudev/libudev.h /usr/include
     197install -vm644 rules.d/* ../rules.d/{*.rules,README} /usr/lib/udev/rules.d
     198install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d</userinput></screen>
     199
     200    <para>Install the man pages:</para>
     201
     202<screen><userinput remap="install">tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz --strip-components=1 \
     203    -C /usr/share/man systemd-man-pages-&systemd-man-version;/{man3/libudev.3,man5/udev.conf.5} \
     204                      systemd-man-pages-&systemd-man-version;/{man7/{udev,hwdb}.7,man8/udevadm.8}</userinput></screen>
     205
     206
     207    <para>Install some custom rules and support files useful in an LFS
     208    environment:</para>
     209
     210<screen><userinput remap="install">tar -xvf ../&udev-lfs-version;.tar.xz
     211make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
     212
     213  </sect2>
     214
     215  <sect2 id="conf-udev" role="configuration">
     216    <title>Configuring udev</title>
     217
     218    <indexterm zone="conf-udev">
     219      <primary sortas="a-udev">udev</primary>
     220      <secondary>configuring</secondary>
     221    </indexterm>
     222
     223    <indexterm zone="conf-udev">
     224      <primary sortas="e-/etc/udev/hwdb.bin">/etc/udev/hwdb.bin</primary>
     225    </indexterm>
     226
     227    <para>Information about hardware devices is maintained in the
     228    <filename class="directory">/etc/udev/hwdb.d</filename> and
     229    <filename class="directory">/usr/lib/udev/hwdb.d</filename> directories.
     230    <application>udev</application> needs that information to be
     231    compiled  into a binary database <filename>/etc/udev/hwdb.bin</filename>.
     232    Create the initial database:</para>
     233
     234<screen><userinput>udevadm hwdb --update</userinput></screen>
     235
     236    <para>This command needs to be run each time the hardware information is
     237    updated.</para>
     238
     239  </sect2>
     240
     241  <sect2 id="contents-udev" role="content">
     242    <title>Contents of udev</title>
     243
     244    <segmentedlist>
     245      <segtitle>Installed programs</segtitle>
     246      <segtitle>Installed libraries</segtitle>
     247      <segtitle>Installed directories</segtitle>
     248
     249      <seglistitem>
     250        <seg><!-- These are in /usr/lib/udev and not to be called by the user:
     251         accelerometer, ata_id, cdrom_id, collect, mtd_probe,
     252         scsi_id, v4l_id,-->udevadm and udevd</seg>
     253
     254        <seg>libudev.so</seg>
     255
     256        <seg>/etc/udev and /usr/lib/udev</seg>
     257      </seglistitem>
     258    </segmentedlist>
     259
     260    <variablelist>
     261      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
     262      <?dbfo list-presentation="list"?>
     263      <?dbhtml list-presentation="table"?>
     264      <varlistentry id="udevadm" revision="sysv">
     265        <term><command>udevadm</command></term>
     266        <listitem>
     267          <para>Generic udev administration tool: controls the udevd daemon,
     268          provides info from the Udev database, monitors uevents, waits for
     269          uevents to finish, tests Udev configuration, and triggers uevents
     270          for a given device</para>
     271          <indexterm zone="ch-system-udev udevadm">
     272            <primary sortas="b-udevadm">udevadm</primary>
     273          </indexterm>
     274        </listitem>
     275      </varlistentry>
     276
     277      <varlistentry id="udevd">
     278        <term><command>udevd</command></term>
     279        <listitem>
     280          <para>A daemon that listens for uevents on the netlink socket,
     281          creates devices and runs the configured external programs in
     282          response to these uevents</para>
     283          <indexterm zone="ch-system-udev udevd">
     284            <primary sortas="b-udevd">udevd</primary>
     285          </indexterm>
     286        </listitem>
     287      </varlistentry>
     288
     289      <varlistentry id="libudev">
     290        <term><filename class="libraryfile">libudev</filename></term>
     291        <listitem>
     292          <para>A library interface to udev device information</para>
     293          <indexterm zone="ch-system-udev libudev">
     294            <primary sortas="c-libudev">libudev</primary>
     295          </indexterm>
     296        </listitem>
     297      </varlistentry>
     298
     299      <varlistentry id="etc-udev">
     300        <term><filename class="directory">/etc/udev</filename></term>
     301        <listitem>
     302          <para>Contains Udev configuration files,
     303          device permissions, and rules for device naming</para>
     304          <indexterm zone="ch-system-udev etc-udev">
     305            <primary sortas="e-/etc/udev">/etc/udev</primary>
     306          </indexterm>
     307        </listitem>
     308      </varlistentry>
     309
     310    </variablelist>
     311
     312  </sect2>
     313
     314</sect1>
  • packages.ent

    diff --git a/packages.ent b/packages.ent
    index 7d08cf9b1..7501dcbcb 100644
    a b  
    156156<!ENTITY elfutils-fin-du "115 MB">
    157157<!ENTITY elfutils-fin-sbu "0.9 SBU">
    158158
    159 <!ENTITY eudev-version "3.2.10">
    160 <!ENTITY eudev-size "1,916 KB">
    161 <!ENTITY eudev-url "https://dev.gentoo.org/~blueness/eudev/eudev-&eudev-version;.tar.gz">
    162 <!ENTITY eudev-md5 "60b135a189523f333cea5f71a3345c8d">
    163 <!ENTITY eudev-fin-du "80 MB">
    164 <!ENTITY eudev-fin-sbu "0.2 SBU">
    165 
    166159<!ENTITY expat-version "2.4.1">
    167160<!ENTITY expat-size "435 KB">
    168161<!ENTITY expat-url "&sourceforge;expat/expat-&expat-version;.tar.xz">
     
    656649<!ENTITY systemd-man-md5  "d9f2508d6b114b1c02476cd79b8fc786">
    657650<!ENTITY systemd-fin-du   "277 MB">
    658651<!ENTITY systemd-fin-sbu  "2.3 SBU">
     652<!ENTITY udev-fin-du      "83 MB">
     653<!ENTITY udev-fin-sbu     "0.1 SBU">
    659654
    660655<!ENTITY sysvinit-version "2.99">
    661656<!ENTITY sysvinit-size "124 KB">