[ltp] hardware profiling scripts (i.e. solution for imPS/2 <> PS/2 problem)

André Wyrwa linux-thinkpad@linux-thinkpad.org
Wed, 21 Jan 2004 18:25:32 +0100


Hi,

> > If IMPS/2 is used instead then the pointer becomes random and almost 
> > uncontrollable - and that is with the trackpoint as well as the 
> > mouse. 
> 
> I can confirm that the trackpoint sucks with imPS/2.
> My planned solution is to built a script which probes if external mouse
> is connected or not and launches different Xfree86 configs depending on
> that.

I finally did this, which is also the first step towards my plan of
making up a generall system profiling infrastructure (the idea is not to
have fixed hardware profiles to switch between, but to have things
autoprobed and setup accordingly). However, so far, only the mouse part
is implemented, since it was the most urgent issue for me.

Ideas for functionality that i have so far:
- probing for availability of dualhead through second gfxcard in dock
- probe if my wacom tablet is present at ttyS0 and include xinputdrivers
accordingly
- probing for available ide drives and accordingly modification of fstab
and mount points
- probing for current network environment

At least in the beginning the whole thing will be specific for my T23
(and will probably be easily adoptable to other TPs), although i will
keep flexibility in mind.

I'm aware of the presence of other projects like this, like hotplug or
laptop-net. But all didn't provide the whole range of functionality i
want and i want to do this for some learning purpose as well.
Maybe the hotplug infrastructure is flexible enough to do all i want, I
just didn't like to dig into it.

I'm open for further ideas and would like to get comments and
suggestions, if there are any, and if someone wants what i have so far i
could make a tarball of the relevant files (guess there might be others
with the imPS/2 vs. PS/2 problem).

Also I'm interested at the moment if there might be a more general way
to brobe for external mouse presence than use of tpctl?

The preliminary infrastructure of my system profiling scripts 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
and in the future is supposed to take command line options to change
single profile settings.
(currently very primitive)

/etc/sysconfig/hwprofile:
Sourced by hwprofiler to know what it should do. So far has two
variables:
HWPROF_TESTERS=<space separated list of tester scripts>
HWPROF_CONFIGURATORS=<space separated list of 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>=<YES/NO> to
/var/state/hwprof/hwprofile.
(for now has a script called ps2mouse, which utilizes tpctl to probe for
presence of external ps2 mouse)

/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.
(currently has a xfree86 script which modifies the DefaultServerLayout
option of /etc/X11/XF86Config)

/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. I will probably do this in subdirs, so that there is one subdir
per configurator.
(has [xfree86/]XF86Config at the moment)

/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.
(this is future stuff)

/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.

Andre.