ログイン
編集不可のページディスカッション情報添付ファイル
"neotaso/GentooInstallBattle 3rd"の差分

MMA
1と2のリビジョン間の差分
2014-02-06 21:49:52時点のリビジョン1
サイズ: 3811
編集者: neotaso
コメント:
2014-02-07 09:03:49時点のリビジョン2
サイズ: 5611
編集者: neotaso
コメント:
削除された箇所はこのように表示されます。 追加された箇所はこのように表示されます。
行 130: 行 130:
  * 気長に待つ   * 気長に待つ     * 寝落ちしてた
行 134: 行 135:

 * たまに止まるので以下のコマンドを駆使して強引に終わらせる
  * pythonが入らない
   * shmでエラー?
{{{
# rm -rf /tmp/portage/*
# emerge --resume
# energe --resume --skipfirst //どうにもならない時
}}}
 * configファイルを綺麗に
  * が、localeしか言われなかったのでスルー
{{{
# dispatch-conf
}}}

 * 今のうちにいろいろとemerge
  * emacsは前のworldでインストールされていた
{{{
# emerge -av lvm2 grub gentoolkit syslog-ng pciutils usbutils bind-tools sudo vim btrfs-progs genkernel bash-completion
}}}

 * fstabの設定
 * /etc/hostname,hostsの記述
  * 省略

 * ネットワークの設定他
{{{
# /etc/conf.d/net //IPアドレスの設定
# cd /etc/init.d
# ln -s net.lo net.enp2s0
# rc-update add net.enp2s0 default
# rc-update add sshd default
# passwd
}}}

 * 細々とした設定
{{{
# emacs /etc/conf.d/keymaps //jp106とcaps2ctrlを
}}}
== Round 4 ==
 * カーネル構築
 * まずはソースを
{{{
# emerge gentoo-sources
# genkernel --menuconfig all //btrfsを加える
}}}
 * GRUBの設定
{{{
# mkdir /boot/grub
# emacs /boot/grub/grub.conf

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux xxx
root (hd0,0)
kernel /boot/kernel-genkernel-hoge root=/dev/ram0 real_root=/dev/sda3
initrd /boot/initramfs-genkernel-hoge

# grep -v rootfs /proc/mounts > /etc/mtab
# grub2-install /dev/sda //よくわからんけど2が入ってた
}}}

 * chroot抜けてumountしてrebootする
{{{
(chroot) # exit
# umount hogehoge //省略
# reboot
}}}

 * GRUBが動かなかった。GRUB2なのに1と同じ設定がいけない感じ
  * /とbootだけマウント
  • neotaso/GentooInstall 2ndで敗北したためリトライ。

  • せっかくなのでLVMやらなんやらも追加したい(懲りてない)

マシン

戦闘ログ

  • 2ndでやった部分の一部を省略することがある

Round1

  • 下準備、ブート、sshdなど省略
  • パーティション
    • LVMという電波が飛んできたのでそれでやる
      • はじめてのえるぶいえむ(ドレミファだいじょーぶが流れながら)

sda1

/boot

128MB

ext3

sda5

/

512MB

btrfs

sda6

(lvm)

128GB

-

lv_usr

/usr

4GB

btrfs

lv portage

/usr/portage

2GB

btrfs

lv_var

/var

1GB

btrfs

lv_tmp

/tmp

4GB

btrfs

lv_opt

/opt

512MB

btrfs

lv_home

/home

4GB

btrfs

lv_swap

swap

4GB

swap

(LVM空き)

-

-

(空き)

-

約170GB

-

  • fdiskでパーティション。sda1をboot、sda5と6を論理(e)で構築、sda6を8eにする
  • ゴリゴリファイルシステムの設定、LVMの設定

# mkfs.ext3 /dev/sda1
# mkfs.btrfs /dev/sda5
# pvcreate /dev/sda6
# vgcreate rootvg /dev/sda6
# lvcreate -L4G -nlv_usr rootvg
 //同様のコマンドをすべてのLVMパーティションに行う

# mkfs.btrfs /dev/rootvg/lv_usr
 //(ry

# mkswap /dev/rootvg/lv_swap
# swapon /dev/rootvg/lv_swap
# mount /dev/sda5 /mnt/gentoo
# cd /mnt/gentoo
# mkdir boot usr var tmp opt home proc dev
# mount /dev/sda3 /mnt/gentoo/boot
# mount /dev/rootvg/lv_usr /mnt/gentoo/usr
# mkdir /mnt/gentoo/usr/portage
# mount /dev/rootvg/lv_portage /mnt/gentoo/usr/portage
# mount /dev/rootvg/lv_var /mnt/gentoo/var
 //(ry

# mkdir /mnt/gentoo/tmp/portage

# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev
  • stage3とportageのsnapshotをダウンロード

# links http://www.gentoo.org/main/en/mirrors.xml
  • 展開する。stage3を./に、snapshotをusrに

# tar xvjpf stage3-*.tar.bz2
# tar xvjf portage-latest.tar.bz2 -C /mnt/gentoo/usr
  • make.configのセッティング

# emacs /etc/portage/make.conf

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=core2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="bindist mmx sse sse2 bash-completion alsa cdr dcd emacs ipv6 unicode usb X"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
PORTAGE_TMPDIR="/tmp/portage"

INPUT_DEVICES="keyboard mouse"

LINGUAS="ja"

# mirrorselect -io >> /mnt/gentoo/etc/portage/make.conf
# mirrorselect -iro >> /mnt/gentoo/etc/portage/make.conf
  • localeの設定

# emacs etc/locale.gen //英語と日本語の#を外す

Round 3

  • DNS情報のコピー

# cp -L /etc/resolv.conf /mnt/gentoo/etc/
  • chroot&諸所のセッテイング

# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
# export PS1="(chroot) $PS1"
(chroot)# ln -sf /usr/share/zoneinfo/Japan /etc/localtime

以下chrootは省略

  • emergeをアップデート
    • と思ったら--syncすらできない・・・
      • /tmp/portageのownerとgroupのせいだった。portageに変更

# emerge --sync
# emerge portage
  • システム全体を1度アップデート
    • 気長に待つ
      • 寝落ちしてた

# emerge -ev world
  • たまに止まるので以下のコマンドを駆使して強引に終わらせる
    • pythonが入らない
      • shmでエラー?

# rm -rf /tmp/portage/*
# emerge --resume
# energe --resume --skipfirst //どうにもならない時
  • configファイルを綺麗に
    • が、localeしか言われなかったのでスルー

# dispatch-conf
  • 今のうちにいろいろとemerge
    • emacsは前のworldでインストールされていた

# emerge -av lvm2 grub gentoolkit syslog-ng pciutils usbutils bind-tools sudo vim btrfs-progs genkernel bash-completion
  • fstabの設定
  • /etc/hostname,hostsの記述
    • 省略
  • ネットワークの設定他

# /etc/conf.d/net //IPアドレスの設定
# cd /etc/init.d
# ln -s net.lo net.enp2s0
# rc-update add net.enp2s0 default
# rc-update add sshd default
# passwd
  • 細々とした設定

# emacs /etc/conf.d/keymaps //jp106とcaps2ctrlを

Round 4

  • カーネル構築
  • まずはソースを

# emerge gentoo-sources
# genkernel --menuconfig all //btrfsを加える
  • GRUBの設定

# mkdir /boot/grub
# emacs /boot/grub/grub.conf

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux xxx
root (hd0,0)
kernel /boot/kernel-genkernel-hoge root=/dev/ram0 real_root=/dev/sda3
initrd /boot/initramfs-genkernel-hoge

# grep -v rootfs /proc/mounts > /etc/mtab
# grub2-install /dev/sda //よくわからんけど2が入ってた
  • chroot抜けてumountしてrebootする

(chroot) # exit
# umount hogehoge //省略
# reboot
  • GRUBが動かなかった。GRUB2なのに1と同じ設定がいけない感じ
    • /とbootだけマウント

neotaso/GentooInstallBattle 3rd (最終更新日時 2014-02-14 10:46:14 更新者 neotaso)