usbutils: Use hwdata package for usb.ids

This commit is contained in:
Xi Ruoyao 2024-03-18 17:45:04 +08:00
parent 053cc79075
commit 7ff7885c8c
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -86,14 +86,7 @@
<bridgehead renderas="sect4">Recommended</bridgehead>
<para role="recommended">
<!-- git is required by autogen.sh. If using the tarball on kernel.org,
autogen.sh does not need to be run. If using the github source,
autogen.sh needs to be run, and git is used to pull the usbhid-dump
submodule.
<xref linkend="git"/> and -->
<xref linkend="wget"/>
<!-- In the systemd book, a unit/timer is installed to update the
usb.ids file automatically. wget is used in the instructions below. -->
<xref role="runtime" linkend="hwdata"/> (runtime)
</para>
</sect2>
@ -120,14 +113,10 @@ make</userinput></screen>
<screen role="root"><userinput>make install</userinput></screen>
<para>
To install the <filename>usb.ids</filename> data file, using
<xref linkend="wget"/>, run, as the
<systemitem class="username">root</systemitem> user:
For the <filename>usb.ids</filename> data file, install the
<xref linkend='hwdata'/> package.
</para>
<screen role="root"><userinput>install -dm755 /usr/share/hwdata/ &amp;&amp;
wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</userinput></screen>
<para>
The script <command>lsusb.py</command> displays information in a more
easily readable form than <command>lsusb</command>. To find the options,
@ -147,61 +136,6 @@ wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</userinput></
</sect2>
-->
<sect2 role="configuration">
<title>Configuring USB Utils</title>
<para revision="sysv">
The <filename>usb.ids</filename> data file is constantly being updated.
To get a current version of this file, using <xref linkend="wget"/>,
periodically run again, as the
<systemitem class="username">root</systemitem> user:
</para>
<screen role="root" revision="sysv"><userinput>wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</userinput></screen>
<para>
You should update the <filename>/usr/share/hwdata/usb.ids</filename> file
periodically. <phrase revision="sysv">If you've installed
<xref linkend="fcron"/> and completed the section on periodic jobs,
execute</phrase><phrase revision="systemd">Execute</phrase> the following commands, as the <systemitem class="username">root</systemitem> user,
to create a <phrase revision="sysv">weekly cron job:</phrase>
<phrase revision="systemd">systemd timer to update it weekly on Sundays
at 2:30 A.M. (local time):</phrase>
</para>
<screen role="nodump" revision="sysv"><userinput>cat &gt; /etc/cron.weekly/update-usbids.sh &lt;&lt; "EOF" &amp;&amp;
<literal>#!/bin/bash
/usr/bin/wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</literal>
EOF
chmod 754 /etc/cron.weekly/update-usbids.sh</userinput></screen>
<screen role="root" revision="systemd"><userinput>cat &gt; /usr/lib/systemd/system/update-usbids.service &lt;&lt; "EOF" &amp;&amp;
<literal>[Unit]
Description=Update usb.ids file
Documentation=man:lsusb(8)
DefaultDependencies=no
After=local-fs.target network-online.target
Before=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</literal>
EOF
cat &gt; /usr/lib/systemd/system/update-usbids.timer &lt;&lt; "EOF" &amp;&amp;
<literal>[Unit]
Description=Update usb.ids file weekly
[Timer]
OnCalendar=Sun 03:00:00
Persistent=true
[Install]
WantedBy=timers.target</literal>
EOF
systemctl enable update-usbids.timer</userinput></screen>
</sect2>
<sect2 role="content">
<title>Contents</title>