PREIN
/bin/sh
{
# Install/Upgrade section
pushd /etc/X11
# Migrate any pre-existing XFree86 4.x config file to xorg.conf if it
# doesn't already exist, and rename any remaining XFree86 4.x config files
# to have .obsoleted file extensions, to help avoid end user confusion for
# people unaware of the config file name change between server
# implementations, and avoid bug reports. If this turns out to confuse
# users, I can modify it to add comments to the top of the obsoleted files
# to point users to xorg.conf <mharris@redhat.com>
for configfile in XF86Config XF86Config-4 ; do
if [ -r $configfile ]; then
if [ -r xorg.conf ]; then
mv -f $configfile $configfile.obsoleted
else
mv -f $configfile xorg.conf
fi
fi
done
# Massage pre-existing config files to work properly with X.org X11
# - Remove xie and pex5 modules from the config files, as they are long
# since obsolete, and not provided since XFree86 4.2.0
# - Remove Option "XkbRules" "xfree86" to help work around upgrade problems
# such as https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=120858
# for configfile in xorg.conf ; do
configfile="xorg.conf"
OLD_MODULEPATH="/usr/X11R6/lib/modules"
if [ -r $configfile -a -w $configfile ]; then
# Remove module load lines from the config file for obsolete modules
perl -p -i -e 's/^.*Load.*"(pex5|xie|xtt).*\n$"//gi' $configfile
# Change the keyboard configuration from the deprecated "keyboard"
# driver, to the newer "kbd" driver.
perl -p -i -e 's/^\s*Driver(.*)"keyboard"/Driver\1"kbd"/gi' $configfile
# Remove any Options "XkbRules" lines that may be present
perl -p -i -e 's/^.*Option.*"XkbRules".*"(xfree86|xorg)".*\n$//gi' $configfile
# Remove RgbPath specifications from the config file as they are
# unnecessary, and break upgrades from monolithic to modular X.
# Fixes bugs (#173036, 173435, 173453, 173428)
perl -p -i -e 's#^\s*RgbPath.*$##gi' $configfile
# If ModulePath is specified in the config file, check for the old
# monolithic module path, and replace it with the new one.
perl -p -i -e "m,^\s*ModulePath.*\"${OLD_MODULEPATH}\".*$,; s,${OLD_MODULEPATH},/usr/lib64/xorg/modules," $configfile
fi
# done
popd
} &> /dev/null || :