努力したWiki

推敲の足りないメモ書き多数

ユーザ用ツール

サイト用ツール


documents:freebsd:freebsd-006

X.Org 6.9 から X.Org 7.2 へのアップグレード

2007年12月13日 11時04分31秒

これはなに?

FreeBSDで qemu のportsを導入しようとしたら…

「/usr/X11R6 なんて、古いバージョン使ってんじゃねーよ、コンパイルできねーよ!」

と怒られてしまいました。とうとう先延ばしにしていた X.Org の更新をやらにゃなりません。 これは、その更新手順のメモ書きです。

アップグレード

すでに手順はそのPCの中にあったりします。

説明は何処にあるのか

/usr/ports/UPDATING に更新手順がしっかり載っているので、それに従えば基本的に難しくない。英語だけどそんな難解ではないし、自信が無ければ翻訳サイトで文章を確かめていけばいい。

 20070519:
   AFFECTS: users of Xorg
   AUTHOR: kris@FreeBSD.org
 
   Welcome, fearless user!  You are about to embark upon a mystical
   journey to the world of xorg 7.2.
 
   This upgrade procedure is for users of portupgrade.  Users of other
   upgrade tools should contact the author for the corresponding upgrade
   method for that tool.
 
   It is recommended that you run the xorg 7.2 upgrade inside a script(1)
   session.  This way, if something goes wrong, you will have hopefully
   saved enough information for the developers to debug the problem.
   Make sure you choose a filesystem with lots of space for the script
   output.
 --省略--

Excite翻訳にかけてみても読める程度に翻訳できるんですから、単純ですよ。ほら。

 20070519:
 影響します: Xorgのユーザ
 作者: kris@FreeBSD.org 
 
 歓迎されて、大胆不敵のユーザ! あなたはxorg7.2の世界への神秘主義的な
 旅行に乗り出そうとしています。
 
 このアップグレード手順はportupgradeのユーザのためのものです。 他のアッ
 プグレードツールのユーザはそのツールのための対応するアップグレード方法の
 ために作者に連絡するべきです。
 
 あなたがスクリプト(1)セッションのときにxorg7.2アップグレードを走らせるの
 は、お勧めです。 このように、何かが支障をきたすなら、あなたは希望をいだ
 いて開発者が問題をデバッグすることができるくらいの情報を保存してしまうで
 しょう。
 スクリプト出力のための多くのスペースがあるファイルシステムを必ず選んでく
 ださい。
 --省略--

確かに基幹部分を更新するのだから大胆不敵かも(笑) portupgradeが公式なアップグレードツールと思ってもよさそうです。

更新手順

  1. scriptコマンドでログを残す
  2. portupgrade-develへの変更もしくは導入
  3. ports tree の更新
  4. 環境変数 BATCH 、XORG_UPGRADE の設定
  5. portupgrade -Rf libXft
  6. portupgrade -a
  7. mergebase.sh
  8. xorg-drivers 導入
  9. xorg-fonts 導入

ログを残す

冒頭で言っていた、「スクリプト(1)セッション」ってのはつまり、scriptコマンドでログをとっているモードのこと。

 # script xorg-upgrade

xorg-upgrade という名前で操作過程をファイルに残します。 もし問題があって助けが欲しいときはこのファイルを見せることで、どういった操作を行ってどういった問題が発生したのかが口で喋るよりも明確に判ります。

もっとも、再インストールじゃなくてアップグレードを選んでる様な人は誰かに助けを求めるような事はまずしないでしょうから、無くてもいいんじゃないでしょうか。

portupgrade から portupgrade-devel への変更

なんか、何気に「portupgrade-develの方が良いよ」と言ってる様なんでportupgrade から portupgrade-devel へ変更します。そのオペレーションまで書かれていますしね、ここは言う通りにしておきます。

# portupgrade -f -o ports-mgmt/portupgrade-devel portupgrade
# rm -f /usr/ports/INDEX*.db /var/db/pkg/pkgdb.db
# pkgdb -fu

X.Org7.2のportsを含むツリーに更新する

現在のportsツリーが古いものであれば、X.Org7.2のportsを含んだツリーに更新しておく必要があります。 私は特に弄らないので問題ないけど、pkgtools.confにオプションやら何やらを入れまくっていた人や、portsツリーの構成を変えている人は注意が必要そうです。

で、変ないじくり方をしているとツリーと INDEXファイルが同期の取れていない状態となるため、これを修正する必要があります。

# cd /usr/ports && make index 

これが一番楽かも。時間はかなりかかりますが。 時間がかかるのが嫌なら、/usr/ports 全体をtarballで持ってきて展開し、その後で

# cd /usr/ports && make fetchindex

あたりですか。いまだと、ネットワーク越しに取ってくる方が速い事もあるでしょうしね。

環境変数の設定

portupgradeコマンドで導入する際に、ダイアログが表示され入力になる場合があります。確認ダイアログで止められるのも嫌なので環境変数 BATCH に “yes”を設定しておきます。

# setenv BATCH yes

アップグレードオペレーションの間、環境変数 XORG_UPGRADE を定義します。値は “yes” ですね。

# setenv XORG_UPGRADE yes

XORG_UPGRADE が定義されていないと、 X.Org6.9が対象となり、定義があれば X.Org7.2が対象となります。 XFree86 から X.Org への移行の際にあった、X.Orgが導入されず再度XFree86が導入されちゃう問題と同様な問題が起こる訳です。当時は make.conf だったけど、今回は XORG_UPGRADE という事。

libXft アップグレード

最初に libXft をアップグレードします。

# portupgrade -Rf libXft

依存関係のあるportsも更新されます。 コチラの環境では 55個のport が更新されました。

 -- 上略 --
 ===>  Cleaning for xf86miscproto-0.9.2
 ===>  Cleaning for xf86vidmodeproto-2.2.2
 ===>  Cleaning for dmxproto-2.2.2
 ===>  Cleaning for xorg-libraries-7.3_1
 --->  Cleaning out obsolete shared libraries
 [Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 371 packages found (-0 +55) ....................................................... done]
 

portupgrade -a だ!

さて次は全 ports アップグレードを行います。 ま、中にはバージョンの変わらないものもあるはずですし、場所の移動が無いものだってあるので、全て置き換えになるとは限りませんが、それなりの時間を覚悟します。

…で、その前に。 あまりまじめな管理をしていないと、依存関係のデータベースに矛盾が生じたりします。そのときには

# pkgdb -F

を使ってちゃんと手当てしましょう。 私のところでは結構出ちゃいまして… ついでなので、明らかにいらないと判明しているものは消しちゃいましょう。

ちゃんと矛盾を解決したら

# portupgrade -a

を実行してさらに待ちましょう。 うちの結果はこんな感じ。3日間は長かった…

 -- 上略 --
 install  -o root -g wheel -m 444 /usr/ports/x11-wm/fluxconf/work/fluxconf-0.9.9/docs/index.html /usr/local/share/doc/fluxconf
 ===>   Registering installation for fluxconf-0.9.9_2
 ===>  Cleaning for fluxconf-0.9.9_2
 --->  Cleaning out obsolete shared libraries
 [Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 519 packages found (-0 +1) . done]
 ** Listing the failed packages (*:skipped / !:failed)
         ! math/blas (blas-1.0_1)        (checksum mismatch)
         * math/lapack (lapack-3.0_2)
         * databases/grass-i18n (grass-i18n+ipafont-5.0.3)
 --->  Packages processed: 188 done, 178 ignored, 2 skipped and 1 failed
 # 

blas は持ってきたファイルが壊れてたようなので、distfilesから消して取り直すとコンパイルできました。 lapack は blas に依存してた奴なのですんなりコンパイルが通ります。 grass-i18n は本家で機能取り込んだとかで、grass でいけるようになりました。なので grass-i18n は消しました。

# portupgrade -a
# portupgrade -a -x 'gstreamer*'
# portupgrade -Rr 'gstreamer*'
# pkg_delete xorg-manpages\*

このへんも適宜行って、問題ないように整えます。

sh /usr/ports/Tools/scripts/mergebase.sh

/usr/X11R6 が /usr/local にマージされるので、mergebase.sh で統合をかけます。うまくいけば /usr/X11R6 は /usr/local へのシンボリックリンクになります。 うちではこんな結果。

 # sh /usr/ports/Tools/scripts/mergebase.sh
 This script will attempt to backup /usr/X11R6 into
 /usr/tmp/mergebase/oldx11base.20071213.031413.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/xpdfrc
 ./lib/X11/fonts/TrueType/fonts.alias
 ./lib/X11/fonts/TrueType/fonts.dir
 ./lib/X11/fonts/local/fonts.dir
 ./lib/X11/fs/config
 ./lib/X11/xdm/Xaccess
 ./man/whatis
 
 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.ncdLtli4.
 #

コンフリクトというから、/usr/X11R6/ 以下の該当ファイルを消して

 # rm /usr/X11R6//lib/X11/fonts/TrueType/fonts.alias
 # rm /usr/X11R6//lib/X11/fonts/TrueType/fonts.dir
 # rm /usr/X11R6//lib/X11/fonts/local/fonts.dir
 # rm /usr/X11R6//lib/X11/fs/config
 # rm /usr/X11R6//lib/X11/xdm/Xaccess
 # rm /usr/X11R6//man/whatis
 # rm /usr/X11R6//etc/xpdfrc

再度実施。

 # sh /usr/ports/Tools/scripts/mergebase.sh
 This script will attempt to backup /usr/X11R6 into
 /usr/tmp/mergebase/oldx11base.20071213.032201.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 sbin
 a www
 a share/doc
 -- 中略 --
 a man/ja/man7
 a man/ja/man8
 a man/ja/man9
 a man/ja/manl
 a man/ja/mann
 ==> 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.
 # 

とりあえず終了。

X立ち上がらず

更新終了後、マシン再起動でX立ち上がらず。 /var/log/Xorg.0.log を見ると、モジュールのロードができないでいるようだ。 /etc/X11/xorg.conf の中の /usr/X11R6/~ のパスを /usr/local に直してみたものの効果なし。さて。

xf86-drivers 導入

よくよく調べると、/usr/local/lib/xorg/modules/drivers ディレクトリが無い。あちゃー、それじゃあ立ち上がらないよねぇ。 /usr/ports/x11-drivers/xorg-drivers を導入しました。

このとき、うちでは、ビデオドライバ VIA と i810 を導入対象にしているとコンパイルできなかったのではずしています。

xf86-video-xxx シリーズが順次コンパイル・インストールされていくので完了まで待ちましょう。

xorg-fonts 導入

次はデフォルトフォントが無いと言って来ました。

/usr/ports/x11-fonts/xorg-fonts を導入しました。

完了

ちゃんとグラボ対応ドライバでXが立ち上がるのを確認できました。 あまりにエラーが出るときは、

# Xorg -configure

で xorg.conf を作り直すのも手です。

その他

できれば、これもやっておきましょう

# cd /usr/ports/x11/xorg
# make install

X.Org7.2にアップグレードした際に入らなかったものがあるかもしれません。これで抜けが無いか確認しましょう。 実際、こちらでは抜けがありましたし(^^;;;

documents/freebsd/freebsd-006.txt · 最終更新: 2023/04/14 02:32 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki