つpbuilder その2

sh でのパッケージプールメンテナンスにpbuilderを導入する話の続き。
前の実験と違う環境を用意する。今度はkogiidena版をベースにすることにした。

# apt-get install debootstrap
# apt-get install bogosort

うへ、kogidena版にはbogosortがないですよ。
これはebi版から借りてくるか。

# wget http://www.si-linux.co.jp/pub/debian-sh/pool/main/b/bogosort/bogosort_0.4.2-1_sh4.deb
# dpkg -i bogosort_0.4.2-1_sh4.deb

puilderもないか(二度目なので知ってたけどさ)。

# wget http://ftp.debian.org/pool/main/p/pbuilder/pbuilder_0.26_all.deb
# dpkg -i pbuilder_0.26_all.deb
# apt-get install -f
The following extra packages will be installed:
  cpp cpp-3.4 gcc gcc-3.4

kogiidenaさんのアドバイスに従ってテスト。

# pbuilder create --distribution sarge --mirror http://iohack.sourceforge.jp/kogiidena/debian26/
E: Couldn't download gcc-3.0-base
pbuilder: debootstrap failed
 -> cleaning the build env

まぁ、これも変わりなしだな。

# debootstrap --arch sh4 sarge ./ http://iohack.sourceforge.jp/kogiidena/debian26/
E: Couldn't download gcc-3.0-base
E: Couldn't download gcc-3.3-base
E: Couldn't download libstdc++3
E: Couldn't download libstdc++5

# debootstrap --arch sh4 --exclude=gcc-3.0-base,gcc-3.3-base,libstdc++3,libstdc++5 sarge ./ http://iohack.sourceforge.jp/kogiidena/debian26/

このまま結構進む。だいじょぶそうだ。

# pbuilder create ?
         --distribution sarge ?
         --removepackages "gcc-3.0-base gcc-3.3-base libstdc++3 libstdc++5" ?
         --extrapackages "gcc-3.4-base libstdc++6" ?
         --mirror http://iohack.sourceforge.jp/kogiidena/debian26/

E: Couldn't download gcc-3.0-base
pbuilder: debootstrap failed
 -> cleaning the build env

やっぱ、debootstrapのパッケージリストに手を入れるのが楽かな。

/usr/lib/debootstrap/scripts/sarge
        sh*)
            base="$base libstdc++3 gcc-3.0-base"
            base="$(without_package "fdutils" "$base")"
            required="$required libgcc1"
            required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
            ;;

なんで、gcc3.0が必要なのかと思ったら、アーキテクチャのところで指定されているのか。だいぶ前にも見た事あるけど、ここの部分はあいかわらず保守されていないのね。

        sh*)
            base="$(without_package "fdutils" "$base")"
            base="$(without_package "ppp" "$base")"
            base="$(without_package "pppconfig" "$base")"
            base="$(without_package "pppoe" "$base")"
            base="$(without_package "pppoeconf" "$base")"
            required="$required libgcc1 libstdc++6 gcc-3.4-base"
            required="$(without_package "gcc-3.3-base" "$required")"
            required="$(without_package "libstdc++5" "$required")"
            IPFWTOOL="iptables"
            ;;
# pbuilder create ?
         --distribution sarge ?
         --mirror http://iohack.sourceforge.jp/kogiidena/debian26/

無事通ったみたい。

# find /var/cache/pbuilder/
/var/cache/pbuilder/
/var/cache/pbuilder/aptcache
/var/cache/pbuilder/result
/var/cache/pbuilder/build

baseアーカイブできてないし...

I: Base system installed successfully.
umount: /var/cache/pbuilder/build/21274/./dev/pts: not mounted
umount: /var/cache/pbuilder/build/21274/./dev/shm: not mounted
umount: /var/cache/pbuilder/build/21274/./proc/bus/usb: not mounted
 -> debootstrap finished
 -> copying local configuration
  -> Installing apt-lines
Refreshing the base.tgz
 -> upgrading packages
 -> mounting /proc filesystem
Get:1 http://iohack.sourceforge.jp sarge/main Packages [347kB]
Ign http://iohack.sourceforge.jp sarge/main Release
Err http://iohack.sourceforge.jp sarge/contrib Packages
  404 Not Found
Ign http://iohack.sourceforge.jp sarge/contrib Release
Err http://iohack.sourceforge.jp sarge/non-free Packages
  404 Not Found
Ign http://iohack.sourceforge.jp sarge/non-free Release
Fetched 347kB in 6s (57.7kB/s)
Failed to fetch http://iohack.sourceforge.jp/kogiidena/debian26/dists/sarge/contrib/binary-sh4/Packages.gz  404 Not Found
Failed to fetch http://iohack.sourceforge.jp/kogiidena/debian26/dists/sarge/non-free/binary-sh4/Packages.gz  404 Not Found
Reading Package Lists... Done
E: Some index files failed to download, they have been ignored, or old ones used instead.
 -> unmounting /proc filesystem
 -> cleaning the build env

mainだけじゃなくて、その下に、

dists/sarge/contrib/binary-sh4/Packages.gz
dists/sarge/non-free/binary-sh4/Packages.gz

も探しに行って失敗と判断され、アーカイブが生成されていないようだ。

# vi /usr/lib/pbuilder/pbuilder-modules

    if [ -n "$MIRRORSITE" ] ; then
        cat >> "$BUILDPLACE"/etc/apt/sources.list << EOF
deb $MIRRORSITE $DISTRIBUTION main contrib non-free
#deb-src $MIRRORSITE $DISTRIBUTION main contrib non-free
EOF
    fi

とりあえず逃げる。

deb $MIRRORSITE $DISTRIBUTION main
# deb $MIRRORSITE $DISTRIBUTION main contrib non-free

 -> creating base.tgz
 -> cleaning the build env

成功したかな。

# ls -al /var/cache/pbuilder/base.tgz
-rw-r--r--  1 root root 54711566 Apr  9 09:06 /var/cache/pbuilder/base.tgz

まずは、sources.listを書き換えないと。

# pbuilder login
W: /root/.pbuilderrc does not exist
Building the build Environment
 -> extracting base.tgz
 -> mounting /proc filesystem
 -> copying/creating local configuration
hostname: Unknown host

あれ? だめぽ。

# pbuilder login -save-after-login
W: /root/.pbuilderrc does not exist
Building the build Environment
 -> extracting base.tgz
 -> mounting /proc filesystem
 -> copying/creating local configuration
hostname: Unknown host

同じか。
これかな?

# vi /etc/hosts

# pbuilder login -save-after-login
W: /root/.pbuilderrc does not exist
Building the build Environment
 -> extracting base.tgz
 -> mounting /proc filesystem
 -> copying/creating local configuration
 -> entering the shell
rapnzel:/#

おお、きたきた。

# vi /etc/apt/sources.list
deb http://iohack.sourceforge.jp/kogiidena/debian26/ sarge main
deb-src http://ftp.debian.or.jp/debian/ sarge main non-free contrib
deb-src http://ftp.debian.or.jp/debian-non-US sarge/non-US main contrib non-free
# apt-get update
# exit
exit
 -> unmounting /proc filesystem
 -> cleaning the build env

なんか、保存されている感じがしないんだけどな...
確認してみても反映されてないし...
このpbuilderには、そもそも、そんなオプションがないのかな。

# grep save-after /usr/lib/pbuilder/pbuilder-*

なんも出てこない。ないみたいね。
しまつた。リビジョンの桁数に惑わされていた。

# wget http://ftp.debian.org/pool/main/p/pbuilder/pbuilder_0.151_all.deb
# dpkg -i pbuilder_0.151_all.deb

# pbuilder login --save-after-login W: /root/.pbuilderrc does not exist
Building the build Environment
 -> extracting base tarball [/var/cache/pbuilder/base.tgz]
 -> creating local configuration
 -> copying local configuration
 -> mounting /proc filesystem
ln: `/var/cache/pbuilder/build//6814/etc/mtab': File exists
 -> mounting /dev/pts filesystem
 -> installing dummy policy-rc.d
Obtaining the cached apt archive contents
 -> entering the shell
File extracted to: /var/cache/pbuilder/build//6814

rapnzel:/#
# vi /etc/apt/sources.list
# apt-get update
# exit
exit
Copying back the cached apt archive contents
 -> Saving the results, modifications to this session will persist
 -> unmounting dev/pts filesystem
 -> unmounting proc filesystem
 -> creating base tarball [/var/cache/pbuilder/base.tgz]
 -> cleaning the build env
    -> removing directory /var/cache/pbuilder/build//6814 and its subdirectories

できた。

# /usr/share/doc/pbuilder/examples/pbuildd/buildd.sh
/usr/share/doc/pbuilder/examples/pbuildd/buildd.sh: line 65: sudo: command not found
# apt-get install sudo

# /usr/share/doc/pbuilder/examples/pbuildd/buildd.sh
mkdir: cannot create directory `/var/cache/pbuilder/pbuildd//FAILED': File exists
mkdir: cannot create directory `/var/cache/pbuilder/pbuildd//DEPWAIT': File exists
mkdir: cannot create directory `/var/cache/pbuilder/pbuildd//SUCCESS': File exists
mkdir: cannot create directory `/var/cache/pbuilder/pbuildd//WORKING': File exists
mkdir: cannot create directory `/var/cache/pbuilder/pbuildd//STATUS': File exists
mkdir: cannot create directory `/var/cache/pbuilder/pbuildd//FAILED/NOBUILDDEP': File exists
mkdir: cannot create directory `/home/RESULT-deb': File exists
Hit http://eggplant.ddo.jp ./ Packages
Ign http://eggplant.ddo.jp ./ Release
Hit http://ftp.debian.or.jp sarge/main Sources
Hit http://ftp.debian.or.jp sarge/main Release
Hit http://ftp.debian.or.jp sarge/non-free Sources
Hit http://ftp.debian.or.jp sarge/non-free Release
Hit http://ftp.debian.or.jp sarge/contrib Sources
Hit http://ftp.debian.or.jp sarge/contrib Release
Hit http://ftp.debian.or.jp sarge/non-US/main Sources
Hit http://ftp.debian.or.jp sarge/non-US/main Release
Hit http://ftp.debian.or.jp sarge/non-US/contrib Sources
Hit http://ftp.debian.or.jp sarge/non-US/contrib Release
Hit http://ftp.debian.or.jp sarge/non-US/non-free Sources
Hit http://ftp.debian.or.jp sarge/non-US/non-free Release
Reading Package Lists... Done
Merging Available information
Replacing available packages info, using /var/cache/apt/available.
Information about 1743 package(s) was updated.
W: /root/.pbuilderrc does not exist
Building the build Environment
 -> extracting base tarball [/var/cache/pbuilder/base.tgz]
 -> creating local configuration
 -> copying local configuration
 -> mounting /proc filesystem
ln: `/var/cache/pbuilder/build//7253/etc/mtab': File exists
 -> mounting /dev/pts filesystem
 -> policy-rc.d already exists
Refreshing the base.tgz
 -> upgrading packages
Hit http://iohack.sourceforge.jp sarge/main Packages
Ign http://iohack.sourceforge.jp sarge/main Release
Hit http://ftp.debian.or.jp sarge/main Sources
Hit http://ftp.debian.or.jp sarge/main Release
Hit http://ftp.debian.or.jp sarge/non-free Sources
Hit http://ftp.debian.or.jp sarge/non-free Release
Hit http://ftp.debian.or.jp sarge/contrib Sources
Hit http://ftp.debian.or.jp sarge/contrib Release
Hit http://ftp.debian.or.jp sarge/non-US/main Sources
Hit http://ftp.debian.or.jp sarge/non-US/main Release
Hit http://ftp.debian.or.jp sarge/non-US/contrib Sources
Hit http://ftp.debian.or.jp sarge/non-US/contrib Release
Hit http://ftp.debian.or.jp sarge/non-US/non-free Sources
Hit http://ftp.debian.or.jp sarge/non-US/non-free Release
Reading Package Lists... Done
dpkg - warning: ignoring request to remove lilo which isn't installed.
Obtaining the cached apt archive contents
Reading Package Lists... Done
Building Dependency Tree... Done
Calculating Upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading Package Lists... Done
Building Dependency Tree... Done
build-essential is already the newest version.
dpkg-dev is already the newest version.
apt is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Copying back the cached apt archive contents
 -> unmounting dev/pts filesystem
 -> unmounting proc filesystem
 -> creating base tarball [/var/cache/pbuilder/base.tgz]
 -> cleaning the build env
    -> removing directory /var/cache/pbuilder/build//7253 and its subdirectories--11:25:07--  http://ftp.debian.org/debian/dists/unstable/main/source/Sources.gz           => `/tmp/fileeAJkLv'
Resolving ftp.debian.org... 128.101.240.212
Connecting to ftp.debian.org[128.101.240.212]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,558,040 [text/plain]

100%[====================================>] 1,558,040     67.97K/s    ETA 00:00

11:25:31 (66.74 KB/s) - `/tmp/fileeAJkLv' saved [1558040/1558040]

considering opensc

なんか、何もはじまらないですな。
何かしている様子もない。
なんか待ちがはいっているのかな?

# vi /usr/share/doc/pbuilder/examples/pbuildd/buildd.sh

	#    if grep "^$A$" $AVOIDLIST; then
	#       echo Skip.
	#       continue
	#    fi
	
	#    waitingroutine

おお、起動するとなんかやってます。
なんかリストをランダムソートして選んだものをダウンロードして、パッケージできるかどうか調べて実行しているようです。
このランダムソートの部分に何かベストパスのようなものを導入したほうがいいような気もします。
これで少し走らせてみましょうか。