Wakame-vdc LiveDVD 16.1 を作る 1日目

Wakame-vdc ユーザの皆さん、磯野家の皆さん、こんにちは。これはオレオレ WakameVdc / OpenVNet Advent Calendar 2015 の1日目のエントリです。

え?そんなアドカレどこに立ってんの?って?それは皆の心の中に立ってます。そう皆の心の中に立ってるので、エントリは自由! Yes! フリーダム!イイイイイヤッフウウウウウゥゥゥヒイアウィゴオオオオオオオッ!!

もちろん変な薬や危ない薬なんてやってません。

さすがに一人で1日3本も書くとなると完全にネタなんて枯渇します。もとよりたいして気の利いたことも言えないし、人様を楽しませられるようなナイスな話術もないので、完全に「タダの頭のおかしいやつ」状態です。

全然関係ない前置きをしました。

Wakame-vdc LiveDVD の CI 環境を作ろうと思うんですが、それ以前に実は 15.07 以来、Wakame-vdc LiveDVD のビルドが成功していないので、まずは成功するようにしようと思い、それをゆる〜く毎日綴っていくことにします。アドカレっていうより、ただの日記。

あっ…「お前、過去のエントリ見直せよ、宿題たくさんあんだろが!」っていうご指摘ごもっともですが、その日の気分で書くこと変わりそうな気配なので、生温かい目で見守ってください。

えーと、先日、Wakame-vdc LiveDVD の CI 環境を作ろうと、皆のお友達 ConoHa に LiveDVD のビルド環境を移行しました。で、移行して一発目、Wakame-vdc LiveDVD 16.1 でも作ろうかとビルドしたところ、一見すると以下のように正常に終了しているのですが…

 99.75% done, estimate finish Tue Dec  1 19:15:35 2015
Total translation table size: 2048
Total rockridge attributes bytes: 2669
Total directory bytes: 8782
Path table size(bytes): 64
Max brk space used 11000
541355 extents written (1057 MB)
isohybrid: Warning: more than 1024 cylinders: 1058
isohybrid: Not all BIOSes will be able to boot this device
Inserting md5sum into iso image...
md5 = ff4299eee0dcefcee7f95acb38b25cc0
Inserting fragment md5sums into iso image...
fragmd5 = 77cdd2e22e3777a2844d51713419d53182ccdebd21ad7c14bb27eb9d1ecf
frags = 20
Setting supported flag to 0

ビルド時の出力をよくよく眺めてみると、以下のようなエラーが出たので、まずは今日はそれを取り除いてみようと思います。

ERROR:  Could not find a valid gem 'etcd' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)
+ /opt/axsh/wakame-vdc/ruby/bin/gem install mixlib-log
ERROR:  Could not find a valid gem 'mixlib-log' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)
+ /opt/axsh/wakame-vdc/ruby/bin/gem install rdialog
ERROR:  Could not find a valid gem 'rdialog' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)
+ /opt/axsh/wakame-vdc/ruby/bin/gem install net-dhcp
ERROR:  Could not find a valid gem 'net-dhcp' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)

うん、ことごとく gem のインストールに失敗してます。

んじゃまぁ、ダウンロードできねぇって言っている https://rubygems.org/latest_specs.4.8.gz とやらをゲットしてみようじゃないかっていうことで、

# wget https://rubygems.org/latest_specs.4.8.gz
--2015-12-01 19:22:11--  https://rubygems.org/latest_specs.4.8.gz
Resolving rubygems.org... 54.186.104.15
Connecting to rubygems.org|54.186.104.15|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz [following]
--2015-12-01 19:22:11--  https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz
Resolving rubygems.global.ssl.fastly.net... 103.245.222.249
Connecting to rubygems.global.ssl.fastly.net|103.245.222.249|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 932409 (911K) [application/octet-stream]
Saving to: `latest_specs.4.8.gz'

100%[====================================================>] 932,409     --.-K/s   in 0.03s   

2015-12-01 19:22:11 (27.3 MB/s) - `latest_specs.4.8.gz' saved [932409/932409]

いやいや、ゲットできるじゃないの。 うーん?何故だぜ?

で、ふと気になって /etc/resolv.conf を見ると

# cat /etc/resolv.conf 
; generated by /sbin/dhclient-script
nameserver 2400:8500:1101:698:210:157:3:4
nameserver 2400:8500:1301:699:157:7:180:133

ってなってます…あ…もしかして…

echo "nameserver 157.7.180.133" > /etc/resolv.conf
echo "nameserver 210.157.3.4" >> /etc/resolv.conf

とやってもう一度ビルドしてみます。

ERROR:  Could not find a valid gem 'etcd' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)

む…むぅ…そもそもビルド時の chroot 環境の resolv.conf ってどーなってんだ?と思い、kickstart ファイルで gem install している直前に cat /etc/resolv.conf って書いてビルドしてみました。

+ cat /etc/resolv.conf
nameserver 192.168.122.1
+ /opt/axsh/wakame-vdc/ruby/bin/gem install etcd
ERROR:  Could not find a valid gem 'etcd' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)

192.168.122.1?あぁ、これは酷い、僕のローカル環境の値じゃないか…

で、よくよく wakame-livedvd-withX.ks を確認すると

%post

cp -a /etc/resolv.conf /etc/resolv.conf.orig
echo "nameserver 192.168.122.1" >> /etc/resolv.conf

ってなことが書いてあったので、これを外して再実行してみました。

+ cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
+ /opt/axsh/wakame-vdc/ruby/bin/gem install etcd
ERROR:  Could not find a valid gem 'etcd' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)

うん、そうだよねぇ…gem が名前解決できないから固定的に /etc/resolv.conf を設置したんだもんなぁ…

しょうがないので、結局元のダサい方法を使うことにします。こんな感じに。

echo "nameserver 157.7.180.133" >> /etc/resolv.conf
echo "nameserver 210.157.3.4" >> /etc/resolv.conf

で再実行したところ、無事に gem がインストールされたようです。

+ /opt/axsh/wakame-vdc/ruby/bin/gem install etcd
Successfully installed mixlib-log-1.6.0
Successfully installed etcd-0.3.0
Parsing documentation for mixlib-log-1.6.0
Installing ri documentation for mixlib-log-1.6.0
Parsing documentation for etcd-0.3.0
Installing ri documentation for etcd-0.3.0
2 gems installed
+ /opt/axsh/wakame-vdc/ruby/bin/gem install mixlib-log
Successfully installed mixlib-log-1.6.0
Parsing documentation for mixlib-log-1.6.0
1 gem installed
+ /opt/axsh/wakame-vdc/ruby/bin/gem install rdialog
Successfully installed rdialog-0.5.0
Parsing documentation for rdialog-0.5.0
Installing ri documentation for rdialog-0.5.0
1 gem installed
+ /opt/axsh/wakame-vdc/ruby/bin/gem install net-dhcp
unable to convert "\xDF" from ASCII-8BIT to UTF-8 for lib/net/dhcp/oui.txt, skipping
Successfully installed net-dhcp-1.3.2
Parsing documentation for net-dhcp-1.3.2
Installing ri documentation for net-dhcp-1.3.2
1 gem installed

では明日は作成された ISO ファイルから起動してみます。