|
1: 2009-08-19 (水) 02:11:45 maruo |
| + | [[Gentoo Linuxな生活]] |
| | | |
| + | *多分一発ではうまくいきません [#jb82a625] |
| + | やり方だけは書きますが、[[トラブルシューティング>/GentooLinuxな生活/トラブルシューティング]]を見てもらった方がいいね。 |
| + | |
| + | |
| + | *ベースとなる設定ファイル例 [#x0b9378c] |
| + | /usr/share/doc/catalyst-X.X.X/examples/配下に定義ファイルの見本が入っております。これをベースに行うのが吉。 |
| + | |
| + | *まずは準備 [#ebaa6559] |
| + | 作業フォルダを作ります。 |
| + | # mkdir -p /var/tmp/catalyst/build |
| + | 次。[[gentooミラーサイト:http://www.gentoo.org/main/ja/mirrors.xml]]から、Stage3tarballを落としてきます。それを上のフォルダに置きます。 |
| + | *それでは順番に [#tb26721e] |
| + | *catalystの設定 [#m3e66f18] |
| + | /etc/catalyst/catalyst.confという設定ファイルがあります。こいつらをいじってやります。コメントみながらやってね。コメントは長いので削除。 |
| + | distdir="/usr/portage/distfiles" ダウンロードしたソースtarballがある場所 |
| + | options="pkgcache kerncache distcc" catalyst動作モード。ここではdistccを追加してまーす |
| + | sharedir="/usr/lib/catalyst" catalyst実行スクリプトの場所。変える必要無し |
| + | envscript="/root/catalyst/catalyst.env" catalyst実行中の環境変数定義ファイル |
| + | で、最後のcatalyst.envはmake.confに書く環境変数のコトです。おいちゃんはこんな感じにしてみた。 |
| + | export MAKEOPTS="-j6" |
| + | export LINGUAS="ja" |
| + | export CHOST="i686-pc-linux-gnu" |
| + | **snapshot作成 [#ndd5c17c] |
| + | [[gentooミラーサイト:http://www.gentoo.org/main/ja/mirrors.xml]]に置いてある、portageのスナップショット相当を作成します。まずはsnapshot作成用のサンプルファイルsnapshot_template.specを持ってきて、編集します。 |
| + | # cp /usr/share/doc/catalyst-X.X.X/examples/snapshot_template.spec /root/catalyst/snapshot.spec |
| + | 編集します。中身 |
| + | target: snapshot ←snapshot作成を指示 |
| + | version_stamp: 20050603 ←タイムスタンプは適当に決める |
| + | #portdir_overlay: ←portage上書き設定がある場合はこれに書く |
| + | |
| + | で、以下を実行する |
| + | # catalyst -f snapshot.spec |
| + | すると、/var/tmp/catalyst/snapshots配下に、snapshot-<version_stamp>.tar.bz2ができあがります。 |
| + | **livecd-stage1 [#d07206e5] |
| + | 今度はlivecdのルートイメージ作成。まずはlivecd-stage1用のサンプルファイルlivecd-stage1_template.specをもってきます |
| + | # cp /usr/share/doc/catalyst-X.X.X/examples/livecd-stage1_template.spec /root/catalyst/livecd-stage1.spec |
| + | 中身を編集します。 |
| + | #コンパイルするアーキテクチャ指定。gccの-marchと同等だね。athlonもよし、pentium4もよし |
| + | subarch: x86 |
| + | #タイムスタンプ |
| + | version_stamp: 20050605 |
| + | #livecd-stage1作成を指示 |
| + | target: livecd-stage1 |
| + | # リリースタイプ。デフォルトで問題なし |
| + | rel_type: default |
| + | # プロファイル。/usr/portage/profilesの下のどれを使うか |
| + | profile: default-linux/x86/2005.0 |
| + | # どのsnapshotを使用するか。上で作ったスナップショットのversion_stamp部分を書く |
| + | snapshot: 20050603 |
| + | # どのstage3イメージを使うか。/var/tmp/catalyst/buildsの下に置いたtar.bz2をのぞいたstage3イメージ名 |
| + | source_subpath: stage3-x86-2005.0 |
| + | # distccを使用する場合のホスト。別になくてもよい |
| + | distcc_hosts: 192.168.1.1 192.168.1.2 192.168.1.3 |
| + | # portageの動きを制御するpackage.xxxファイルがおいてある場所 |
| + | portage_confdir: /etc/portage |
| + | # USEフラグの指定。今回はXが起動するlivecdを作ろうとしてる |
| + | livecd/use: ipv6 socks5 livecd fbcon ncurses readline ssl X kde \ |
| + | alsa a52 aac cdda cddb dts dvd stream nptl nptlonly \ |
| + | ithreads ffmpeg unicode wxwindows |
| + | # 入れ込むパッケージ。好きなもん指定して。デフォルトだとlivecdと同じ物ができる |
| + | livecd/packages: livecd-tools dhcpcd acpid apmd gentoo-sources kudzu-knoppix hotplug \ |
| + | coldplug fxload gpm syslog-ng parted links raidtools dosfstools nfs-utils \ |
| + | jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs screen iputils \ |
| + | hwdata-knoppix hwsetup lvm2 evms vim mdadm ethtool xorg-x11 \ |
| + | kde vlc ethereal nessus quagga tcpreplay kde-i18n iptables vconfig \ |
| + | ebtables rp-pppoe openvpn rp-l2tp freeradius radiusclient ipsec-tools \ |
| + | 出来たら以下を実行 |
| + | # catalyst -f livecd-stage1.spec |
| + | ここからごりごりごりごりごりごりごりごりごりコンパイルがスタートする。/var/tmp/catalyst/tmp/default/livecd-stage1-<version_stamp>ディレクトリにイメージが作られる。このディレクトリ配下がpackageをemergeした後の状態になる。 |
| + | **livecd-stage2 [#b870e818] |
| + | 今度はlivecdのISOイメージ作成。まずはlivecd-stage2用のサンプルファイルlivecd-stage2_template.specをもってきます |
| + | # cp /usr/share/doc/catalyst-X.X.X/examples/livecd-stage2_template.spec /root/catalyst/livecd-stage2.spec |
| + | 中身を編集します。めんどい~ |
| + | #livecd-stage1といっしょ |
| + | subarch: x86 |
| + | #livecd-stage1といっしょ |
| + | version_stamp:20050606 |
| + | #livecd-stage2作成を指示 |
| + | target: livecd-stage2 |
| + | #livecd-stage1といっしょ |
| + | rel_type: default |
| + | #livecd-stage1といっしょ |
| + | profile: default-linux/x86/2005.0 |
| + | #livecd-stage1といっしょ |
| + | profile:snapshot: 20050603 |
| + | #livecd-stage1といっしょ |
| + | distcc_hosts: 192.168.1.1 192.168.1.2 192.168.1.3 |
| + | #livecd-stage1といっしょ |
| + | portage_confdir: /etc/portage |
| + | #squashfsが一番圧縮率が良いらしい。確実に1/2のサイズになる |
| + | livecd/cdfstype: squashfs |
| + | #デフォルトのまま |
| + | livecd/archscript: /usr/lib/catalyst/livecd/runscript/x86-archscript.sh |
| + | #デフォルトのまま |
| + | livecd/runscript: /usr/lib/catalyst/livecd/runscript/default-runscript.sh |
| + | #デフォルトのまま |
| + | livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-2.13-memtest86+-cdtar.tar.bz2 |
| + | #このファイル名でisoファイルができる |
| + | livecd/iso: /tmp/livecd-x86-minimal.iso |
| + | #LiveCDみたいなsplashイメージ使いたい場合は |
| + | livecd/splash_type: gensplash |
| + | #LiveCDみたいなsplashイメージ使いたい場合は |
| + | livecd/splash_theme: livecd-2005.0 |
| + | #genkernelのオプション |
| + | livecd/gk_mainargs: --lvm2 --dmraid |
| + | #作成するCDのタイプ |
| + | livecd/type: gentoo-livecd |
| + | #起動メッセージだしたければメッセージ書き込んだファイルを指定 |
| + | livecd/motd: |
| + | #ハードウェア自動認識時組み込んでほしくないモジュール |
| + | livecd/modblacklist: |
| + | #起動時に起動しておいてほしいサービス。init.dの下にあるシェルを指定する |
| + | livecd/rcadd: |
| + | #起動時に起動してほしくないサービス。init.dの下にあるシェルを指定する |
| + | livecd/rcdel: |
| + | #livecd-stage1といっしょ |
| + | livecd/overlay: |
| + | #上書きしたいルートイメージ |
| + | livecd/root_overlay: |
| + | #/dev配下のファイルシステム。ここではudevを指定 |
| + | livecd/devmanager: udev |
| + | #Xを起動するときに使用するxinitrc |
| + | livecd/xinitrc: /root/catalyst/xinitrc |
| + | #gamecdを作りたいときの指定 |
| + | gamecd/conf: |
| + | #カーネルイメージ名 |
| + | boot/kernel: gentoo |
| + | #カーネル構築に使用するカーネルソースツリー |
| + | boot/kernel/gentoo/sources: gentoo-sources |
| + | #カーネル構築に使用するカーネル設定ファイル |
| + | boot/kernel/gentoo/config: /root/catalyst/2.6.11-smp.config |
| + | #なんだろう? |
| + | boot/kernel/gentoo/gk_kernargs: |
| + | #livecd-stage2で使用するUSEフラグ |
| + | boot/kernel/gentoo/use: pcmcia usb X |
| + | #なんだろう? |
| + | boot/kernel/gentoo/extraversion: |
| + | #デフォルトのまま。splashテーマ出したいから指定してる |
| + | boot/kernel/gentoo/postconf: splashutils splash-themes-livecd |
| + | #追加インストールするパッケージ |
| + | boot/kernel/gentoo/packages: pcmcia-cs speedtouch slmodem globespan-adsl hostap-driver \ |
| + | hostap-utils ipw2100 ipw2200 fritzcapi fcdsl cryptsetup |
| + | #ISOイメージ作るときに抜いてしまうパッケージ |
| + | livecd/unmerge: acl attr autoconf automake bin86 binutils libtool m4 bison ld.so make perl \ |
| + | patch linux-headers man-pages sash bison flex gettext texinfo ccache distcc \ |
| + | addpatches man groff lib-compat miscfiles rsync sysklogd bc lcms libmng \ |
| + | genkernel diffutils libperl gnuconfig gcc-config gcc bin86 cpio cronbase ed \ |
| + | expat grub lilo help2man libtool gentoo-sources |
| + | #ISOイメージ作成時に空にするディレクトリ |
| + | livecd/empty: /var/tmp /var/cache /var/db /var/empty /var/lock /var/log /var/run \ |
| + | /var/spool /var/state /tmp /usr/portage /usr/share/man /usr/share/info \ |
| + | /usr/share/unimaps /usr/include /usr/share/zoneinfo /usr/share/dict \ |
| + | /usr/share/doc /usr/share/ss /usr/share/state /usr/share/texinfo \ |
| + | /usr/lib/python2.2 /usr/lib/portage /usr/share/gettext /usr/share/i18n \ |
| + | /usr/share/rfc /usr/lib/X11/config /usr/lib/X11/etc /usr/lib/X11/doc /usr/src \ |
| + | /usr/share/doc /usr/share/man /root/.ccache /etc/cron.daily /etc/cron.hourly \ |
| + | /etc/cron.monthly /etc/cron.weekly /etc/logrotate.d /etc/rsync \ |
| + | /usr/lib/awk /usr/lib/ccache /usr/lib/gcc-config /usr/lib/nfs /usr/local |
| + | /usr/diet/include /usr/diet/man /usr/share/consolefonts/partialfonts \ |
| + | /usr/share/consoletrans /usr/share/emacs /usr/share/gcc-data \ |
| + | /usr/share/genkernel /etc/bootsplash/gentoo \ |
| + | /etc/bootsplash/gentoo-highquality /etc/splash/gentoo /etc/splash/emergence \ |
| + | /usr/share/gnuconfig /usr/share/lcms /usr/share/locale /etc/skel |
| + | #ISOイメージ作成時に消してしまうファイル |
| + | livecd/rm: /lib/*.a /usr/lib/*.a /usr/lib/gcc-lib/*/*/libgcj* /etc/dispatch-conf.conf \ |
| + | /etc/etc-update.conf /etc/*- /etc/issue* /etc/make.conf /etc/man.conf \ |
| + | /etc/*.old /root/.viminfo /usr/sbin/bootsplash* /usr/sbin/fb* /usr/sbin/fsck.cramfs \ |
| + | /usr/sbin/fsck.minix /usr/sbin/mkfs.minix /usr/sbin/mkfs.bfs /usr/sbin/mkfs.cramfs \ |
| + | /lib/security/pam_access.so /lib/security/pam_chroot.so /lib/security/pam_debug.so \ |
| + | /lib/security/pam_ftp.so /lib/security/pam_issue.so /lib/security/pam_mail.so \ |
| + | /lib/security/pam_motd.so /lib/security/pam_mkhomedir.so \ |
| + | /lib/security/pam_postgresok.so /lib/security/pam_rhosts_auth.so \ |
| + | /lib/security/pam_userdb.so /usr/share/consolefonts/1* /usr/share/consolefonts/7* \ |
| + | /usr/share/consolefonts/8* /usr/share/consolefonts/9* /usr/share/consolefonts/A* \ |
| + | /usr/share/consolefonts/C* /usr/share/consolefonts/E* /usr/share/consolefonts/G* \ |
| + | /usr/share/consolefonts/L* /usr/share/consolefonts/M* /usr/share/consolefonts/R* \ |
| + | /usr/share/consolefonts/a* /usr/share/consolefonts/c* /usr/share/consolefonts/dr* \ |
| + | /usr/share/consolefonts/g* /usr/share/consolefonts/i* /usr/share/consolefonts/k* \ |
| + | /usr/share/consolefonts/l* /usr/share/consolefonts/r* /usr/share/consolefonts/s* \ |
| + | /usr/share/consolefonts/t* /usr/share/consolefonts/v* /etc/splash/livecd-2005.0/16* \ |
| + | /etc/splash/livecd-2005.0/12* /etc/splash/livecd-2005.0/6* /etc/splash/livecd-2005.0/8*\ |
| + | /etc/splash/livecd-2005.0/images/silent-16* /etc/splash/livecd-2005.0/images/silent-12* \ |
| + | /etc/splash/livecd-2005.0/images/silent-6* /etc/splash/livecd-2005.0/images/silent-8* \ |
| + | /etc/splash/livecd-2005.0/images/verbose-16* /etc/splash/livecd-2005.0/images/verbose-12* \ |
| + | /etc/splash/livecd-2005.0/images/verbose-6* etc/splash/livecd-2005.0/images/verbose-8* \ |
| + | /etc/make.conf.example /etc/make.globals /etc/resolv.conf |
| + | |
| + | で、以下を実行 |
| + | # catalyst -f livecd-stage2.spec |
| + | すると、先ほどlivecd-stage1で作ったフォルダをrsyncで/var/tmp/catalyst/tmp/default/livecd-stage2-<version_stamp>と言うフォルダにコピーして、ISOイメージを作ってくれます。 |