FreeBSD: Upgrading xorg 6.9.0 to 7.2 in 2-Days…

fdx-logo-text1 It took me just over two days to complete the upgrade from xorg 6.9.0 to 7.2 on my ThinkPadT43P. ThinkPads have a tendency to run too hot if left at higher speeds. Because of this the bios was changed to “Maximum battery life”. Hence, causing the CPU to run at a lower frequency about 800Mhz. Nonetheless, the upgrade of my machine went well as documented in /usr/ports/UPDATING:

20070519:
AFFECTS: users of x11/xorg
AUTHOR: kris@FreeBSD.org

Welcome, fearless user! You are about to embark upon a mystical
journey to the world of xorg 7.2.

It was suggested, before upgrading to Xorg 7.2, that:

  1. That the port portupgrade-devel be installed and the INDEX db rebuilt before before recreating a new index.
  2. That the command, “script xorg-upgrade” be ran before preceding to retain any failures which may occur.
  3. That the environment variable BATCH is set to yes to avoid interactive dialog boxes from apprearing. An absolute must!

Switching portupgrade to portupgrade-devel:

thinkpad# portupgrade -f -o ports-mgmt/portupgrade-devel portupgrade
[Updating the portsdb <format:bdb_btree> in /usr/ports … – 17232 port entries found ………1000………2000………3000………4000………5000………6000………7000………8000………9000………10000………11000………12000………13000………14000………15000………16000………17000.. ….. done]
** Detected a package name change: portupgrade (ports-mgmt/portupgrade) -> ‘portupgrade-devel’ (ports-mgmt/portupgrade-devel)
—> Downgrading ‘portupgrade-2.2.6_3,2’ to ‘portupgrade-devel-2.3.0_5’ (ports-mgmt/portupgrade-devel)
—> Building ‘/usr/ports/ports-mgmt/portupgrade-devel’
…edited…
/sbin/ldconfig -m /usr/local/lib/compat/pkg
===> Installing ldconfig configuration file
if [ ! -f /usr/local/etc/pkgtools.conf ]; then /bin/cp -p /usr/local/etc/pkgtools.conf.sample /usr/local/etc/pkgtools.conf; fi
===> Registering installation for portupgrade-devel-2.3.0_5
…edited…
49.543u 27.972s 2:09.06 60.0% 41+21643k 5724+1281io 487pf+0w
thinkpad# rm -f /usr/ports/INDEX*.db /var/db/pkg/pkgdb.db
thinkpad# pkgdb -fu
—> Updating the pkgdb
…edited…
40.682u 44.729s 2:20.17 60.9% 23+23152k 14639+539io 0pf+0w

Before the upgrade begins make sure to set the XORG_UPGRADE environment variable to yes

  • If libXft is installed, upgrade it:

Check if libXft is even installed:

thinkpad# pkg_info | grep libXftt
libXft-2.1.7_1 A client-sided font API for X applications

Recursively upgrade libXft:

thinkpad# portupgrade -Rf libXft
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg … – 695 packages found (-0 +54) ……………………………………………… done]
1734.316u 682.870s 53:37.40 75.1% 1981+6732k 13596+68902io 9361pf+0w

Recursively upgrad all ports except gstreamer*thinkpad# portupgrade -a -x ‘gstreamer*’
…edited…
===> Cleaning for xbitmaps-1.0.1
===> Cleaning for xproxymanagementprotocol-1.0.2
===> Cleaning for gnome2-2.18.1_1
—> Cleaning out obsolete shared libraries
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg … – 892 packages found (-0 +1) . done]
109795.134u 44192.506s 52:35:43.58 81.3% 116+-58k 662401+1211644io 244109pf+8w

Whew!! The above took over 2-days!!!

Recursively, upgrade gstreamer:

portupgrade -Rr ‘gstreamer*’
…edited…
===> Cleaning for gstreamer-plugins-core-0.10_8
—> Cleaning out obsolete shared libraries
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg … – 892 packages found (-0 +1) . done]
6793.799u 3899.775s 4:01:39.46 73.7% 925+881k 31094+89124io 19770pf+0w

Upgrade all ports, using packages whenever possible to speed things up

thinkpad# portupgrade -aP
Stale dependency: gnome2-2.18.1_1 –> gnome-themes-2.18.1_1 — manually run ‘pkgdb -F’ to fix, or specify -O to force.
thinkpad# pkgdb -F
—> Checking the package registry database
Stale origin: ‘x11/xorg-manpages’: perhaps moved or obsoleted.
-> The port ‘x11/xorg-manpages’ was removed on because:
“X.org manual pages are now installed with every single port”
-> Hint: xorg-manpages-6.9.0 is not required by any other package
-> Hint: checking for overwritten files…
-> No files installed by xorg-manpages-6.9.0 have been overwritten by other packages.
Deinstall xorg-manpages-6.9.0 ? [no] y
—> Deinstalling ‘xorg-manpages-6.9.0’
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg … – 891 packages found (-1 +0) (…) done]
–> Done.
Stale dependency: gnome2-2.18.1_1 -> gnome-themes-2.18.1_1 (x11-themes/gnome-themes):
gnome-terminal-2.18.0_1 (score:36%) ? ([y]es/[n]o/[a]ll) [no] Install stale dependency? ([y]es/[n]o/[a]ll) [yes] no
New dependency? (? to help):
Delete this? ([y]es/[n]o/[a]ll) [yes] a
Deleted.
Stale dependency: k3b-1.0_2 -> ffmpeg-0.4.9.p1_7 (multimedia/ffmpeg):
ffmpeg-devel-2007.04.29_2 (score:28%) ? ([y]es/[n]o/[a]ll) [no] a
Fixed. (-> ffmpeg-devel-2007.04.29_2)
a194.681u 93.861s 9:05.50 52.8% 188+7631k 1168+51io 5pf+0w

Now we can continue on with upgrading packages with packages if avaliable

thinkpad# portupgrade -aP
** Port marked as IGNORE: net/iwi-firmware:
is an interactive port
242.430u 132.942s 6:51.25 91.2% 171+26511k 1549+49io 6pf+0w

Nice! No more ports to upgrade!! According the /usr/ports/UPDATING, it is now time to remove xorg-manpages\*, but they were already removed. Again, let’s remove all xorg-manpages, just to make sure they are all gone.

thinkpad# pkg_delete xorg-manpages\*
pkg_delete: no such package ‘xorg-manpages*’ installed

Good. From /usr/ports/UPDATING

The final step is to merge files from /usr/X11R6 into /usr/local, since /usr/X11R6 will no longer be used with xorg 7.2. The provided script, mergebase.sh, will take care of moving and linking, but the script may need to be updated manually.

Merge files from /usr/X11R6 into /usr/local:

thinkpad# sh /usr/ports/Tools/scripts/mergebase.sh
This script will attempt to backup /usr/X11R6 into
/usr/tmp/mergebase/oldx11base.20070527.104844.tar and then move the
contents onto /usr/local. It will then replace /usr/X11R6
with a symbolic link, pointing to /usr/local. After that,
the script will attempt to change some settings in /etc
that by default point to both /usr/X11R6 and /usr/local
to remove references to /usr/X11R6; specifically, the files
that could get altered are /etc/periodic.conf
/etc/manpath.config /etc/rc.conf.

Be advised that this script expects default environment,
notably it assumes that you have not changed $X11BASE and
$LOCALBASE variables from their default values and that
/usr/X11R6 is regular directory and not separate mount.

If these assumptions are not correct, either edit this script
to change $X11BASE $LOCALBASE and/or $BACKUPDIR values or
do the merge by hand (perhaps using this script as a rough guide).

Enter ‘yes’ to continue, anything else will exit script: yes
CONFLICTING FILES:
./etc/gconf/gconf.xml.defaults/%gconf-tree-af.xml
./etc/gconf/gconf.xml.defaults/%gconf-tree-ar.xml
./etc/gconf/gconf.xml.defaults/%gconf-tree-az.xml
./etc/gconf/gconf.xml.defaults/%gconf-tree-be.xml
./etc/gconf/gconf.xml.defaults/%gconf-tree-bg.xml
./etc/gconf/gconf.xml.defaults/%gconf-tree-bn.xml
…edited…
./share/locale/zh_CN/LC_MESSAGES/gnome-mime-data.mo
./share/locale/zh_TW/LC_MESSAGES/gnome-mime-data.mo
./share/nls/POSIX
./share/nls/en_US.US-ASCII

Files that exist both in /usr/local and /usr/X11R6 have been found as shown above. Merging will not continue.
While some such files are safe to remove as they will be regenerated (like /usr/X11R6/man/whatis), some you might want to move away somewhere safe, and some might point to conflicts in ports.
For this script to continue, you need to either move these files away from /usr/X11R6 or delete them. If you don’t know what to do about a particular file, ask on x11@FreeBSD.org mailing list.
The list is saved in /tmp/mergebase.tXkmXYVH.

The conflicting files in both /usr/X11R6 and /usr/local will be backed up with shar then removed

Backup conflicting files in /usr/X11R6

thinkpad# cd /usr/X11R6/
thinkpad# shar `cat /tmp/mergebase.tXkmXYVH` > /tmp/usr.X11R6.conflicts.sh
thinkpad# file !$
file /tmp/usr.X11R6.conflicts.sh
/tmp/usr.X11R6.conflicts.sh: UTF-8 Unicode English text, with very long lines

Backup conflicting files in /usr/local

thinkpad# cd /usr/local
thinkpad# shar `cat /tmp/mergebase.tXkmXYVH` > /tmp/usr.local.conflicts.sh
thinkpad# file !$
file /tmp/usr.local.conflicts.sh
/tmp/usr.local.conflicts.sh: UTF-8 Unicode text, with very long lines
Now, remove the conflicting files in /usr/X11R6 and /usr/local

Remove files in /usr/local/ first

thinkpad# pwd
/usr/local
thinkpad# rm `cat /tmp/mergebase.tXkmXYVH`
thinkpad# ls `cat /tmp/mergebase.tXkmXYVH`
ls: ./etc/gconf/gconf.xml.defaults/%gconf-tree-af.xml: No such file or directory
…edited…
ls: ./share/nls/POSIX: No such file or directory
ls: ./share/nls/en_US.US-ASCII: No such file or directory

Next, remove files in /usr/X11R6/

thinkpad# cd /usr/X11R6/
thinkpad# rm `cat /tmp/mergebase.tXkmXYVH`
ls: ./etc/gconf/gconf.xml.defaults/%gconf-tree-af.xml: No such file or directory
ls: ./etc/gconf/gconf.xml.defaults/%gconf-tree-ar.xml: No such file or directory
…edited…
ls: ./share/nls/POSIX: No such file or directory
ls: ./share/nls/en_US.US-ASCII: No such file or directory

Again, merge files from /usr/X11R6 into /usr/local:

thinkpad# sh /usr/ports/Tools/scripts/mergebase.sh
This script will attempt to backup /usr/X11R6 into
/usr/tmp/mergebase/oldx11base.20070527.112032.tar and then move the
contents onto /usr/local. It will then replace /usr/X11R6
with a symbolic link, pointing to /usr/local. After that,
the script will attempt to change some settings in /etc
that by default point to both /usr/X11R6 and /usr/local
to remove references to /usr/X11R6; specifically, the files
that could get altered are /etc/periodic.conf
/etc/manpath.config /etc/rc.conf.

Be advised that this script expects default environment,
notably it assumes that you have not changed $X11BASE and
$LOCALBASE variables from their default values and that
/usr/X11R6 is regular directory and not separate mount.

If these assumptions are not correct, either edit this script
to change $X11BASE $LOCALBASE and/or $BACKUPDIR values or
do the merge by hand (perhaps using this script as a rough guide).
Enter ‘yes’ to continue, anything else will exit script: yes
==> Creating backup of X11BASE in /usr/tmp/mergebase…
a .
a man
a bin
a etc
a include
a lib
a libdata
a share
a info
a libexec
a Adobe
a www
…edited…
==> Merging X11BASE into LOCALBASE…
==> Creating compatibility symlink /usr/X11R6 -> /usr/local…
==> Removing /usr/X11R6/etc/periodic from periodic setup…
==> Removing /usr/X11R6/man from MANPATH…
==> Removing /usr/X11R6 from rc sequence…

The contents of /usr/X11R6 has been backed up in /usr/tmp/mergebase.
Remove it once you are sure nothing has been lost in merge.

/usr/X11R6 has been removed from periodic setup. You might
want to review /etc/periodic.conf for changes.

/usr/X11R6 has been commented out in /etc/manpath.config.
You might want to review the changes there.

/usr/X11R6 has been removed from system initialization (rc).
You might want to check /etc/rc.conf changes.
Done.

Confirming the above:

thinkpad# ls -ld /usr/tmp/mergebase/*
-rw-r–r– 1 root wheel 5206528 May 27 11:21 /usr/tmp/mergebase/oldx11base.20070527.112032.tar

thinkpad# cat /etc/periodic.conf
# added by mergebase.sh
local_periodic=”/usr/local/etc/periodic”
thinkpad#

thinkpad# cat /etc/manpath.config
…edited…
#
OPTIONAL_MANPATH /usr/local/man
#OPTIONAL_MANPATH /usr/X11R6/man
#
…edited…

thinkpad# cat /etc/rc.conf
…edited…
# EOF
# added by mergebase.sh
local_startup=”/usr/local/etc/rc.d”
CAVEATS

  • Make sure you have the x11/xorg meta-port installed
    thinkpad# pkg_info | grep xorg
    linux-xorg-libs-6.8.2_5 Xorg libraries, linux binaries
    xorg-7.2 X.Org complete distribution metaport
    xorg-apps-7.2 X.org apps meta-port
    xorg-cf-files-1.0.2_2 X.org cf files for use with imake builds
    xorg-docs-1.3,1 X.org documentation files
    xorg-drivers-7.2 X.org drivers meta-port
    xorg-fonts-100dpi-7.2 X.Org 100dpi bitmap fonts
    xorg-fonts-7.2 X.org fonts meta-port
    xorg-fonts-75dpi-7.2 X.Org 75dpi bitmap fonts
    xorg-fonts-cyrillic-7.2 X.Org Cyrillic bitmap fonts
    xorg-fonts-miscbitmaps-7.2 X.Org miscellaneous bitmap fonts
    xorg-fonts-truetype-7.2 X.Org TrueType fonts
    xorg-fonts-type1-7.2 X.Org Type1 fonts
    xorg-libraries-7.2 X.org libraries meta-port
    xorg-nestserver-1.2.0,1 Nesting X server from X.Org
    xorg-printserver-1.2.0,1 X Print server from X.Org
    xorg-protos-7.2 X.org protos meta-port
    xorg-server-1.2.0_2,1 X.Org X server and related programs
    xorg-vfbserver-1.2.0,1 X virtual framebuffer server from X.Org
  • Change ModulePath to /usr/local/lib/xorg/modules prior to running X in /usr/X11/xorg.conf, only if you will not generate a new xorg.conf
  • The X-Server, when started and xorg.conf is not found, will automatically recreate xorg.conf.

The upgrade procedure documented in /usr/ports/UPDATING was very helpful and straight forward. All the steps worked as noted. The only problem I had, which was minor and easy to fix was starting the X-Server with the newly generated xorg.conf. It pretty much hung my machine. It caused the CPU to run constantly well above 100% and I could not kill X unless the machine was restarted. kill -9 <pid> was helpless! I later found that the ATI driver in xorg.conf was causing the problem. Switching to the VESA driver worked and is usable, but the performance sucks. The embedded ATI video device in my T43P does not seem to be well supported in Xorg 7.2:

vendor     = ‘ATI Technologies Inc’
device     = ‘M24 1T FireGL’

I hope I am wrong and if anyone has the above ati card working correctly on a ThinkPadT43P please let me know!

Advertisements
This entry was posted in *Nix. Bookmark the permalink.

6 Responses to FreeBSD: Upgrading xorg 6.9.0 to 7.2 in 2-Days…

  1. Dave Grochowski says:

    Which driver did you use? You should use the radeon driver in X.org and try to use the radeondrm in the kernel. Also, check to make sure all of the paths in your xorg.conf are correct.

    I’ve been running X.org 7.2 for months, so the recent commit went especially smooth for myself.

  2. swinful says:

    I used the ati initially, but because it failed to properly load I reverted to the VESA driver. Checking the kernel, I saw radeondrm missing. I will later build a new kernel with that option included and see if I am able to use ati driver successfully. My xorg.conf is correct.

    Thanks for your suggestions and I’ll let you know how I make out.

  3. Damian82 says:

    Hi

    I have a problem. I don’t have mergebase.sh in my system. Where is the place, I can get it?
    pkg_add -r scripts is not fetching/working

  4. swinful says:

    Damian82, make sure your ports tree is up to date. mergebase.sh should be in the following folder: /usr/ports/Tools/scripts. If you use portsnap, get the latest snapshot and re-extract everything.

  5. Damian82 says:

    @ swinful

    Thanks!

    I think I will use mergebase.sh from another system from another computer user.

    .

  6. swinful says:

    @Dave G: After adding “radeondrm” to the kernel I am now able to use the ati driver without any problems. Thanks! It works much better than the VESA driver:)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s