prefixから始めるgentoo生活

25
おおおおおお

Upload: bontakun

Post on 07-Feb-2017

367 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Prefixから始めるgentoo生活

おかげさまで

Page 2: Prefixから始めるgentoo生活

Gentoo インストールマン

Page 3: Prefixから始めるgentoo生活

Gentoo インストールマン

Page 4: Prefixから始めるgentoo生活

新 OS インストール時の障壁• 空いているサーバ・リソースがない

• 色々設定するのが面倒

• インストールしただけだと中々使わない

• カーネルコンフィグとかむずかしそう

Page 5: Prefixから始めるgentoo生活

サーバの用意・細かい設定

Page 6: Prefixから始めるgentoo生活

サーバの用意・細かい設定

Page 7: Prefixから始めるgentoo生活

Prefixから始める Ge tooRe: Life in a Gentoo world from PrefixRe:から始 る Gen 生活

Page 8: Prefixから始めるgentoo生活

だれ?オズ @Wizard_of_Oz__この木なんの木系エンジニア

趣味で自宅の PC に Gentoo を使用

Page 9: Prefixから始めるgentoo生活

Gentoo Prefix とは?• Prefix( インストール先指定 ) を利用したインストール

システム

• Gentoo のシステム一式を Prefix 先にインストール

Page 10: Prefixから始めるgentoo生活

Gentoo Prefix の利点・欠点• ディストリによらず Gentoo のパッケージマネー

ジャー (Portage) が使用可能にUbuntu, CentOS, Mac, BSD ・・・

• root 権限不要

• 環境を汚さず要らなくなったらディレクトリ削除で OK• システムのコア部分は対応できない

Kernel とか Systemd とか

• メンテナンスが行き届いていない部分がある

Page 11: Prefixから始めるgentoo生活

Gentoo Prefix のインストール方法• bootstrap スクリプトを使用 大きく 2 種類

bootstrap-prefix.sh標準のインストール方法⇒あまりうごかない?

bootstrap-rap.sh (Prefix/libc)libc まで含めたインストール方法

⇒大体の環境や Android でも動く

Page 12: Prefixから始めるgentoo生活

Gentoo Prefix のインストール方法• インストールは以下を実行するだけ

$ wget http://dev.gentoo.org/~heroxbd/bootstrap-rap.sh$ bash bootstrap-rap.sh

対話形式で 3 つ質問される

⇒ すべてエンターで OK

Page 13: Prefixから始めるgentoo生活

インストール実行確認~$ 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]

Page 14: Prefixから始めるgentoo生活

使用コア ( 並列 ) 数確認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]

Page 15: Prefixから始めるgentoo生活

インストール先確認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]

Page 16: Prefixから始める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]

Page 17: Prefixから始めるgentoo生活

スヤァ

Page 18: Prefixから始めるgentoo生活

インストール完了* 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.

Page 19: Prefixから始めるgentoo生活

Prefix 使用方法~$ gentoo/startprefixEntering Gentoo Prefix /home/user/gentoo

⇒emerge が使用可能に!

・ Prefix 配下に色々なバイナリがインストール~$ which ls/home/user/gentoo/bin/ls・ OS 固有のコマンドも使用可能~$ which yum/usr/bin/yum

Page 20: Prefixから始めるgentoo生活

GentooPrefix rap今すぐ検索

Page 21: Prefixから始めるgentoo生活

あなたと Gentoo,今すぐインストール

Page 22: Prefixから始める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?

Page 23: Prefixから始めるgentoo生活

インストール失敗する場合・ ebuild ファイル ( インストール手順書 ) を修正すれば大体解決する

⇒Prefix を考慮していないためのパス間違いがほとんど

・ ebuild ファイルの実態はただの Shell Script・エラーが出た部分を確認してパスを直すだけ

⇒ よくあるケースを紹介

Page 24: Prefixから始めるgentoo生活

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

Page 25: Prefixから始めるgentoo生活

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