Home
News
Forum
Wiki
Blog
Contents
Gallery
Movies
Downloads
About NSL
[
List of Titles
|
List of Pages
|
New
|
Search
|
Recent changes
|
Help
]
gentoo
[
Front page
]
[ ]
Start:
* gentoo
- [[memo>./memo]]
#br
*gentoo 構築
http://www.gentoo.org/doc/ja/handbook/handbook-x86.xml?pa...
ここを見れば大体大丈夫
**手順1
ディスクの準備~
fdiskでパーティションを切る。~
sda1 /boot mkfs.ext2
sda2 swap mkswap
sda3 / mk.ext4
~
マウントする。
mkdir /mnt/gentoo
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
**手順2
DLする。
http://ftp.jaist.ac.jp/pub/Linux/Gentoo/releases/x86/curr...
http://ftp.jaist.ac.jp/pub/Linux/Gentoo/snapshots/
展開するときにstage3にはパーミッションを保持するように...
cd /mnt/gentoo
tar xjfvp stage3.tar.bz
tar xjfv portage.tar.bz -C usr
~
vi etc/make.conf
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
#64bitの時は上を消して下を使う
#CHOST="x86_64-pc-linux-gnu"
MAKEOPTS="-j4" #コア数X2程度
~
======= 余談 =======
"-march=native" は gcc-4.2 から導入された gcc がCPUを自動...
http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/i386-and-x86_...
細かい設定はここにある~
#!/bin/sh
CC="gcc"
OPT="-march=native"
NATIVE=$(echo | ${CC} -E -v ${OPT} - 2>&1 | grep cc1)
NOARCH=$(echo | ${CC} -E -v - 2>&1 | grep cc1)
for native in ${NATIVE} ; do
FOUND=0
for noarch in ${NOARCH} ; do
if [ "${native}" = "${noarch}" -a "${nat...
FOUND=1
break
fi
done
if [ ${FOUND} -eq 0 ] ; then
echo -n "${native} "
fi
done
echo
(引用:http://d.hatena.ne.jp/tmatsuu/20090110/1231557035)~
こちらの方のスクリプトでnativeの設定を展開できるらしい。~
nativeにしてあとで展開しちゃえばおkってことですね。~
======= 余談終了 =======
~
gentooのミラー先指定
mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
しかし、できない環境(Gentoo公式じゃないLiveCDからの構築等...
vi etc/make.conf
GENTOO_MIRRORS="http://ftp.jaist.ac.jp/pub/Linux/Gentoo"
SYNC="rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo-portage"
追記する~
chrootの前設定
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc none /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
# Regenerating /etc/ld.so.cache...
source /etc/profile
emerge --sync
eselect profile list
eselect profile set 3
~
USEフラグをつける。インストールしたいパッケージを記入、い...
less /usr/portage/profiles/use.desc
nano -w /etc/make.conf
USE="-gtk -gnome qt4 kde dvd alsa cdr" //正直いまは設定...
~
nano -w /etc/locale.gen
locale-gen
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
**Kernel
『注意』~
共にKernelの設定をするときに最適化を重視するべきなのでMen...
Processor type and features --->
Processor family(適切なCoreを選択すること!!!)
***通常
emerge gentoo-sources
cd /usr/src/linux/
make menuconfig
make
make modules_install
cp arch/i386/boot/bzImage /boot/kernel-2.6.34-gentoo-r1
***初級者コース
emerge gentoo-sources
emerge genkernel
genkernel --menuconfig all
**モジュール設定&必要アプリインストール
emerge syslog-ng vixie-cron vim mlocate
rc-update add syslog-ng default
rc-update add vixie-cron default
find /lib/modules/<kernel version>/ -type f -iname '*.o'...
vi /etc/make.conf
:% s/^\/.*\//modules="/g
:% s/.ko$/"/g
**初期設定類
vi /etc/fstab
/dev/sda1 /boot ext2 ...
/dev/sda3 / ext4 ...
/dev/SWAP none swap ...
/dev/cdrom /mnt/cdrom auto ...
詳細については
http://www.gentoo.org/doc/ja/handbook/handbook-amd64.xml?...
vi /etc/conf.d/hostname
hostname="tux"
vi /etc/conf.d/net
config_eth0="192.168.0.2 netmask 255.255.255.0 brd 192.1...
routes_eth0="default via 192.168.0.1"
または
config_eth0="dhcp"
但しDHCPを使う場合は
emerge dhcpcd
cd /etc/init.d
ln -s net.lo net.eth0
rc-update add net.eth0 default
vi /etc/conf.d/keymaps
vi /etc/conf.d/hwclock
passwd
**Grub
emerge grub
vi /boot/grub/menu.lst
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo Linux
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-3.7.10-gentoo root=...
initrd /boot/initramfs-genkernel-x86_64-3.7.10-gentoo
grep -v rootfs /proc/mounts > /etc/mtab
grub-install --no-floppy /dev/sda
*構築後の更新等
**Portageについて
http://www.gentoo.org/doc/ja/handbook/handbook-x86.xml?pa...
http://www.gentoo.org/doc/ja/portage-manual.xml ~
http://www.gentoo.org/doc/ja/portage-user.xml ~
バラバラなのがナンセンスに感じる.
しかしその分詳しく載ってるのでGood :-D
***Portageのリストを更新する
emerge --sync
これを定期的に行うと良い.一日に数回更新されるが頻繁にや...
一日に1回程度が良い.
***システム等の更新
(すべて-pをつけて実行前に確認を行うことが望ましい.)
システムのみを更新する場合は
emerge -u system
システムを含むソフトウェアやライブラリを更新する場合は
emerge -u world
システムを依存関係を含めて更新する
emerge --update --deep world
システムの全てを更新する
(これはコンパイルとビルドの間には必要ではあるものの、 イ...
emerge --update --deep --with-bdeps=y world
USEフラグを変更したならば,適応するように再コンパイルする...
その場合には--newuseを追加しましょう!
--newuse
完全な更新の実行(しかし大変時間がかかり,安定した今の環境...
emerge --update --deep --newuse --with-bdeps=y world
***便利なコマンド
検索する,ライセンスを確認する
emerge --search gcc
実行前に実験する(-pでも可)
emerge --pretend <任意でoption> <パッケージ名>
使えるUSEフラグを調べる(--verbose)
emerge -pv gentoo-sources
変更情報取得
emerge -pl mozilla
アンインストール
emerge --unmerge gnumeric
***ブロックについて
非常に複雑なので良くWebを確認するように...
**sshについて
Config上Password認証がNOになっているので注意
また,一般ユーザーからsuでrootには標準ではなれない.
vi /etc/ssh/sshd_config
PasswordAuthentication yes
PermitRootLogin no
vi /etc/group
wheel:x:10:root,USERIDを追記
*Gentooを使った自作LiveDVDの作り方
http://en.gentoo-wiki.com/wiki/Build_Your_Own_LiveCD_or_L...
英語だけどどうせコマンドばかりなので特に訳す必要はない.
しかしまとめておきたいのでここに記載する.
**初期設定
emerge squashfs-tools cdrtools
export LIVECD=~/livecd
export TARGET=${LIVECD}/target
export TARGET_SOURCE=${TARGET}/files/source
export SOURCE=${LIVECD}/source
mkdir -p ${LIVECD}/source
cd ${LIVECD}
wget stage portage
cd ${LIVECD}/source
tar -xvjpf ${LIVECD}/stage3-*.tar.bz2
tar -xvjpf ${LIVECD}/portage-latest.tar.bz2 -C usr
**基本システムのインストール開始
cd ${LIVECD}/source
mkdir proc dev sys
mount --bind /proc proc
mount --bind /dev dev
mount --bind /sys sys
mkdir -p usr/portage/distfiles
mount --bind /usr/portage/distfiles usr/portage/distfiles
cp /etc/resolv.conf ${LIVECD}/source/etc
cp /etc/make.conf ${LIVECD}/source/etc
chroot . /bin/bash --login
# now we are in the chrooted environment
env-update && source /etc/profile
passwd
nano /etc/make.conf
CFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j96"
GENTOO_MIRRORS="ftp://ftp.iij.ad.jp/pub/linux/gentoo/...
SYNC="rsync://rsync3.jp.gentoo.org/gentoo-portage"
USE="-X -doc"
emerge -1 gcc
emerge -1 glibc
emerge -e world --exclude glibc --exclude gcc
ln -sf /usr/share/zoneinfo/file> /etc/localtime
emerge memtest86+ localepurge genkernel gentoolkit dmrai...
emerge <required packages, as you like, e.g. logger udev...
rc-update add <applications that need to be started upon...
emerge scripts
emerge mingetty
vi /etc/fstab
/dev/loop0 / squashfs ...
none /proc proc ...
none /dev/shm tmpfs ...
**Kernel
emerge gentoo-sources genkernel
cd /usr/src/linux
[make allmodconfig] OR genkernel --menuconfig all してSa...
必要最低限な設定
General setup --->
<*> Initial RAM filesystem and RAM disk (initramfs/ini...
File systems --->
<*> Ext3 journalling file system support
<*> Reiserfs support
<*> JFS filesystem support
<*> XFS filesystem support
Miscellaneous filesystems --->
<*> SquashFS 4.0 - Squashed file system support
CD-ROM/DVD Filesystems --->
<*> ISO 9660 CDROM file system support
Pseudo filesystems --->
[*] Virtual memory file system support (former shm fs)
Device Drivers --->
Block devices --->
<*> Loopback device support
<*> RAM block device support
(16) Default number of RAM disks
(9000) Default RAM disk size (kbytes)
ATA/ATAPI/MFM/RLL support --->
<*> Include IDE/ATAPI CDROM support
genkernel initramfs
genkernel all --no-splash --no-clean --menuconfig
cp /boot/initramfs-genkernel-x86-2.6.37-gentoo-r4 /boot/...
cp /boot/kernel-genkernel-x86-2.6.37-gentoo-r4 /boot/vml...
***補足設定
emerge app-admin/localepurge
vi /etc/locale.nopurge
MANDELETE
SHOWFREEDSPACE
VERBOSE
en
en_US.UTF-8
localepurge
makewhatis -u
find / -type l ! -xtype f ! -xtype d -ok rm -f {} \;
find / -type f -xdev -name ".keep" -print -exec rm {} \;
emerge mlocate
cat /proc/mounts > /etc/mtab
updatedb
***grub
emerge grub
vi /boot/grub/menu.lst
default 0
timeout 7
splashimage=/boot/grub/splash.xpm.gz
title=LiveCD
kernel /boot/vmlinuz real_root=/dev/loop0 loopt...
initrd /boot/initrd
title=LiveCD NO-FB
kernel /boot/vmlinuz real_root=/dev/loop0 loopt...
initrd /boot/initrd
title=Memtest86+
kernel /boot/memtest86plus/memtest.bin
rm /boot/grub/menu.lst
cp /boot/grub/grub.conf /boot/grub/menu.lst
**最終処理
exit
# Now outside the chroot, put the environment back
cd ${LIVECD}/source
umount sys proc dev usr/portage/distfiles
env-update
source /etc/profile
mkdir -p ${LIVECD}/target/files/source
rsync --delete-after --archive --hard-links --quiet ${LI...
rsync --delete-after --archive --hard-links ${LIVECD}/so...
cd ${TARGET_SOURCE}
rm -rf var/tmp/*
rm -rf var/run/*
rm -rf var/lock/*
rm -rf var/cache/*
mkdir -p var/lock/subsys
mkdir -p var/cache/edb/deb
mkdir var/cache/hald
rm -rf var/db
rm -rf tmp/*
rm -f etc/mtab
touch etc/mtab
rm -rf usr/portage
rm -rf etc/portage
rm -rf usr/share/doc
rm root/.bash_history
rm root/.zcompdump
rm -rf var/log
mkdir var/log
rm etc/make.profile
rm -rf root/.ccache
rm -rf root/.mc
rm -rf initrd
rm before-build
**squashfsとisoの生成
cd ${LIVECD}/target/files
rm -f ${LIVECD}/target/livecd.squashfs
mksquashfs source ${LIVECD}/target/livecd.squashfs
touch ${LIVECD}/target/livecd
cd ${LIVECD}
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -b...
-iso-level 4 -hide-rr-moved -c boot.catalog \
-o ${LIVECD}/livecd.iso -x files ${LIVECD}/target
*余談
UnixBenchを同じ環境のCentOS6とGentooで比べてみた.~
様々な部分で最適化を行っているのでGentooなのが有利なのは...
**Gentoo
========================================================...
BYTE UNIX Benchmarks (Version 5.1.3)
System: gentoo-star-light: GNU/Linux
OS: GNU/Linux -- 3.7.10-gentoo -- #1 SMP Thu Mar 7 16:...
Machine: x86_64 (GenuineIntel)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collat...
CPU 0: Intel(R) Xeon(TM) CPU 3.60GHz (7200.4 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 1: Intel(R) Xeon(TM) CPU 3.60GHz (7200.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 2: Intel(R) Xeon(TM) CPU 3.60GHz (7200.4 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 3: Intel(R) Xeon(TM) CPU 3.60GHz (7200.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
03:42:03 up 8:46, 3 users, load average: 0.16, 0.07...
***1Coreスコア
| Dhrystone 2 using register variables| 1115598...
| Double-Precision Whetstone| 2419....
| Execl Throughput| 2...
| File Copy 1024 bufsize 2000 maxblocks| 342485.7 ...
| File Copy 256 bufsize 500 maxblocks| 110770.1...
| File Copy 4096 bufsize 8000 maxblocks| 679330.9 ...
| Pipe Throughput| ...
| Pipe-based Context Switching| 64684...
| Process Creation| ...
| Shell Scripts (1 concurrent)| 379...
| Shell Scripts (8 concurrent)| 957...
| System Call Overhead| 1052...
***4Coreスコア
| Dhrystone 2 using register variables| 22177107.3 ...
| Double-Precision Whetstone| 4935....
| Execl Throughput| 5...
| File Copy 1024 bufsize 2000 maxblocks| 163593.1 ...
| File Copy 256 bufsize 500 maxblocks| 58558.8 ...
| File Copy 4096 bufsize 8000 maxblocks| 472802.1 ...
| Pipe Throughput| 1...
| Pipe-based Context Switching| 192500...
| Process Creation| 1...
| Shell Scripts (1 concurrent)| 727...
| Shell Scripts (8 concurrent)| 976...
| System Call Overhead| 2883...
**CentOS6
========================================================...
BYTE UNIX Benchmarks (Version 5.1.3)
System: andromeda: GNU/Linux
OS: GNU/Linux -- 2.6.32-279.14.1.el6.x86_64 -- #1 SMP ...
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(TM) CPU 3.60GHz (7200.2 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 1: Intel(R) Xeon(TM) CPU 3.60GHz (7199.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 2: Intel(R) Xeon(TM) CPU 3.60GHz (7200.2 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 3: Intel(R) Xeon(TM) CPU 3.60GHz (7199.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
03:04:48 up 52 days, 8:39, 1 user, load average: 1....
***1Core
| Dhrystone 2 using register variables| 10561349.1 ...
| Double-Precision Whetstone| 1883.7 ...
| Execl Throughput| 2385.3 ...
| File Copy 1024 bufsize 2000 maxblocks| 370558.2 ...
| File Copy 256 bufsize 500 maxblocks| 122804.2 ...
| File Copy 4096 bufsize 8000 maxblocks| 680746.1 ...
| Pipe Throughput| 907149.0 ...
| Pipe-based Context Switching| 61452.0 ...
| Process Creation| 5936.9 ...
| Shell Scripts (1 concurrent)| 3217.5 ...
| Shell Scripts (8 concurrent)| 704.0 ...
| System Call Overhead| 1034585.9 ...
***4Core
| Dhrystone 2 using register variables| 18700298.7 ...
| Double-Precision Whetstone| 5269.4 ...
| Execl Throughput| 4205.6 ...
| File Copy 1024 bufsize 2000 maxblocks| 274687.3 ...
| File Copy 256 bufsize 500 maxblocks| 81241.3 ...
| File Copy 4096 bufsize 8000 maxblocks| 659998.0 ...
| Pipe Throughput| 1809128.8 ...
| Pipe-based Context Switching| 186382.6 ...
| Process Creation| 9241.7 ...
| Shell Scripts (1 concurrent)| 5203.4 ...
| Shell Scripts (8 concurrent)| 800.2 ...
| System Call Overhead| 2366560.0 ...
**比較
| 項目|スコア(CentOS)|スコア(Gentoo)|勝敗|
| Dhrystone 2 using register variable| 18700298....
| Double-Precision Whetstone| 5269.4 MW...
| Execl Throughput| 4205.6 lp...
| File Copy 1024 bufsize 2000 maxblocks| 274687.3 ...
| File Copy 256 bufsize 500 maxblocks| 81241.3 K...
| File Copy 4096 bufsize 8000 maxblocks| 659998.0 ...
| Pipe Throughput| 1809128.8...
| Pipe-based Context Switching| 186382.6 ...
| Process Creation| 9241.7 lp...
| Shell Scripts (1 concurrent)| 5203.4 lp...
| Shell Scripts (8 concurrent)| 800.2 lpm...
| System Call Overhead| 2366560.0...
これを誤差と考えるかどうかは人次第かと思う.
Gentooが適当なKernelの構築なのでDiskの速度に問題がある感...
End:
* gentoo
- [[memo>./memo]]
#br
*gentoo 構築
http://www.gentoo.org/doc/ja/handbook/handbook-x86.xml?pa...
ここを見れば大体大丈夫
**手順1
ディスクの準備~
fdiskでパーティションを切る。~
sda1 /boot mkfs.ext2
sda2 swap mkswap
sda3 / mk.ext4
~
マウントする。
mkdir /mnt/gentoo
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
**手順2
DLする。
http://ftp.jaist.ac.jp/pub/Linux/Gentoo/releases/x86/curr...
http://ftp.jaist.ac.jp/pub/Linux/Gentoo/snapshots/
展開するときにstage3にはパーミッションを保持するように...
cd /mnt/gentoo
tar xjfvp stage3.tar.bz
tar xjfv portage.tar.bz -C usr
~
vi etc/make.conf
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
#64bitの時は上を消して下を使う
#CHOST="x86_64-pc-linux-gnu"
MAKEOPTS="-j4" #コア数X2程度
~
======= 余談 =======
"-march=native" は gcc-4.2 から導入された gcc がCPUを自動...
http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/i386-and-x86_...
細かい設定はここにある~
#!/bin/sh
CC="gcc"
OPT="-march=native"
NATIVE=$(echo | ${CC} -E -v ${OPT} - 2>&1 | grep cc1)
NOARCH=$(echo | ${CC} -E -v - 2>&1 | grep cc1)
for native in ${NATIVE} ; do
FOUND=0
for noarch in ${NOARCH} ; do
if [ "${native}" = "${noarch}" -a "${nat...
FOUND=1
break
fi
done
if [ ${FOUND} -eq 0 ] ; then
echo -n "${native} "
fi
done
echo
(引用:http://d.hatena.ne.jp/tmatsuu/20090110/1231557035)~
こちらの方のスクリプトでnativeの設定を展開できるらしい。~
nativeにしてあとで展開しちゃえばおkってことですね。~
======= 余談終了 =======
~
gentooのミラー先指定
mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
しかし、できない環境(Gentoo公式じゃないLiveCDからの構築等...
vi etc/make.conf
GENTOO_MIRRORS="http://ftp.jaist.ac.jp/pub/Linux/Gentoo"
SYNC="rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo-portage"
追記する~
chrootの前設定
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc none /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
# Regenerating /etc/ld.so.cache...
source /etc/profile
emerge --sync
eselect profile list
eselect profile set 3
~
USEフラグをつける。インストールしたいパッケージを記入、い...
less /usr/portage/profiles/use.desc
nano -w /etc/make.conf
USE="-gtk -gnome qt4 kde dvd alsa cdr" //正直いまは設定...
~
nano -w /etc/locale.gen
locale-gen
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
**Kernel
『注意』~
共にKernelの設定をするときに最適化を重視するべきなのでMen...
Processor type and features --->
Processor family(適切なCoreを選択すること!!!)
***通常
emerge gentoo-sources
cd /usr/src/linux/
make menuconfig
make
make modules_install
cp arch/i386/boot/bzImage /boot/kernel-2.6.34-gentoo-r1
***初級者コース
emerge gentoo-sources
emerge genkernel
genkernel --menuconfig all
**モジュール設定&必要アプリインストール
emerge syslog-ng vixie-cron vim mlocate
rc-update add syslog-ng default
rc-update add vixie-cron default
find /lib/modules/<kernel version>/ -type f -iname '*.o'...
vi /etc/make.conf
:% s/^\/.*\//modules="/g
:% s/.ko$/"/g
**初期設定類
vi /etc/fstab
/dev/sda1 /boot ext2 ...
/dev/sda3 / ext4 ...
/dev/SWAP none swap ...
/dev/cdrom /mnt/cdrom auto ...
詳細については
http://www.gentoo.org/doc/ja/handbook/handbook-amd64.xml?...
vi /etc/conf.d/hostname
hostname="tux"
vi /etc/conf.d/net
config_eth0="192.168.0.2 netmask 255.255.255.0 brd 192.1...
routes_eth0="default via 192.168.0.1"
または
config_eth0="dhcp"
但しDHCPを使う場合は
emerge dhcpcd
cd /etc/init.d
ln -s net.lo net.eth0
rc-update add net.eth0 default
vi /etc/conf.d/keymaps
vi /etc/conf.d/hwclock
passwd
**Grub
emerge grub
vi /boot/grub/menu.lst
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo Linux
root (hd0,0)
kernel /boot/kernel-genkernel-x86_64-3.7.10-gentoo root=...
initrd /boot/initramfs-genkernel-x86_64-3.7.10-gentoo
grep -v rootfs /proc/mounts > /etc/mtab
grub-install --no-floppy /dev/sda
*構築後の更新等
**Portageについて
http://www.gentoo.org/doc/ja/handbook/handbook-x86.xml?pa...
http://www.gentoo.org/doc/ja/portage-manual.xml ~
http://www.gentoo.org/doc/ja/portage-user.xml ~
バラバラなのがナンセンスに感じる.
しかしその分詳しく載ってるのでGood :-D
***Portageのリストを更新する
emerge --sync
これを定期的に行うと良い.一日に数回更新されるが頻繁にや...
一日に1回程度が良い.
***システム等の更新
(すべて-pをつけて実行前に確認を行うことが望ましい.)
システムのみを更新する場合は
emerge -u system
システムを含むソフトウェアやライブラリを更新する場合は
emerge -u world
システムを依存関係を含めて更新する
emerge --update --deep world
システムの全てを更新する
(これはコンパイルとビルドの間には必要ではあるものの、 イ...
emerge --update --deep --with-bdeps=y world
USEフラグを変更したならば,適応するように再コンパイルする...
その場合には--newuseを追加しましょう!
--newuse
完全な更新の実行(しかし大変時間がかかり,安定した今の環境...
emerge --update --deep --newuse --with-bdeps=y world
***便利なコマンド
検索する,ライセンスを確認する
emerge --search gcc
実行前に実験する(-pでも可)
emerge --pretend <任意でoption> <パッケージ名>
使えるUSEフラグを調べる(--verbose)
emerge -pv gentoo-sources
変更情報取得
emerge -pl mozilla
アンインストール
emerge --unmerge gnumeric
***ブロックについて
非常に複雑なので良くWebを確認するように...
**sshについて
Config上Password認証がNOになっているので注意
また,一般ユーザーからsuでrootには標準ではなれない.
vi /etc/ssh/sshd_config
PasswordAuthentication yes
PermitRootLogin no
vi /etc/group
wheel:x:10:root,USERIDを追記
*Gentooを使った自作LiveDVDの作り方
http://en.gentoo-wiki.com/wiki/Build_Your_Own_LiveCD_or_L...
英語だけどどうせコマンドばかりなので特に訳す必要はない.
しかしまとめておきたいのでここに記載する.
**初期設定
emerge squashfs-tools cdrtools
export LIVECD=~/livecd
export TARGET=${LIVECD}/target
export TARGET_SOURCE=${TARGET}/files/source
export SOURCE=${LIVECD}/source
mkdir -p ${LIVECD}/source
cd ${LIVECD}
wget stage portage
cd ${LIVECD}/source
tar -xvjpf ${LIVECD}/stage3-*.tar.bz2
tar -xvjpf ${LIVECD}/portage-latest.tar.bz2 -C usr
**基本システムのインストール開始
cd ${LIVECD}/source
mkdir proc dev sys
mount --bind /proc proc
mount --bind /dev dev
mount --bind /sys sys
mkdir -p usr/portage/distfiles
mount --bind /usr/portage/distfiles usr/portage/distfiles
cp /etc/resolv.conf ${LIVECD}/source/etc
cp /etc/make.conf ${LIVECD}/source/etc
chroot . /bin/bash --login
# now we are in the chrooted environment
env-update && source /etc/profile
passwd
nano /etc/make.conf
CFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j96"
GENTOO_MIRRORS="ftp://ftp.iij.ad.jp/pub/linux/gentoo/...
SYNC="rsync://rsync3.jp.gentoo.org/gentoo-portage"
USE="-X -doc"
emerge -1 gcc
emerge -1 glibc
emerge -e world --exclude glibc --exclude gcc
ln -sf /usr/share/zoneinfo/file> /etc/localtime
emerge memtest86+ localepurge genkernel gentoolkit dmrai...
emerge <required packages, as you like, e.g. logger udev...
rc-update add <applications that need to be started upon...
emerge scripts
emerge mingetty
vi /etc/fstab
/dev/loop0 / squashfs ...
none /proc proc ...
none /dev/shm tmpfs ...
**Kernel
emerge gentoo-sources genkernel
cd /usr/src/linux
[make allmodconfig] OR genkernel --menuconfig all してSa...
必要最低限な設定
General setup --->
<*> Initial RAM filesystem and RAM disk (initramfs/ini...
File systems --->
<*> Ext3 journalling file system support
<*> Reiserfs support
<*> JFS filesystem support
<*> XFS filesystem support
Miscellaneous filesystems --->
<*> SquashFS 4.0 - Squashed file system support
CD-ROM/DVD Filesystems --->
<*> ISO 9660 CDROM file system support
Pseudo filesystems --->
[*] Virtual memory file system support (former shm fs)
Device Drivers --->
Block devices --->
<*> Loopback device support
<*> RAM block device support
(16) Default number of RAM disks
(9000) Default RAM disk size (kbytes)
ATA/ATAPI/MFM/RLL support --->
<*> Include IDE/ATAPI CDROM support
genkernel initramfs
genkernel all --no-splash --no-clean --menuconfig
cp /boot/initramfs-genkernel-x86-2.6.37-gentoo-r4 /boot/...
cp /boot/kernel-genkernel-x86-2.6.37-gentoo-r4 /boot/vml...
***補足設定
emerge app-admin/localepurge
vi /etc/locale.nopurge
MANDELETE
SHOWFREEDSPACE
VERBOSE
en
en_US.UTF-8
localepurge
makewhatis -u
find / -type l ! -xtype f ! -xtype d -ok rm -f {} \;
find / -type f -xdev -name ".keep" -print -exec rm {} \;
emerge mlocate
cat /proc/mounts > /etc/mtab
updatedb
***grub
emerge grub
vi /boot/grub/menu.lst
default 0
timeout 7
splashimage=/boot/grub/splash.xpm.gz
title=LiveCD
kernel /boot/vmlinuz real_root=/dev/loop0 loopt...
initrd /boot/initrd
title=LiveCD NO-FB
kernel /boot/vmlinuz real_root=/dev/loop0 loopt...
initrd /boot/initrd
title=Memtest86+
kernel /boot/memtest86plus/memtest.bin
rm /boot/grub/menu.lst
cp /boot/grub/grub.conf /boot/grub/menu.lst
**最終処理
exit
# Now outside the chroot, put the environment back
cd ${LIVECD}/source
umount sys proc dev usr/portage/distfiles
env-update
source /etc/profile
mkdir -p ${LIVECD}/target/files/source
rsync --delete-after --archive --hard-links --quiet ${LI...
rsync --delete-after --archive --hard-links ${LIVECD}/so...
cd ${TARGET_SOURCE}
rm -rf var/tmp/*
rm -rf var/run/*
rm -rf var/lock/*
rm -rf var/cache/*
mkdir -p var/lock/subsys
mkdir -p var/cache/edb/deb
mkdir var/cache/hald
rm -rf var/db
rm -rf tmp/*
rm -f etc/mtab
touch etc/mtab
rm -rf usr/portage
rm -rf etc/portage
rm -rf usr/share/doc
rm root/.bash_history
rm root/.zcompdump
rm -rf var/log
mkdir var/log
rm etc/make.profile
rm -rf root/.ccache
rm -rf root/.mc
rm -rf initrd
rm before-build
**squashfsとisoの生成
cd ${LIVECD}/target/files
rm -f ${LIVECD}/target/livecd.squashfs
mksquashfs source ${LIVECD}/target/livecd.squashfs
touch ${LIVECD}/target/livecd
cd ${LIVECD}
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -b...
-iso-level 4 -hide-rr-moved -c boot.catalog \
-o ${LIVECD}/livecd.iso -x files ${LIVECD}/target
*余談
UnixBenchを同じ環境のCentOS6とGentooで比べてみた.~
様々な部分で最適化を行っているのでGentooなのが有利なのは...
**Gentoo
========================================================...
BYTE UNIX Benchmarks (Version 5.1.3)
System: gentoo-star-light: GNU/Linux
OS: GNU/Linux -- 3.7.10-gentoo -- #1 SMP Thu Mar 7 16:...
Machine: x86_64 (GenuineIntel)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collat...
CPU 0: Intel(R) Xeon(TM) CPU 3.60GHz (7200.4 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 1: Intel(R) Xeon(TM) CPU 3.60GHz (7200.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 2: Intel(R) Xeon(TM) CPU 3.60GHz (7200.4 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 3: Intel(R) Xeon(TM) CPU 3.60GHz (7200.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
03:42:03 up 8:46, 3 users, load average: 0.16, 0.07...
***1Coreスコア
| Dhrystone 2 using register variables| 1115598...
| Double-Precision Whetstone| 2419....
| Execl Throughput| 2...
| File Copy 1024 bufsize 2000 maxblocks| 342485.7 ...
| File Copy 256 bufsize 500 maxblocks| 110770.1...
| File Copy 4096 bufsize 8000 maxblocks| 679330.9 ...
| Pipe Throughput| ...
| Pipe-based Context Switching| 64684...
| Process Creation| ...
| Shell Scripts (1 concurrent)| 379...
| Shell Scripts (8 concurrent)| 957...
| System Call Overhead| 1052...
***4Coreスコア
| Dhrystone 2 using register variables| 22177107.3 ...
| Double-Precision Whetstone| 4935....
| Execl Throughput| 5...
| File Copy 1024 bufsize 2000 maxblocks| 163593.1 ...
| File Copy 256 bufsize 500 maxblocks| 58558.8 ...
| File Copy 4096 bufsize 8000 maxblocks| 472802.1 ...
| Pipe Throughput| 1...
| Pipe-based Context Switching| 192500...
| Process Creation| 1...
| Shell Scripts (1 concurrent)| 727...
| Shell Scripts (8 concurrent)| 976...
| System Call Overhead| 2883...
**CentOS6
========================================================...
BYTE UNIX Benchmarks (Version 5.1.3)
System: andromeda: GNU/Linux
OS: GNU/Linux -- 2.6.32-279.14.1.el6.x86_64 -- #1 SMP ...
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(TM) CPU 3.60GHz (7200.2 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 1: Intel(R) Xeon(TM) CPU 3.60GHz (7199.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 2: Intel(R) Xeon(TM) CPU 3.60GHz (7200.2 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
CPU 3: Intel(R) Xeon(TM) CPU 3.60GHz (7199.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address ...
03:04:48 up 52 days, 8:39, 1 user, load average: 1....
***1Core
| Dhrystone 2 using register variables| 10561349.1 ...
| Double-Precision Whetstone| 1883.7 ...
| Execl Throughput| 2385.3 ...
| File Copy 1024 bufsize 2000 maxblocks| 370558.2 ...
| File Copy 256 bufsize 500 maxblocks| 122804.2 ...
| File Copy 4096 bufsize 8000 maxblocks| 680746.1 ...
| Pipe Throughput| 907149.0 ...
| Pipe-based Context Switching| 61452.0 ...
| Process Creation| 5936.9 ...
| Shell Scripts (1 concurrent)| 3217.5 ...
| Shell Scripts (8 concurrent)| 704.0 ...
| System Call Overhead| 1034585.9 ...
***4Core
| Dhrystone 2 using register variables| 18700298.7 ...
| Double-Precision Whetstone| 5269.4 ...
| Execl Throughput| 4205.6 ...
| File Copy 1024 bufsize 2000 maxblocks| 274687.3 ...
| File Copy 256 bufsize 500 maxblocks| 81241.3 ...
| File Copy 4096 bufsize 8000 maxblocks| 659998.0 ...
| Pipe Throughput| 1809128.8 ...
| Pipe-based Context Switching| 186382.6 ...
| Process Creation| 9241.7 ...
| Shell Scripts (1 concurrent)| 5203.4 ...
| Shell Scripts (8 concurrent)| 800.2 ...
| System Call Overhead| 2366560.0 ...
**比較
| 項目|スコア(CentOS)|スコア(Gentoo)|勝敗|
| Dhrystone 2 using register variable| 18700298....
| Double-Precision Whetstone| 5269.4 MW...
| Execl Throughput| 4205.6 lp...
| File Copy 1024 bufsize 2000 maxblocks| 274687.3 ...
| File Copy 256 bufsize 500 maxblocks| 81241.3 K...
| File Copy 4096 bufsize 8000 maxblocks| 659998.0 ...
| Pipe Throughput| 1809128.8...
| Pipe-based Context Switching| 186382.6 ...
| Process Creation| 9241.7 lp...
| Shell Scripts (1 concurrent)| 5203.4 lp...
| Shell Scripts (8 concurrent)| 800.2 lpm...
| System Call Overhead| 2366560.0...
これを誤差と考えるかどうかは人次第かと思う.
Gentooが適当なKernelの構築なのでDiskの速度に問題がある感...
Page:
Site Search
Advanced Search
Login
Username:
Password:
Lost Password?
Register now!!
Sub Menu
New Arrivals
Books
Web Links
Site Map
e-Learning
TUIS Certificate
mini Calendar
May 2025
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Today
Who's Online
113 user(s) are online (3 user(s) are browsing xpwiki)
Members: 0
Guests: 113
more...
Access Counter
Today :
Yesterday :
Total :
Powered by XOOPS Cube 2.1© 2001-2006
XOOPS Cube Project
Design by
XoopsDesign.com