View Full Version : How do I overlay a file before XFree86 reads it?

08-15-2005, 06:52 AM
My touchscreen calibration program writes a tiny data file to /etc/ that it needs when I boot it up, so I calibrated it and then remastered the CD.

It works great but I have one problem... what if the calibration drifts and I need to recalibrate? Also, I want to use my remaster with lots of different PC's each with a touchscreen that has its own calibration settings, and I don't want to have to remaster the CD everytime.

In short, what I need is the ability to save the calibration file to my usb-stick, and then have it overlay the file onto the ramdisk in the correct location (the /etc/ directory) before XFree86 runs the /etc/X11/XF86Config4-in file. Obviously I need to modify a boot script, but which one (which one loads first?), and is this what I would put in it?

su - [username] << _copy_calibration_settings
mount /dev/sda
cp -rf settingsfile.dat /etc
umount /dev/sda

Or is there a better way to do it? And again - where should I put this so it completes before the Xsettings are initiated (XF86Config)?

Thanks in advance!