ルートファイルシステムの構築 Edit

FC2のルートファイルシステムを作成した時のメモです。

  • RPMパッケージ
    SH-Linuxのホームページから次のパッケージをかき集めてきました。
    SysVinit-2.85-25.sh4.rpm
    basesystem-8.0-3.noarch.rpm
    bash-2.05b-38.sh4.rpm
    beecrypt-3.1.0-3.sh4.rpm
    bind-libs-9.2.3-13.sh4.rpm
    bind-utils-9.2.3-13.sh4.rpm
    bzip2-1.0.2-12.1.sh4.rpm
    bzip2-libs-1.0.2-12.1.sh4.rpm
    chkconfig-1.3.9-1.1.sh4.rpm
    coreutils-5.2.1-7.sh4.rpm
    cpio-2.5-6.sh4.rpm
    cracklib-2.7-27.1.sh4.rpm
    cracklib-dicts-2.7-27.1.sh4.rpm
    cyrus-sasl-2.1.18-2.sh4.rpm
    cyrus-sasl-md5-2.1.18-2.sh4.rpm
    db4-4.2.52-3.1.sh4.rpm
    dev-3.3.13-1.sh4.rpm
    diffutils-2.8.1-11.sh4.rpm
    e2fsprogs-1.35-7.1.sh4.rpm
    elfutils-0.95-2.sh4.rpm
    elfutils-libelf-0.95-2.sh4.rpm
    ethtool-1.8-3.1.sh4.rpm
    fedora-release-2-4.sh4.rpm
    filesystem-2.2.4-1.sh4.rpm
    findutils-4.1.7-25.sh4.rpm
    gawk-3.1.3-7.sh4.rpm
    gdbm-1.8.0-22.1.sh4.rpm
    glib-1.2.10-12.1.1.sh4.rpm
    glib2-2.4.0-1.sh4.rpm
    glibc-2.3.3-27.12.sh4.rpm
    glibc-common-2.3.3-27.12.sh4.rpm
    gmp-4.1.2-5.sh4.rpm
    grep-2.5.1-26.sh4.rpm
    groff-1.18.1.1-2.sh4.rpm
    gzip-1.3.3-12.sh4.rpm
    info-4.7-4.sh4.rpm
    initscripts-7.55.1-1.sh4.rpm
    iproute-2.4.7-14.sh4.rpm
    iputils-20020927-13.sh4.rpm
    kernel-2.6.8-1.noarch.rpm
    krb5-libs-1.3.4-6.sh4.rpm
    less-382-3.sh4.rpm
    libacl-2.2.7-5.sh4.rpm
    libattr-2.4.1-4.sh4.rpm
    libgcc-3.4.3-1.sh4.rpm
    libselinux-1.11.4-1.sh4.rpm
    libstdc++-3.4.3-1.sh4.rpm
    libtermcap-2.0.8-38.sh4.rpm
    libuser-0.51.7-7.1.1.sh4.rpm
    libxml2-2.6.8-1.sh4.rpm
    libxml2-python-2.6.8-1.sh4.rpm
    man-1.5m2-6.sh4.rpm
    mingetty-1.07-2.sh4.rpm
    mktemp-1.5-18.sh4.rpm
    modutils-2.4.27-1.sh4.rpm
    ncurses-5.4-5.sh4.rpm
    net-tools-1.60-25.sh4.rpm
    openldap-2.1.29-1.sh4.rpm
    openssh-3.6.1p2-34.sh4.rpm
    openssh-clients-3.6.1p2-34.sh4.rpm
    openssh-server-3.6.1p2-34.sh4.rpm
    openssl-0.9.7a-35.sh4.rpm
    openssl-0.9.7a-35.sh4.rpm.1
    openssl096b-0.9.6b-16.sh4.rpm
    pam-0.77-40.sh4.rpm
    passwd-0.68-8.1.sh4.rpm
    pcre-4.5-2.sh4.rpm
    popt-1.9.1-11.sh4.rpm
    portmap-4.0-59.sh4.rpm
    procps-3.2.0-1.1.sh4.rpm
    psmisc-21.4-2.sh4.rpm
    python-2.3.3-6.sh4.rpm
    readline-4.3-10.1.sh4.rpm
    rpm-4.3.2-11.sh4.rpm
    rpm-libs-4.3.2-11.sh4.rpm
    rpm-python-4.3.2-11.sh4.rpm
    sed-4.0.8-4.sh4.rpm
    setup-2.5.33-1.noarch.rpm
    shadow-utils-4.0.3-21.sh4.rpm
    sysklogd-1.4.1-16.sh4.rpm
    tar-1.13.25-14.sh4.rpm
    tcp_wrappers-7.6-36.sh4.rpm
    telnet-server-0.17-28.sh4.rpm
    termcap-11.0.1-18.1.noarch.rpm
    tzdata-2004b-1.fc2.noarch.rpm
    util-linux-2.12-18.sh4.rpm
    vim-minimal-6.2.457-1.sh4.rpm
    which-2.16-2.sh4.rpm
    words-2-18.noarch.rpm
    xinetd-2.3.13-2.sh4.rpm
    yum-2.0.7-1.1.noarch.rpm
    zlib-1.2.1.1-2.1.sh4.rpm
    
  • ディレクトリの作成とrpm データベースの初期化
    /FC2下にルートファイルシステムを構築します。
    bash-2.05b# mkdir -p /FC2/var/lib/rpm
    bash-2.05b# rpm --root /FC2 --initdb
    
  • ルートファイルシステムの作成
    集めてきたパッケージを置いた場所へcdして、一気にインストールを行います。
    bash-2.05b# rpm --root /FC2 -ivh *.rpm
    Preparing...                ########################################### [100%]
       1:libgcc                 ########################################### [  1%]
       2:setup                  ########################################### [  2%]
       3:filesystem             ########################################### [  3%]
       4:basesystem             ########################################### [  4%]
       5:tzdata                 ########################################### [  5%]
       6:glibc-common           ########################################### [  7%]
       7:glibc                  ########################################### [  8%]
       8:zlib                   ########################################### [  9%]
       9:mktemp                 ########################################### [ 10%]
      10:chkconfig              ########################################### [ 11%]
      11:e2fsprogs              ########################################### [ 12%]
      12:popt                   ########################################### [ 13%]
      13:bzip2-libs             ########################################### [ 14%]
      14:elfutils-libelf        ########################################### [ 15%]
      15:glib2                  ########################################### [ 16%]
      16:beecrypt               ########################################### [ 18%]
      17:gdbm                   ########################################### [ 19%]
      18:libstdc++              ########################################### [ 20%]
      19:db4                    ########################################### [ 21%]
      20:tcp_wrappers           ########################################### [ 22%]
      21:elfutils               ########################################### [ 23%]
      22:bind-libs              ########################################### [ 24%]
      23:ethtool                ########################################### [ 25%]
      24:glib                   ########################################### [ 26%]
      25:gmp                    ########################################### [ 27%]
      26:iputils                ########################################### [ 29%]
      27:libattr                ########################################### [ 30%]
      28:libacl                 ########################################### [ 31%]
      29:mingetty               ########################################### [ 32%]
      30:pcre                   ########################################### [ 33%]
      31:termcap                ########################################### [ 34%]
      32:libtermcap             ########################################### [ 35%]
      33:bash                   ########################################### [ 36%]
      34:libselinux             ########################################### [ 37%]
      35:ncurses                ########################################### [ 38%]
      36:info                   ########################################### [ 40%]
      37:grep                   ########################################### [ 41%]
      38:shadow-utils           ########################################### [ 42%]
      39:sed                    ########################################### [ 43%]
      40:findutils              ########################################### [ 44%]
      41:less                   ########################################### [ 45%]
      42:rpm-libs               ########################################### [ 46%]
      43:cracklib               ########################################### [ 47%]
      44:gawk                   ########################################### [ 48%]
      45:groff                  ########################################### [ 49%]
      46:readline               ########################################### [ 51%]
      47:psmisc                 ########################################### [ 52%]
      48:fedora-release         ########################################### [ 53%]
      49:iproute                ########################################### [ 54%]
      50:libxml2                ########################################### [ 55%]
      51:net-tools              ########################################### [ 56%]
      52:words                  ########################################### [ 57%]
      53:cracklib-dicts         ########################################### [ 58%]
      54:gzip                   ########################################### [ 59%]
      55:cpio                   ########################################### [ 60%]
      56:diffutils              ########################################### [ 62%]
      57:tar                    ########################################### [ 63%]
      58:vim-minimal            ########################################### [ 64%]
      59:bzip2                  ########################################### [ 65%]
      60:openssl096b            ########################################### [ 66%]
      61:kernel                 ########################################### [ 67%]
      62:coreutils              ########################################### [ 68%]
      63:pam                    ########################################### [ 69%]
      64:krb5-libs              ########################################### [ 70%]
      65:openssl                ########################################### [ 71%]
      66:python                 ########################################### [ 73%]
      67:util-linux             ########################################### [ 74%]
      68:dev                    ########################################### [ 75%]
      69:which                  ########################################### [ 76%]
      70:libxml2-python         ########################################### [ 77%]
      71:SysVinit               ########################################### [ 78%]
      72:modutils               ########################################### [ 79%]
      73:procps                 ########################################### [ 80%]
      74:initscripts            ########################################### [ 81%]
      75:openssh                ########################################### [ 82%]
      76:xinetd                 ########################################### [ 84%]
      77:rpm                    ########################################### [ 85%]
      78:rpm-python             ########################################### [ 86%]
      79:yum                    ########################################### [ 87%]
      80:telnet-server          ########################################### [ 88%]
      81:openssh-clients        ########################################### [ 89%]
      82:openssh-server         ########################################### [ 90%]
      83:portmap                ########################################### [ 91%]
      84:bind-utils             ########################################### [ 92%]
      85:man                    ########################################### [ 93%]
      86:sysklogd               ########################################### [ 95%]
      87:cyrus-sasl             ########################################### [ 96%]
      88:cyrus-sasl-md5         ########################################### [ 97%]
      89:openldap               ########################################### [ 98%]
      90:libuser                ########################################### [ 99%]
      91:passwd                 ########################################### [100%]
    bash-2.05b#
    

設定 Edit

  • ファイルシステム
    • /etc/fstab
      /dev/hda3               /                       ext2    defaults        1 1
      proc                    /proc                   proc    defaults        0 0
      devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
      /dev/hda2               swap                    swap    default         0 0
      
  • タイムゾーンの設定
    • /etc/localtime
      /etc/localtimeを次のように設定
      ln -s /usr/share/zoneinfo/Japan localtime
      
  • 言語設定
    • /etc/sysconfig/i18n
      LANG="ja_JP.eucJP"
      SUPPORTED="ja_JP.eucJP:ja_JP:ja"
      SYSFONT="latarcyrheb-sun16"
      
  • /ネットワーク設定
    • /etc/hosts
      127.0.0.1     localhost
      192.168.1.81  landisk
      
    • /etc/resolv.conf
      nameserver 192.168.1.1
      
  • /etc/sysconfig/network
    ETWORKING=yes
    HOSTNAME=landisk;
    GATEWAY=192.168.1.1
    
  • /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    BOOTPROTO=static
    ONBOOT=yes
    IPADDR=192.168.1.81
    NETMASK=255.255.255.0
    
  • telnetの設定
    • /etc/xinetd.d/telnet
      # default: on
      # description: The telnet server serves telnet sessions; it uses \
      #       unencrypted username/password pairs for authentication.
      service telnet
      {
              flags           = REUSE
              socket_type     = stream
              wait            = no
              user            = root
              server          = /usr/sbin/in.telnetd
              log_on_failure  += USERID
              disable         = no
      }
      
  • /etc/hosts.allow
    #
    # hosts.allow   This file describes the names of the hosts which are
    #               allowed to use the local INET services, as decided
    #               by the '/usr/sbin/tcpd' server.
    #
    in.telnetd : 127.0.0.1 192.168.1.  192.168.0.
    
  • /etc/hosts.deny
    #
    # hosts.deny    This file describes the names of the hosts which are
    #               *not* allowed to use the local INET services, as decided
    #               by the '/usr/sbin/tcpd' server.
    #
    # The portmap line is redundant, but it is left to remind you that
    # the new secure portmap uses hosts.deny and hosts.allow.  In particular
    # you should know that NFS uses portmap!
    in.telnetd : ALL
    
  • yumの設定(apt-getみたいなパッケージ管理ツール)
    • /etc/yum.conf (SH-Linuxのホームページへアクセスするように設定します。)
      [main]
      cachedir=/var/cache/yum
      debuglevel=2
      logfile=/var/log/yum.log
      pkgpolicy=newest
      distroverpkg=redhat-release
      tolerant=1
      exactarch=1
      retries=20
      
      [base]
      name=Fedora Core $releasever - $basearch - Base
      baseurl=http://rpm.sh-linux.org/rpm-2004/target/
      
      # 以下は全てコメントにする
      
  • その他(シリアルコンソールを使う場合)
    • /etc/inittab (シリアルコンソールを使う場合)
      # Run gettys in standard runlevels
      1:2345:respawn:/sbin/agetty 9600 /dev/ttySC1 -L
      #1:2345:respawn:/sbin/mingetty tty1
      #2:2345:respawn:/sbin/mingetty tty2
      #3:2345:respawn:/sbin/mingetty tty3
      #4:2345:respawn:/sbin/mingetty tty4
      #5:2345:respawn:/sbin/mingetty tty5
      #6:2345:respawn:/sbin/mingetty tty6
      
  • /etc/securetty
    ttySC1 を追加
    

参考文献 Edit

Counter: 2109, today: 1, yesterday: 0

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2006-06-13 (火) 20:02:27 (6534d)