Re: Reformulation of criticisms about console-setup switch (was: Re: Review of console-setup wrt D-I [very long])
On Mon, Jun 29, 2009 at 07:32:39PM +0200, Frans Pop wrote:
> > Should I add one additional question or preseeding is enough?
> No, you need to implement automatic detection for this case.
> Please see kbd-chooser.c. It's not all that hard to find the code, nor
> should it be all that hard to implement it in C. See also the 90console
> script in finish-install.
I didn't known that such detection is possible. No C is required in
order to detect the presence of a physical keyboard - the following
shell code does the trick:
if grep "$tests" /proc/bus/input/devices /proc/bus/usb/devices >/dev/null; then
# there is a keyboard
# there is no keyboard
The detection of the serial console requires an ioctl but I think
console-setup-udeb doesn't need to know whether the console is serial or
I have some questions:
1. Can console-setup-udeb expect that /proc is mounted? Is there some
dependency about this?
2. Can console-setup-udeb expect that /proc/bus/usb is mounted? Is there
some dependency about this?
3. If the answer of 1 or 2 is no, then what can be done?
4. Are there architectures where kernel <=2.4 is used? The detection
doesn't work for such kernels.
5. What about the following scenario: the system is installed without a
keyboard, console-setup-udeb leaves the keyboard unconfigured and then
the user attaches a keyboard.