たわごと


by wakemasa

環境整備

ちょっとサーバ上でやりたいことができたので、まずは環境整備から。

1. FreeBSDのupdate

/etc /stable-supfileを準備する。stable-supfileの中身を編集

# vi /etc/stable-supfile

で編集。 default release=cvs tag=RELENG_8_2 となっていることを確認。
ソースコードのupdate。

# cvsup -g -L 2 /etc/stable-supfile

cvsupが終了したら、コンパイル。

# cd /usr/src
# make buildworld

そのまましばらく放置。

設定ファイルの名前をGENERICから変えておく。MYKERNELは自分の好きな名前にしておく。すでに存在するので、それをそのまま利用。

# cd /usr/src/sys/i386/conf
# cp GENERIC MYKERNEL

/etc/make.confの中にKERNCONF=MYKERNELを追加しておく。

/usr/src/でbuildkernelして、 installkernelしたらreboot。

# cd /usr/src
# make buildkernel
# make installkernel
# reboot

まずはシングルユーザモードで起動。念のため、ファイルシステムをチェック。

# fsck -p

/を read/write 可能にして再マウント

# mount -u /

/etc /fstabで指定されているすべてのファイルシステムをマウント

# mount -a -t ufs

ちゃんとファイルシステムがmountされました。一応、ぱらぱらと中身が表示されることを確認。
最後にswapを有効にする

# swapon -a

コンパイル済のシステムをインストール。

# cd /usr/src
# make installworld

念のために以下のファイルの中身でソースコードの版数をチェック

/usr/src/sys/conf/newvers.sh

ちゃんと8.2-RELEASE-p6になってました。

じゃ、reboot

ちゃんと8.2-RELEASE-p6で起動できました。


2. ports の upgrade

念のために古いportsをバックアップしておく。

# mkdir /export/ports-backup
# cd /usr/ports
# tar cf - . | (cd /export/ports-backup; tar xvfp -)

次にportsのupdate。snapshotのダウンロード、snapshotの再構築、portsのupdateの順

# portsnap fetch
# portsnap extract
# portsnap update

何事もなく終了。

portupgradeのインストール。

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

エラーが出た、、、

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean
===> Installing for portupgrade-2.4.9.3,2
===> portupgrade-2.4.9.3,2 depends on file: /usr/local/bin/ruby18 - found
===> portupgrade-2.4.9.3,2 depends on file: /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd8/bdb.so - not found
===> Verifying install for /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd8/bdb.so in /usr/ports/databases/ruby-bdb
===> Installing for ruby18-bdb-0.6.6
===> ruby18-bdb-0.6.6 depends on file: /usr/local/bin/ruby18 - found
===> ruby18-bdb-0.6.6 depends on shared library: db41.1 - found
===> Generating temporary packing list
===> Checking if databases/ruby-bdb already installed
===> ruby18-bdb-0.6.6 is already installed
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of databases/ruby-bdb
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/databases/ruby-bdb.
*** Error code 1

Stop in /usr/ports/ports-mgmt/portupgrade.
*** Error code 1

Stop in /usr/ports/ports-mgmt/portupgrade.

おいおい、、、orz

エラーが出たruby-bdbを再インストールする。

# cd /usr/ports/databases/ruby-bdb/
# make deinstall
# make reinstall

エラーは解消したはずなので、portupgradeのインストール続行。

# cd /usr/ports/ports-mgmt/portupgrade
# make install

今回は成功。
INDEXファイルを更新したいので、portsdbを実行。

# portsdb -Uu
Updating the ports index ... Generating INDEX.tmp - please wait.."/usr/ports/cad/astk-client/../astk-serveur/Makefile", line 287: Could not find /usr/ports/cad/astk-client/../../french/aster/bsd.aster.mk
make: fatal errors encountered -- cannot continue
===> cad/astk-client failed
*** Error code 1
1 error

********************************************************************
Before reporting this error, verify that you are running a supported
version of FreeBSD (see http://www.FreeBSD.org/ports/) and that you
have a complete and up-to-date ports collection. (INDEX builds are
not supported with partial or out-of-date ports collections -- in
particular, if you are using cvsup, you must cvsup the "ports-all"
collection, and have no "refuse" files.) If that is the case, then
report the failure to ports@FreeBSD.org together with relevant
details of your ports configuration (including FreeBSD version,
your architecture, your environment, and your /etc/make.conf
settings, especially compiler flags and WITH/WITHOUT settings).

Note: the latest pre-generated version of INDEX may be fetched
automatically with "make fetchindex".
********************************************************************

*** Error code 1

Stop in /usr/ports.
*** Error code 1

Stop in /usr/ports.
failed to generate INDEX!
portsdb: index generation error

うーん、、、またエラー。
「FreeBSD portdb error」で調べてみたら、それらしい情報にヒット。
エラーが出たコンポーネントをportupgradeするとうまくいくらしい。。。

# portupgrade -r aster

なにやらメッセージが出た。
retryしてみる。

# portsdb -Uu

うーむ、、、やっぱり同じエラーで止まる。。。。

さらに調べてみると ports/161213 で track されているらしいが、修正済のようにも読める。。。

さて、、、どうしたもんか、、、

人気ブログランキングへ
by wakemasa | 2012-02-01 05:23 | サーバ