NetBSD-2.1設定メモ

インストール

i386cd.isoからインストール。

インストーラーでやってることは、キーボード設定、ファイルシステム作成、ネット設定、展開、タイムゾーン設定、ネット&キーボード設定の反映、rootアカウント設定(パスワードとシェル選択)くらい。もし間違えたらCTRL+Cで中断してコマンドsysinstを起動すれば、インストーラーを最初から実行できる。

注意点は、パーティション作成後のファイルシステム設定でタイプをFFSv2にかえ、オプションでsoftdepを選ぶこと。

distribution setではX11はすべて外して、後すべて入れておく。

サウンドes1371のモジュールはeapで、GENERICカーネルにはすでに組み込み済みである。

インストール直後

真っ先にBIOS時間をlocaltimeにする。

# gdb --write /netbsd
(gdb) set rtc_offset=-540
(gdb) quit
# reboot

値が-540なのはJST=-9x60なので。
カーネル設定では/usr/src/sys/arch/i386/conf/GENERICでoptions RTC_OFFSET=0と設定されている。
※変数は/usr/src/sys/kern/init_sysctl.cで設定されてるようだ。

sshd起動

# /etc/rc.d/sshd start

起動時に起動させるには、/etc/rc.confに以下を追加

sshd=YES

ユーザー作成

# useradd -m username
# passwd username

pkgsrc

FreeBSDportsにあたるのがpkgsrc。
デフォルトでインストールされないので、ftpコマンドなどでpkgsrc.tgzをとってきて/usr/pkgsrcに展開する

# ftp ftp://ftp.jp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz
# tar zxvf pkgsrc.tar.gz -C /usr

cvsでアップデート(必ずする)

# cd /usr/pkgsrc
# cvs update -Pd
インストール

必ず入れるもの

  • pkgtools/pkg_install
  • pkgtools/pkglint
  • security/audit-packages
# cd pkgtools/pkg_install
# make install
# make clean CLEANDEPENDS=1

パッケージは基本的に/usr/pkg以下に入る。

セキュリティチェック
# download-vulnerability-list
# audit-packages

脆弱性のあるパッケージがリストアップされる。

アップデートチェック
# lintpkgsrc -i

インストール済みバージョンとpkgsrc上のバージョンが違うパッケージがリストアップされる。

アップデート

lintpkgsrcで出たパッケージ個別にアップグレードする。

# make update

※依存関係での元になりそうなパッケージからアップデートするほうがよい。たとえば、glib2とgtk2+がある場合、先にgtk2+でmake updateして、あとからglib2をmake updateすると、再びgtk2+やそれに依存するプログラムのアップデートビルドが走る可能性が高くなる。


新規packageのインストールもmake updateでよし。

パッケージ追加

  • shells/bash
  • misc/lv
  • editors/emacs
  • editors/mule-ucs
  • security/sudo

X.Org X11

/etc/mk.confに以下を記入

X11_TYPE=xorg

/usr/pkgsrc/mk/defaults/mk.conf に雛形がある。特に無くても良いが、MASTER_SITE_*は追加したほうがいいかも。


その後で以下をインストール

/usr/pkg/xorg以下に入る。startxは/usr/pkg/xorg/bin

日本語環境

  • fonts/ja-sazanami-ttf/

/usr/pkg/lib/X11/fonts/TTF/に入る

gnome

ビルドに約二日かかりました

X設定

設定ファイル: /usr/pkg/xorg/etc/X11/xorg.conf

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        RgbPath      "/usr/pkg/xorg/lib/X11/rgb"
        ModulePath   "/usr/pkg/xorg/lib/modules"
        FontPath     "/usr/pkg/xorg/lib/X11/fonts/misc/"
        FontPath     "/usr/pkg/xorg/lib/X11/fonts/TTF/"
        FontPath     "/usr/pkg/xorg/lib/X11/fonts/Type1/"
        FontPath     "/usr/pkg/xorg/lib/X11/fonts/CID/"
        FontPath     "/usr/pkg/xorg/lib/X11/fonts/75dpi/"
        FontPath     "/usr/pkg/xorg/lib/X11/fonts/100dpi/"
        FontPath     "/usr/pkg/lib/X11/fonts/TTF/"
EndSection

Section "Module"
        Load  "extmod"
        Load  "glx"
        Load  "dbe"
        Load  "record"
        Load  "xtrap"
        Load  "freetype"
        Load  "type1"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option "XkbModel" "jp106"
        Option "XkbLayout" "jp"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "wsmouse"
        Option      "Device" "/dev/wsmouse"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "DefaultRefresh"            # [<bool>]
        Identifier  "Card0"
        #Driver      "vesa"
        Driver      "vmware"
        VendorName  "VMWare Inc"
        BoardName   "[VMWare SVGA II] PCI Display Adapter"
        BusID       "PCI:0:15:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth 24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes "800x600" "640x480"
        EndSubSection
EndSection

ユーザーからのstartx起動時に/tmp/.ICE-unixが作れないといわれる。

mkdir /tmp/.ICE-unix
chmod 1777 /tmp/.ICE-unix

自動で行うには/etc/rc.localあたりに書き加えておく。

esd設定?

ユーザー権限ではDevice busyになる。
面倒なのでsetuid root

chmod +s /usr/pkg/bin/esd

gnomeの設定

~/.bash_profile

export LANG=ja_JP.eucJP
export PATH=$PATH:/usr/pkg/xorg/bin

~/.xinitrc

GTK_IM_MODULE=uim-anthy
export GTK_IM_MODULE
uim-xim &
XMODIFIERS=@im=uim
export XMODIFIERS
exec gnome-session

startxでgnome起動後、サウンドuim-toolbar-gtk起動など設定。