NetBSD 自体のインストールはwww.netbsd.orgを 参考に行う。 4GB の HDD と i386 PC を用意して、NetBSD 1.4 をインストールする。 (user land まで make するには最低 2GB の HDD が必要) NetBSD 1.4 はぷらっとホームの Release & Write 18.May,1999 vol.11 の CD-ROM 5 枚組(!)を使用した。 なにも考えずにすべてお任せでインストール。 /usr/pkgsrc が必要になるので、これは CD-ROM から展開しておく。 (以下では /mnt には CD-ROM が mountされている) cd /usr tar xzvf /mnt/NetBSD-1.4/source/sets/pkgsrc.tgz 同じ CD-ROM のパッケージから CVS-1.10、AUTOCONF-2.13、BISON-1.27、 gperf-2.7、gmake-3.77、GLIBTOOL-1.2 パッケージをインストールしておく。 AUTOCONF は M4-1.4、PERL-5.00404 に依存している。 glibtool をインストールしておかないと、 「./libtool: Can't open ./libtool」というエラーがでる。 pkg_add M4-1.4 pkg_add PERL-5.00404 pkg_add CVS-1.10 pkg_add AUTOCONF-2.13 pkg_add BISON-1.27 pkg_add gperf-2.7 pkg_add gmake-3.77 pkg_add glibtool-1.2 他に、BASH-2.03、SAMBA-2.000、XEMACS-20.4 をインストールした。 xemacs は JPEG-6B.TGZ、XAW3D-1.5、PNG-1.0、GDBM-1.7、XPM-3.4K に 依存している。 SSHのダウンロードの ページからだどって、ssh-1.2.27.tar.gz もインストールしておく。 $ tar xzvf ssh-1.2.27.tar.gz $ cd ssh-1.2.27 $ ./configure --without-x --prefix=/usr/pkg $ make $ su # make install # vi /etc/rc.local + /usr/pkg/sbin/sshd && echo -n ' sshd'
% ftp ftp://ftp.jp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz # tar zxCf /usr pkgsrc.tgzpkgsrcをCD-ROMから展開した場合はsupで更新してください。私が使っているpkgsrc.supを置いときます。
# sup pkgsrc.sup環境変数を設定します、ディレクトリは先に作っておきます。
% setenv ORGSRC /usr/local/hpcmips/root/usr/src % setenv TMPSRC /usr/local/hpcmips/root/usr/tmpsrc % setenv TARGET_ROOT /usr/local/hpcmips/roothpcmipsのソースを展開します。
# foreach f (Makefile bin distrib etc games gnu \
include lib libexec regress sbin share sys usr.bin usr.sbin)
? ftp ftp://ftp.jp.netbsd.org/pub/NetBSD-jp/hpcmips/src/tar_files/${f}.tgz
? tar xzCf ${ORGSRC} ${f}.tgz
? end
anoncvsで最新のソースと同期を取ります。cvsが必要です。ない場合はインストールしておきましょう。
Anonymous CVS for NetBSD/hpcmipsを参照。最近更新されたファイルはhpcmips-chhanges-ja Archiveを見れば分かります。
% cd ${ORGSRC}
% cvs update -P -d
cross-netbsdを/usr/pkgsrc/crossにコピー
% cp -r ${ORGSRC}/pkgsrc/cross/cross-netbsd /usr/pkgsrc/cross
cross-netbsdをインストール
# mkdir ${TMPSRC}
# mount_union -b ${ORGSRC} ${TMPSRC}
# (cd /usr/pkgsrc/cross/cross-netbsd; \
make TARGET_MACHINE_ARCH=mipsel TARGET_MACHINE=hpcmips \
ALLSRC=${TMPSRC} TARGET_ROOT=${TARGET_ROOT} install clean clean-depends)
.
.
includes ===> regress/usr.bin
includes ===> regress/usr.bin/m4
Created "Makefile" in /usr/local/hpcmips/root/usr/tmpsrc/gnu/dist
configure: error: *** unknown target vector mipselnetbsd_vec
Configure in /usr/local/hpcmips/root/usr/tmpsrc/gnu/dist/bfd failed, exiting.
*** Error code 1
Stop.
エラー発生!(1999-8-26現在)
無理矢理コンパイルを通すためのパッチを当てる。
*** src/gnu/dist/bfd/config.bfd Fri Aug 27 11:00:29 1999
--- tmpsrc/gnu/dist/bfd/config.bfd Fri Aug 27 11:02:20 1999
***************
*** 389,395 ****
;;
mips*el*-*-netbsd* | mips-dec-netbsd*)
targ_defvec=bfd_elf32_littlemips_vec
! targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec mipselnetbsd_vec"
;;
mips*eb*-*-netbsd*)
targ_defvec=bfd_elf32_bigmips_vec
--- 389,395 ----
;;
mips*el*-*-netbsd* | mips-dec-netbsd*)
targ_defvec=bfd_elf32_littlemips_vec
! targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
;;
mips*eb*-*-netbsd*)
targ_defvec=bfd_elf32_bigmips_vec
やり直す。
# (cd /usr/pkgsrc/cross/cross-netbsd; \
make TARGET_MACHINE_ARCH=mipsel TARGET_MACHINE=hpcmips \
ALLSRC=${TMPSRC} TARGET_ROOT=${TARGET_ROOT} install clean clean-depends)
.
.
gmake[1]: Entering directory `/usr/local/hpcmips/root/usr/tmpsrc/gnu/dist/gcc'
cd .; autoconf
autoconf: not found
gmake[1]: *** [configure] Error 127
gmake[1]: Leaving directory `/usr/local/hpcmips/root/usr/tmpsrc/gnu/dist/gcc'
gmake: *** [all-gcc] Error 2
*** Error code 2
Stop.
だー。autoconfをインストール。autoconfを既にインストールしている人はひっかからないはず。
# (cd /usr/pkgsrc/devel/autoconf; make install)
autoconfが/usr/pkg/bin/gm4を読むようにする。
# (cd /usr/pkg/bin; ln gm4 m4)
# set path=(/sbin /usr/sbin /usr/pkg/bin /bin /usr/bin)
やり直す。
# (cd /usr/pkgsrc/cross/cross-netbsd; \
make TARGET_MACHINE_ARCH=mipsel TARGET_MACHINE=hpcmips \
ALLSRC=${TMPSRC} TARGET_ROOT=${TARGET_ROOT} install clean clean-depends)
# umount ${TMPSRC}; rm -rf ${TMPSRC}
% cd ${ORGSRC}/usr.sbin/config
% make
# make install
% make clean
netbsdをmake
% cd ${ORGSRC}/sys/arch/hpcmips/conf
% mkdir ../compile/GENERIC
% cp ./ioconf.incl.hpcmips ../compile/GENERIC
% config GENERIC
% cd ../compile/GENERIC
% /usr/pkg/mipsel-netbsd/bin/mipsel-netbsd-make depend all
% ls -l *netbsd
-rwxr-xr-x 1 iyoda iyoda 1885787 Aug 27 12:59 netbsd
-rwxr-xr-x 1 iyoda iyoda 1885791 Aug 27 12:59 nfsnetbsd
弄って元のを壊すと嫌なのでmount_unionしときます。
# mkdir /usr/local/hpcmips/root/usr/iyoda.src
# mount_union -b ${ORGSRC} /usr/local/hpcmips/root/usr/iyoda.src
# cd /usr/local/hpcmips/root/usr/iyoda.src
# /usr/pkg/cross/bin/mipsel-netbsd-make
.
.
/usr/local/hpcmips/root/usr/iyoda.src/lib/libc/arch/mips/fplib/fplib_glue.c:127: warning: no previous prototype for `__negsf2'
/usr/local/hpcmips/root/usr/iyoda.src/lib/libc/arch/mips/fplib/fplib_glue.c:131: warning: no previous prototype for `__negdf2'
*** Error code 1
Stop.
エラー発生。[pbsd-mg2] RE: successful self make buildを参考に
# vi /usr/local/hpcmips/root/usr/iyoda.src/lib/libc/arch/mips/fplib/Makefile.inc
して NOGCCERROR=1 を追加します。
# /usr/pkg/cross/bin/mipsel-netbsd-make
.
.
mipsel-netbsd-gcc -o fortune -nostdlib -L/usr/local/hpcmips/root/usr/lib /usr/local/hpcmips/root/usr/lib/crt0.o /usr/local/hpcmips/root/usr/lib/crtbegin.o fortune.o -lgcc -lc -lgcc /usr/local/hpcmips/root/usr/lib/crtend.o
nroff -Tascii -mandoc fortune.6 > fortune.cat6
all ===> games/fortune/strfile
cc -O -c strfile.c
In file included from strfile.c:61:
strfile.h:42: sys/endian.h: No such file or directory
*** Error code 1
Stop.
エラー発生。
/usr/local/hpcmips/root/usr/src/games/fortune/strfile/Makefile を見ると
---
# Override these rules for cross-compilation
.c.o:
${HOST_COMPILE.c} ${.IMPSRC}
${PROG}: ${OBJS}
${HOST_LINK.c} -o ${.TARGET} ${OBJS}
---
とかいうことになっているのでとりあえず、gamesの下は無視。i386の方をcurrentにすれば問題ないのかな。
# rm -rf /usr/local/hpcmips/root/usr/iyoda.src/games
# /usr/pkg/cross/bin/mipsel-netbsd-make
.
.
all ===> regress/sys/uvm/mmap
mipsel-netbsd-gcc -O2 -Werror -nostdinc -idirafter /usr/local/hpcmips/root/usr/include -c mmap.c
mipsel-netbsd-gcc -o mmap -nostdlib -L/usr/local/hpcmips/root/usr/lib /usr/local/hpcmips/root/usr/lib/crt0.o /usr/local/hpcmips/root/usr/lib/crtbegin.o mmap.o -lgcc -lc -lgcc /usr/local/hpcmips/root/usr/lib/crtend.o
all ===> regress/usr.bin
all ===> regress/usr.bin/m4
無事終了。
じゃあ次はinstallしてみよう。
# /usr/pkg/cross/bin/mipsel-netbsd-make install
.
.
install ===> bin
install ===> bin/cat
install -r -c -s -o root -g wheel -m 555 cat /usr/local/hpcmips/root/bin/cat
install: mipsel-netbsd-strip: No such file or directory
install: stripping /usr/local/hpcmips/root/bin/inst.22452a: No such file or directory
*** Error code 1
Stop.
エラー。
/usr/pkg/mipsel-netbsd/binにはpath通してあるはずなんだけど。良く分かんないので。
/usr/pkg/mpisel-netbsd/bin/mipsel-netbsd-makeを変更。
*** mipsel-netbsd-make.orig Sat Sep 4 17:23:54 1999
--- mipsel-netbsd-make Tue Sep 7 11:42:23 1999
***************
*** 18,27 ****
AR=${target}-ar ; export AR
NM=${target}-nm ; export NM
SIZE=${target}-size ; export SIZE
! STRIP=${target}-strip ; export STRIP
STRIPFLAGS="--strip-debug" ; export STRIPFLAGS
! STRIPPROG=${target}-strip ; export STRIPPROG
HOSTED_CC=cc ; export HOSTED_CC
--- 18,27 ----
AR=${target}-ar ; export AR
NM=${target}-nm ; export NM
SIZE=${target}-size ; export SIZE
! STRIP=${root}/bin/${target}-strip ; export STRIP
STRIPFLAGS="--strip-debug" ; export STRIPFLAGS
! STRIPPROG=${root}/bin/${target}-strip ; export STRIPPROG
HOSTED_CC=cc ; export HOSTED_CC
# /usr/pkg/cross/bin/mipsel-netbsd-make install
.
.
install -r -c -o root -g wheel -m 444 as.cat1 /usr/local/hpcmips/root/usr/share/man/cat1/as.0
make whatis.db
(cd /usr/local/hpcmips/root/usr/iyoda.src/share/man && make makedb)
sh /usr/local/hpcmips/root/usr/iyoda.src/share/man/../../libexec/makewhatis/makewhatis.sh /usr/local/hpcmips/root/usr/share/man
install -r -c -o root -g wheel -m 444 /tmp/whatis25888 /usr/local/hpcmips/root/usr/share/man/whatis.db
無事終了。
次はsnapshotね。
# setenv RELEASEDIR /usr/local/hpcmips/root2
# /usr/pkg/cross/bin/mipsel-netbsd-make snapshot
.
.
pax: Unable to access ./usr/share/doc/usd/31.trek/Makefile
pax: Unable to access ./usr/share/doc/usd/31.trek/trek.me
making text.tgz
sh ../distrib/sets/makesums -t /usr/local/hpcmips/root2/binary/sets
なんとか終了したようだ。games.tgzができてないけど。
NetBSD memoに戻る
iyoda-www@atikoro.org