[ltp] UI chooser for non-root switching of xorg.conf prior to starting X? - plus sample xorg.conf files for T41p...

André Wyrwa linux-thinkpad@linux-thinkpad.org
Sat, 21 May 2005 04:17:30 +0200


--=-ma5vBYtAkVeVXCwoH6Gx
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hei,

> If you successively get a script or GDM working, post it here. I'd be
> quite interested in this myself.

I just had a look into GDM capabilities and it seems i was wrong. The
chooser is actually only for XDMCP requests which doesn't help us. Also
the flexiserver capability doesn't help.

In fact, to show a graphical chooser as GDM does you would already have
to have an X server running, which is not what we want.

But i can propose a solution i started (and posted) a long time ago: a
hardware profiling infrastructure (that would cover everything hotplug
and udev don't).

The things i originally wanted to use this for:
- probing for availability of a second monitor
- probing for wacom tablet at ttyS0 (because if not present the
according X input drivers probes for some time when enabled)
- probing for available ide drives (got kind of obsolete through udev)
- probing for current network environment (there are other solutions)

The preliminary infrastructure looks like this (base system is LFS):

/etc/rc.d/init.d/hwprofiler:
This is supposed to be the main script. It launches all other scripts.

/etc/sysconfig/hwprofile:
Sourced by hwprofiler to know what it should do. It has two variables:
HWPROF_TESTERS=3D<list of enabled tester scripts>
HWPROF_CONFIGURATORS=3D<list of enabled configurator scripts>

/etc/sysconfig/hwprof/testers:
Directory to place tester scripts in. The tester scripts are supposed to
export variables in the form HWPROF_<PROPERTY>=3D<YES/NO> to
/var/state/hwprof/hwprofile.

/etc/sysconfig/hwprof/configurators:
Directory to place configurator scripts in. Configurator scripts are
supposed to do the neccessary changes to the system, which can be direct
modification of config files, setting of environment variables, loading
of kernel modules or starting programs.
(i.e. could contain a xorg script which modifies the DefaultServerLayout
option of /etc/X11/xorg.conf)

/etc/sysconfig/hwprof/templates:
Directory to place template files for system config files in, so that
the actual config files can be generated from them by the configurator
scripts.
(should have xorg.conf as a template)

/etc/sysconfig/hwprof/files:
Directory which consists of subdirs (one for each configurator), which
hold a root level based directory tree with files to be copied to the
according locations in the root filesystem tree by the configurators.

/var/state/hwprof/hwprofile
File which holds the variables from the tester scripts, so that they can
later be sourced from anywhere one likes to.

So the basic idea in our case is this:
You have a xorg tester script which automatically determines if a second
monitor is available (X -probeonly and tpctl can be utilized for that).
It could also just ask the user for input via console.
It writes a variable to /var/state/hwprof/hwprofile.
After that the xorg configurator script is launched including that file
and depending on the variable copys the /etc/hwprof/templates/xorg.conf
file to /etc/X11/xorg.conf, modifying the DefaultServerLayout parameter.
It could also just copy completely different source templates.
This all is done through calling /etc/rc.d/init.d/hwprofiler by running
it sometime in the middle of your init process.

I actually have written parts of that and was using it to determine if
an external mouse is present or not on my older T23. The T41p made that
obsolete, however.

Andre.


--=-ma5vBYtAkVeVXCwoH6Gx
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBCjpo6EOp8fsnyxsQRApCNAJwLQPlxeiHSX0YBi0sHFnomrMXkRwCcCxqA
5sFKlDTD2cpHawzNi1p+C2I=
=vvMk
-----END PGP SIGNATURE-----

--=-ma5vBYtAkVeVXCwoH6Gx--