Changeset a263c7a for chapter06/udev.xml
- Timestamp:
- 07/12/2006 03:40:52 PM (18 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 12.2, 12.2-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 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/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 77e97ae
- Parents:
- cd2f7f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/udev.xml
rcd2f7f0 ra263c7a 95 95 </variablelist> 96 96 97 <para>Udev 's configuration is far from ideal by default, so install98 the configuration files here:</para>99 100 <!-- FIXME: 90-bug.rules should be removed from the tarball once the book is released --> 97 <para>Udev has to be configured in order to work properly, and does 98 not come with any sort of "default" configuration. Install the 99 LFS-specific configuration files:</para> 100 101 101 <screen><userinput>cp -v &udev-config;/[0-9]* /etc/udev/rules.d/</userinput></screen> 102 103 <para>Now install a helper script that is not included in the main Udev104 tarball:</para>105 106 <screen><userinput>install -v -m 744 &udev-config;/write_cd_aliases /lib/udev/</userinput></screen>107 102 108 103 <para>Install the documentation that explains how to create Udev rules:</para> … … 110 105 <screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html \ 111 106 /usr/share/doc/udev-&udev-version;/index.html</userinput></screen> 112 113 <important>114 115 <para>When Udev is started by the LFS-Bootscripts, a replay of all kernel116 device events happens. These events tell Udev what devices exist.117 Sometimes the Udev bootscript doesn't wait long enough for118 <command>udevd</command> to process all of the replayed events and119 consequently the devices for those missed events are not created before the120 script exits. Since <command>udevd</command> is still running in the121 background, the devices will be created a few milliseconds later, but the122 next bootscript to run may require a device to exist before it has been123 created. To avoid such missed events, and to avoid hardcoding an overly124 long wait time, It is recommended that you run the following commands to125 aid the LFS development team in debugging these missed events and finding126 an acceptable solution more quickly.</para>127 128 <para>First, create a simple C file:</para>129 130 <screen><userinput>cat > bug.c << EOF131 <literal>/* Simple event recorder */132 #define _GNU_SOURCE133 #include <sys/types.h>134 #include <sys/stat.h>135 #include <fcntl.h>136 #include <unistd.h>137 #include <stdlib.h>138 #include <argz.h>139 int main(int argc, char * argv[])140 {141 char * envar;142 char * envz;143 size_t len;144 int bug;145 bug = open("/dev/bug", O_WRONLY | O_APPEND);146 if (bug == -1)147 return 0;148 149 /* Ignore everything USB-related to avoid spamming the list */150 envar = getenv("PHYSDEVPATH");151 if (envar && strstr(envar, "usb"))152 return 0;153 envar = getenv("DEVPATH");154 if (envar && strstr(envar, "usb"))155 return 0;156 157 setenv("_SEPARATOR", "-------------------------------", 1);158 argz_create(environ, &envz, &len);159 argz_stringify(envz, len, '\n');160 envz[len-1]='\n';161 write(bug, envz, len);162 close(bug);163 free(envz);164 return 0;165 }</literal>166 EOF</userinput></screen>167 168 <para>Now compile it:</para>169 170 <screen><userinput>gcc -o /lib/udev/bug bug.c</userinput></screen>171 172 <para>When booting the new LFS system, if any events are missed, a warning173 message will appear and a <filename>/dev/bugreport</filename> file will be174 created. The warning message will tell you where to send feedback.</para>175 176 </important>177 107 178 108 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.