prefixから始めるgentoo生活
TRANSCRIPT
おかげさまで
Gentoo インストールマン
Gentoo インストールマン
新 OS インストール時の障壁• 空いているサーバ・リソースがない
• 色々設定するのが面倒
• インストールしただけだと中々使わない
• カーネルコンフィグとかむずかしそう
サーバの用意・細かい設定
サーバの用意・細かい設定
Prefixから始める Ge tooRe: Life in a Gentoo world from PrefixRe:から始 る Gen 生活
だれ?オズ @Wizard_of_Oz__この木なんの木系エンジニア
趣味で自宅の PC に Gentoo を使用
Gentoo Prefix とは?• Prefix( インストール先指定 ) を利用したインストール
システム
• Gentoo のシステム一式を Prefix 先にインストール
Gentoo Prefix の利点・欠点• ディストリによらず Gentoo のパッケージマネー
ジャー (Portage) が使用可能にUbuntu, CentOS, Mac, BSD ・・・
• root 権限不要
• 環境を汚さず要らなくなったらディレクトリ削除で OK• システムのコア部分は対応できない
Kernel とか Systemd とか
• メンテナンスが行き届いていない部分がある
Gentoo Prefix のインストール方法• bootstrap スクリプトを使用 大きく 2 種類
bootstrap-prefix.sh標準のインストール方法⇒あまりうごかない?
bootstrap-rap.sh (Prefix/libc)libc まで含めたインストール方法
⇒大体の環境や Android でも動く
Gentoo Prefix のインストール方法• インストールは以下を実行するだけ
$ wget http://dev.gentoo.org/~heroxbd/bootstrap-rap.sh$ bash bootstrap-rap.sh
対話形式で 3 つ質問される
⇒ すべてエンターで OK
インストール実行確認~$ bash bootstrap-rap.sh
. .vir. d$b .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b. $$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b. Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$ "$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$ d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P $$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P" `Q$$P" """
Welcome to the Gentoo Prefix interactive installer!
I will attempt to install Gentoo Prefix on your system. To do so, I'll ask you some questions first. After that, you'll have to practise patience as your computer and I try to figure out a way to get a lot of software packages compiled. If everything goes according to plan, you'll end up with what we call "a Prefix install", but by that time, I'll tell you more.
Do you want me to start off now? [Yn]
使用コア ( 並列 ) 数確認I did my utmost best, and found that you have 4 cpu cores. Ifthis looks wrong to you, you can happily ignore me. Based on the numberof cores you have, I came up with the idea of parallelising compilationwork where possible with 5 parallel make threads. If you have noclue what this means, you should go with my excellent default I'vechosen below, really!How many parallel make jobs do you want? [3]
インストール先確認Each and every Prefix has a home. That is, a place where everything issupposed to be in. That place must be fully writable by you (duh), butshould also be able to hold some fair amount of data and preferably bereasonably fast. In terms of space, I advise something around 2GiB(it's less if you're lucky). I suggest a reasonably fast place becausewe're going to compile a lot, and that generates a fair bit of IO. Ifsome networked filesystem like NFS is the only option for you, thenyou're just going to have to wait a fair bit longer.This place which is your Prefix' home, is often referred to by avariable called EPREFIX.
What do you want EPREFIX to be? [/home/user/gentoo]
ささやき - いのり - えいしょう - ねんじろ!I'm now going to make an awful lot of noise going through a sequence ofstages to make your box as groovy as I am myself, setting up yourPrefix. In short, I'm going to run stage1, stage2, stage3, followed byemerge -e system. If any of these stages fail, both you and me are indeep trouble. So let's hope that doesn't happen.
Type here what you want to wish me [luck]
スヤァ
インストール完了* To start Gentoo Prefix, run the script /home/user/gentoo/startprefix* You can copy this file to a more convenient place if you like.* WARNING: your shell initialisation (.cshrc, .bashrc, .profile)* seems to prepend to your PATH, this might kill your* Prefix:* /home/user/bin:/home/user/.local/bin:* You better fix this, YOU HAVE BEEN WARNED!
Woah! Everything just worked! Now YOU should run /home/user/gentoo/startprefixand enjoy! Thanks for using me, it was a pleasure to work with you.
Prefix 使用方法~$ gentoo/startprefixEntering Gentoo Prefix /home/user/gentoo
⇒emerge が使用可能に!
・ Prefix 配下に色々なバイナリがインストール~$ which ls/home/user/gentoo/bin/ls・ OS 固有のコマンドも使用可能~$ which yum/usr/bin/yum
GentooPrefix rap今すぐ検索
あなたと Gentoo,今すぐインストール
おまけ インストール時の問題• ミラーを使うには
$ export GENTOO_MIRRORS=http://ftp.jaist.ac.jp/pub/Linux/Gentoo/$ bash bootstrap-rap.sh
• root だと怒られる
• gcc を入れてる必要がある
• 適当なことを言うと怒られるType here what you want to wish me [luck] hogeHuh? You're not serious, are you?
インストール失敗する場合・ ebuild ファイル ( インストール手順書 ) を修正すれば大体解決する
⇒Prefix を考慮していないためのパス間違いがほとんど
・ ebuild ファイルの実態はただの Shell Script・エラーが出た部分を確認してパスを直すだけ
⇒ よくあるケースを紹介
Prefix 未対応のパッケージ・インストール時に失敗⇒コンパイルなどは成功している・ The specific snippet of code が失敗した部分のコード
$ emerge –av net-print/pykota
* ERROR: net-print/pykota-1.26::gentoo failed (install phase): * (no error message) * * Call stack: * ebuild.sh, line 115: Called src_install * environment, line 3780: Called die * The specific snippet of code: * rmdir "${D}"/usr/share/doc/${PN} || die
Prefix 未対応のパッケージ・ ebuild ファイル ( インストール手順書 ) を修正
$ nano gentoo/usr/portage/net-print/pykota-1.26.ebuild…エラー部分の ${D}⇒${ED} に変更(${D} は Prefix を考慮していないインストール先、 ${ED} は考慮したもの )
・ ebuild ファイルの digest を再計算$ ebuild pykota-1.26.ebuild digest
・再度インストール実施すると成功$ emerge –av net-print/pykota