Tuesday, May 14, 2013

ATI card switch between radeon and fglrx driver when boot time using systemd script under linux

It's true that the open source driver has been improved very quickly recently.
But if you can't make sure which is better,I suggest you to use both one.
My card is HD4250 , monitor is LG E1908, system is Gentoo.
Sometimes radeon can't display as 1440x900,but fglrx never failed.
fglrx also has a higher performance.But radeon is safer and  easier to use.
There is my scripts. I learn this from gentoo wiki.
I use two kernel.One is 3.9.0 without drm driver called kernel.
One is 3.10-rc1 with latest radeon driver called kernel-git.

Add  After=x11.service  to kdm.service

Create /etc/X11/radeon.conf and /etc/X11/fglrx.conf .

/etc/systemd/system/x11.service

[Unit]
Description=Xserver
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/local/sbin/x11.sh

[Install]
WantedBy=multi-user.target


/usr/local/sbin/x11.sh

#!/bin/sh

if   `dmesg | grep -q kernel-git`; then
        eselect opengl set xorg-x11
        ln -sf /etc/X11/radeon.conf /etc/X11/xorg.conf
else
        eselect opengl set ati
        ln -sf /etc/X11/fglrx.conf /etc/X11/xorg.conf
fi

No comments:

Post a Comment