chmod 444 /etc/X11/xdm/Xaccess
fi
-# Many package are still trying to find X in /usr/X11R6.
-# Until then, you can create a symbolic link to satisfy the /usr/X11R6
-# requirement so that you won't be inconvenienced with a package build
-# failure due to this known issue.
-#ln -scfT /usr /usr/X11R6
-
-cat > /etc/X11/xorg.conf.template << "EOF"
+# Header
+cat > /etc/X11/xorg.conf << "EOF"
# xorg.conf
-#
-# **********************************************************************
-# Input devices.
-# **********************************************************************
-Section "InputDevice"
- Identifier "Keyboard1"
- Driver "keyboard"
- Option "XkbRules" "xfree86"
- Option "XkbModel" "pc105"
- Option "XkbLayout" "_XF86_KEYBOARD_LAYOUT_"
- Option "XkbVariant" "_XF86_KEYBOARD_VARIANT_"
- Option "XkbOptions" "_XF86_KEYBOARD_OPTIONS_"
- Option "AutoRepeat" "500 30"
-EndSection
-Section "InputDevice"
- Identifier "Mouse1"
- Driver "mouse"
- Option "Emulate3Buttons"
- Option "Protocol" "auto"
- Option "Device" "/dev/input/mice"
- Option "ZAxisMapping" "4 5"
- Option "Buttons" "5"
-EndSection
+EOF
-# **********************************************************************
-# Monitor section
-# No need to specify VertRefresh and HorizSync, as DDC2 data will
-# be used (if monitor is recent and supports it).
-# **********************************************************************
-Section "Monitor"
- Identifier "Monitor1"
- VendorName "Unknown"
- ModelName "Unknown"
+# Keyboard section, if applicable
+if [ -n ${XORG_KEYBOARD_LAYOUT} ]; then
+ cat >> /etc/X11/xorg.conf << "EOF"
+Section "InputClass"
+ Identifier "Keyboard Defaults"
+ MatchIsKeyboard "yes"
+EOF
+ echo "Option \"XkbLayout\" \"${XORG_KEYBOARD_LAYOUT}\"" >> /etc/X11/xorg.conf
+ if [ -n ${XORG_KEYBOARD_VARIANT} ]; then
+ echo "Option \"XkbVariant\" \"${XORG_KEYBOARD_VARIANT}\"" >> /etc/X11/xorg.conf
+ fi
+ cat >> /etc/X11/xorg.conf << "EOF"
EndSection
-# **********************************************************************
-# Device (video card) section
-# **********************************************************************
+EOF
+fi
+
+# Video driver section
+cat >> /etc/X11/xorg.conf << "EOF"
Section "Device"
Identifier "VideoCard1"
Driver "_VIDEO_CARD_DRIVER_"
EndSection
-
-# **********************************************************************
-# Screen section
-# **********************************************************************
-Section "Screen"
- Identifier "Screen1"
- Device "VideoCard1"
- Monitor "Monitor1"
- DefaultColorDepth 24
- Subsection "Display"
- Depth 24
- Modes "1024x768" "800x600"
- ViewPort 0 0
- EndSubsection
-EndSection
-
-# **********************************************************************
-# Layout(s) section
-# **********************************************************************
-Section "ServerLayout"
- Identifier "Default"
- Screen "Screen1"
- InputDevice "Mouse1" "CorePointer"
- InputDevice "Keyboard1" "CoreKeyboard"
-EndSection
-
EOF
-sed -i -e "s!_HV_FONTS_PATH_!${HV_FONTS_PATH}!g" /etc/X11/xorg.conf.template
-sed -i -e "s!_VIDEO_CARD_DRIVER_!${XORG_VIDEO_DRIVER}!g" /etc/X11/xorg.conf.template
-sed -i -e "s!_XF86_KEYBOARD_LAYOUT_!${HV_XF86_KEYBOARD_LAYOUT}!g" /etc/X11/xorg.conf.template
-sed -i -e "s!_XF86_KEYBOARD_VARIANT_!${HV_XF86_KEYBOARD_VARIANT}!g" /etc/X11/xorg.conf.template
-sed -i -e "s!_XF86_KEYBOARD_OPTIONS_!${HV_XF86_KEYBOARD_OPTIONS}!g" /etc/X11/xorg.conf.template
+sed -i -e "s!_VIDEO_CARD_DRIVER_!${XORG_VIDEO_DRIVER}!g" /etc/X11/xorg.conf
exit $?