[EMAIL PROTECTED] wrote:
Matt Darcy (the guvnah!) wrote:

c.) what are the livecd doing with udev - removing hotplug ? what rules
are they using ? etc

I'd hope they're using the same rules as LFS+BLFS.

Our rules contain all official ones, plus some livecd-specific ones.

If not, I'd suggest
they make requests to the relevant project so our rules files can cater to
their needs.

No, I prefer to keep the following additional rules as the livecd private property because they have no sense for LFS/BLFS:

1) The LiveCD cannot use the default network bootscript because it wants to get address via DHCP for every network device available. It is not possible with the standard bootscripts because we don't know the number and the names of available devices. Thus, the following long rule runs dhcpcd on every Ethernet-like device:

ACTION=="add", SUBSYSTEM=="net", SYSFS{addr_len}=="6", SYSFS{address}!="00:00:00:00:00:00", RUN+="/bin/sh -c 'PATH=/sbin:/bin dhcpcd %k -t 20 &'"

This is certainly not what you want to do on a regular system. To stop dhcpcd on removal of the device, we have:

ACTION=="remove", SUBSYSTEM=="net", RUN+="/bin/sh -c 'kill `cat /var/run/dhcpcd-%k.pid` ; exit 0'"

2) The LiveCD wants to autodetect the video card (in order to get more than 60 Hz on CRT, and work around Intel-specific VESA BIOS braindamage) and modify xorg.conf accordingly. Thus, we have a sample xorg.conf with the "vesa" driver, and the following rule:

ACTION=="add", BUS=="pci", SYSFS{class}=="0x030000", RUN+="detect-video"

This rule runs the script for every PCI/AGP video device found. The /lib/udev/detect-video script is just a wrapper around the getconfig.pl script provided by Xorg:

#!/bin/sh

SUB_VENDOR_ID=${PCI_SUBSYS_ID%:*}
SUB_DEVICE_ID=${PCI_SUBSYS_ID#*:}

VENDOR_ID=${PCI_ID%:*}
DEVICE_ID=${PCI_ID#*:}

X_DRIVER=`/usr/bin/getconfig.pl -b "0x$SUB_DEVICE_ID" -c 0x0300 \
        -d "0x$DEVICE_ID" -s "0x$SUB_VENDOR_ID" -v "0x$VENDOR_ID" 2>/dev/null`
if [ -n "$X_DRIVER" ] ; then
        echo "Using \"$X_DRIVER\" as a video driver" >/dev/console
        sed -i -e "s/vesa/$X_DRIVER/" /etc/X11/xorg.conf
fi

So this selects the same video driver as starting X without xorg.conf at all, but allows us to preload things like keyboard layout wheel mouse into xorg.conf.

BTW, xorg on the CD is also patched, for the following issues:

1) Not all monitors tell their physical size to xorg. If such information is missing, Xorg assumes 75 dpi. Result: unreadable Chinese text because of a too-small font. Sed: changes the default to 94 dpi which matches today's laptop screens better but still allows the default Terminal window to fit into 800x600. If the monitor does tell its dpi value to Xorg, the sed has no effect.

2) Some LCD monitors abuse the "maximum pixel clock" parameter to disable resolutions higher than their native one in MS Windows. By default, Xorg sees that they have wide range of allowed synchronization frequencies, pushes something like [EMAIL PROTECTED], and prints a warning about exceeding the bandwidth. The monitor gets upset. The patch makes such attempt an error, thus selecting the native resolution. Also it disables some weird builtin modes such as [EMAIL PROTECTED] The end result is that a good mode is picked up by default.

3) A sed is applied in order to use the "fixed" and "cursor" fonts from libXfont.so instead of files. Thus, a fully bitmap-free font configuration is achieved.

--
Alexander E. Patrakov
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to