Ubuntu TVやってみる(1) Linaro Ubuntuの導入

なんか、まともに動くようになってきたというので入れてみる。
まずは、Linaro版のUbuntuを入れないと。

Linaro Ubuntuのユーザーランドとハードウエアパックのダウンロード

Ubuntuのビルド済みのユーザーランドと、ボード専用のドライバ類などの差分を納めたハードウエアパックをダウンロードします。
linaroの配布物には、pandaとleb-pandaの二種類があります。
"panda"の方はUpstream用でソフトウェアグラフィックを使用し、"leb-panda"はハードウェアグラフィックを使用するものです。
pandaのほうはここ。
http://releases.linaro.org/platform/linaro-n/ubuntu-desktop/11.09/
leb版はここ。
http://releases.linaro.org/platform/linaro-n/ubuntu/leb-panda/11.09/
TVには、ハードウエアアクセラレーションが必須ですので、leb版を入れます。
ユーザーランドを落とします。
468MBありました。

kinneko@BuildSV:~$ mkdir linaro-panda
kinneko@BuildSV:~$ cd linaro-panda/
kinneko@BuildSV:~/linaro-panda$ wget http://releases.linaro.org/platform/linaro-n/ubuntu/leb-panda/11.09/linaro-n-ubuntu-desktop-tar-20110929-1.tar.gz

ハードウエアパックを落とします。
67MBありました。

kinneko@BuildSV:~/linaro-panda$ wget http://releases.linaro.org/platform/linaro-n/ubuntu/leb-panda/11.09/hwpack_linaro-lt-panda-x11-base_20110929-1_armel_supported.tar.gz

linaro-image-toolsのダウンロード

インストールなどを楽にしてくれるユーティリティ、linaro-image-toolsが用意されているので、それもダウンロードします。

kinneko@BuildSV:~/linaro-panda$ sudo add-apt-repository ppa:linaro-maintainers/tools
kinneko@BuildSV:~/linaro-panda$ sudo apt-get update
kinneko@BuildSV:~/linaro-panda$ sudo apt-get install linaro-image-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  btrfs-tools debootstrap libwxbase2.8-0 libwxgtk2.8-0 libyaml-0-2
  python-beautifulsoup python-linaro-image-tools python-parted python-wxgtk2.8
  python-wxversion python-yaml qemu-user-static
Suggested packages:
  libgnomeprintui2.2-0 wx2.8-doc wx2.8-examples python-wxtools ruby tcsh csh
  octave3.0 mksh pdksh python-xml editra
The following NEW packages will be installed:
  btrfs-tools debootstrap libwxbase2.8-0 libwxgtk2.8-0 libyaml-0-2
  linaro-image-tools python-beautifulsoup python-linaro-image-tools
  python-parted python-wxgtk2.8 python-wxversion python-yaml qemu-user-static
0 upgraded, 13 newly installed, 0 to remove and 272 not upgraded.
Need to get 30.2 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Do you want to continue [Y/n]? 
(snip)

ツールはPythonで書かれているようです。
wxgtkが依存でインストールされているので、GUIもあるのでしょうか。

起動メディアの作成

インストールに使用するSD Cardを用意します。
ちょっと遅いですが、手持ちのClass4のmicroSDをUSBカードリーダー経由で使用します。

kinneko@BuildSV:~/linaro-panda$ sudo linaro-media-create --mmc /dev/sdb --dev panda --hwpack hwpack_linaro-lt-panda-x11-base_20110929-1_armel_supported.tar.gz --binary linaro-n-ubuntu-desktop-tar-20110929-1.tar.gz

I see...
Device           Mount point      Size
/dev/sda         none             953869MB
/dev/sda1        /                941589MB
/dev/sda2        none             12278MB
/dev/sda5        none             12278MB
/dev/sdb         none             3849MB
/dev/sdb1        none             3845MB
/dev/sr0         none             0MB
Are you 100% sure, on selecting [/dev/sdb] (y/n)? y

途中、ドライブの確認が表示されます。

------------------------------------------------------------
Installing (linaro-hwpack-install) hwpack_linaro-lt-panda-x11-base_20110929-1_armel_supported.tar.gz in target rootfs.
Unpacking hardware pack ...Done
Updating apt package lists ...
Ign file: ./ InRelease
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign file: ./ Translation-en
Ign http://ppa.launchpad.net natty InRelease
Get:1 http://ppa.launchpad.net natty Release.gpg [316 B]
Ign http://ports.ubuntu.com natty InRelease
Ign http://ports.ubuntu.com natty-security InRelease
Ign http://ports.ubuntu.com natty-updates InRelease
Ign http://ports.ubuntu.com natty-security InRelease
Ign http://ports.ubuntu.com natty InRelease
Ign http://ports.ubuntu.com natty-updates InRelease
Hit http://ports.ubuntu.com natty Release.gpg
Get:2 http://ports.ubuntu.com natty-security Release.gpg [198 B]
Get:3 http://ppa.launchpad.net natty Release [9753 B]
Get:4 http://ports.ubuntu.com natty-updates Release.gpg [198 B]
Get:5 http://ports.ubuntu.com natty-security Release.gpg [198 B]
Get:6 http://ports.ubuntu.com natty Release.gpg [198 B]
Get:7 http://ports.ubuntu.com natty-updates Release.gpg [198 B]
Hit http://ports.ubuntu.com natty Release
Get:8 http://ports.ubuntu.com natty-security Release [39.8 kB]
Get:9 http://ppa.launchpad.net natty/main armel Packages [38.6 kB]
Get:10 http://ports.ubuntu.com natty-updates Release [39.8 kB]
Get:11 http://ports.ubuntu.com natty-security Release [39.8 kB]
Get:12 http://ports.ubuntu.com natty Release [39.8 kB]
Get:13 http://ports.ubuntu.com natty-updates Release [39.8 kB]
Ign http://ppa.launchpad.net natty/main TranslationIndex
Hit http://ports.ubuntu.com natty/main armel Packages
Hit http://ports.ubuntu.com natty/universe armel Packages
Ign http://ports.ubuntu.com natty/main TranslationIndex
Ign http://ports.ubuntu.com natty/universe TranslationIndex
Get:14 http://ports.ubuntu.com natty-security/main armel Packages [259 kB]
Ign http://ppa.launchpad.net natty/main Translation-en
Get:15 http://ports.ubuntu.com natty-security/universe armel Packages [61.2 kB]
Ign http://ports.ubuntu.com natty-security/main TranslationIndex
Ign http://ports.ubuntu.com natty-security/universe TranslationIndex
Get:16 http://ports.ubuntu.com natty-updates/main armel Packages [416 kB]
Get:17 http://ports.ubuntu.com natty-updates/universe armel Packages [119 kB]
Ign http://ports.ubuntu.com natty-updates/main TranslationIndex
Ign http://ports.ubuntu.com natty-updates/universe TranslationIndex
Get:18 http://ports.ubuntu.com natty-security/main armel Packages [259 kB]
Get:19 http://ports.ubuntu.com natty-security/universe armel Packages [61.2 kB]
Ign http://ports.ubuntu.com natty-security/main TranslationIndex
Ign http://ports.ubuntu.com natty-security/universe TranslationIndex
Get:20 http://ports.ubuntu.com natty/main armel Packages [1528 kB]
Get:21 http://ports.ubuntu.com natty/universe armel Packages [5867 kB]
Ign http://ports.ubuntu.com natty/main TranslationIndex
Ign http://ports.ubuntu.com natty/universe TranslationIndex
Get:22 http://ports.ubuntu.com natty-updates/main armel Packages [416 kB]
Get:23 http://ports.ubuntu.com natty-updates/universe armel Packages [119 kB]
Ign http://ports.ubuntu.com natty-updates/main TranslationIndex
Ign http://ports.ubuntu.com natty-updates/universe TranslationIndex
Ign http://ports.ubuntu.com natty/main Translation-en
Ign http://ports.ubuntu.com natty/universe Translation-en
Ign http://ports.ubuntu.com natty-security/main Translation-en
Ign http://ports.ubuntu.com natty-security/universe Translation-en
Ign http://ports.ubuntu.com natty-updates/main Translation-en
Ign http://ports.ubuntu.com natty-updates/universe Translation-en
Ign http://ports.ubuntu.com natty-security/main Translation-en
Ign http://ports.ubuntu.com natty-security/universe Translation-en
Ign http://ports.ubuntu.com natty/main Translation-en
Ign http://ports.ubuntu.com natty/universe Translation-en
Ign http://ports.ubuntu.com natty-updates/main Translation-en
Ign http://ports.ubuntu.com natty-updates/universe Translation-en
Fetched 9352 kB in 33s (282 kB/s)
Reading package lists...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  linux-headers-2.6-686 linux-headers-2.6-amd64 linux-headers-generic
  linux-headers linux-image
The following packages will be REMOVED:
  libegl1-mesa libegl1-mesa-drivers libgles2-mesa
The following NEW packages will be installed:
  devio dkms dos2unix flash-kernel hwpack-linaro-lt-panda-x11-base
  libegl1-sgx-omap4 libgles1-sgx-omap4 libgles2-sgx-omap4 libopenvg1-sgx-omap4
  linux-firmware linux-headers-2.6.38-10 linux-headers-3.0.0-1404
  linux-headers-3.0.0-1404-linaro-lt-omap linux-headers-linaro-lt-omap
  linux-image-3.0.0-1404-linaro-lt-omap linux-image-linaro-lt-omap
  powervr-omap4-dkms pvr-omap4 pvr-omap4-data u-boot-tools uboot-mkimage
  wireless-crda
The following packages will be upgraded:
  binutils cpp cpp-4.5 fakeroot gcc gcc-4.5 grep libc-dev-bin libc6-dev
  libcloog-ppl0 libelfg0 libgmpxx4ldbl libgomp1 libmpc2 libmpfr4 libppl-c2
  libppl7 linux-libc-dev make manpages manpages-dev patch
22 upgraded, 22 newly installed, 3 to remove and 83 not upgraded.
Need to get 0 B/70.0 MB of archives.
After this operation, 52.6 MB disk space will be freed.
Do you want to continue [Y/n]? y

どうやら、落としたアーカイブには全てが含まれているわけではなさそうです。
armelで、debootstrapしています。

WARNING: The following packages cannot be authenticated!
  libgmpxx4ldbl libppl7 libppl-c2 libcloog-ppl0 libelfg0 libmpfr4 libmpc2
  cpp-4.5 cpp binutils libgomp1 gcc-4.5 gcc make patch dkms grep dos2unix
  linux-headers-3.0.0-1404 linux-headers-3.0.0-1404-linaro-lt-omap
  linux-headers-linaro-lt-omap powervr-omap4-dkms pvr-omap4-data pvr-omap4
  libegl1-sgx-omap4 libgles2-sgx-omap4 wireless-crda
  linux-image-3.0.0-1404-linaro-lt-omap devio fakeroot flash-kernel
  linux-firmware linux-image-linaro-lt-omap libgles1-sgx-omap4
  libopenvg1-sgx-omap4 hwpack-linaro-lt-panda-x11-base libc-dev-bin
  linux-libc-dev libc6-dev linux-headers-2.6.38-10 manpages manpages-dev
  u-boot-tools uboot-mkimage
Install these packages without verification [y/N]? y

無署名のパッケージを入れるかどうかの確認をしてきます。
これは、linaroの配布物に含まれていたものでしょうか。

Extracting templates from packages: 100%
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 116781 files and directories currently installed.)
Preparing to replace libgmpxx4ldbl 2:4.3.2+dfsg-1ubuntu3 (using .../libgmpxx4ldbl_4.3.2+dfsg-1ubuntu3_armel.deb) ...
(snip)

パッケージを順次インストールしています。

Setting up powervr-omap4-dkms (1.7.5.2+git20110610+9696932c-1linaro2) ...
Loading new powervr-omap4-1.7.5.2+git20110610+9696932c DKMS files...
First Installation: checking all kernels...
dpkg: error: version '*-*' has bad syntax: version number does not start with digit
It is likely that 2.6.38-8-generic belongs to a chroot's host
Building for architecture armel
Building initial module for 2.6.38-1209-omap4

Error! Bad return status for module build on kernel: 2.6.38-1209-omap4 (armel)
Consult the make.log in the build directory
/var/lib/dkms/powervr-omap4/1.7.5.2+git20110610+9696932c/build/ for more information.
(snip)

セルフビルドではないので、作業中のkernelとモジュールバージョンの違いでエラーが出ていますが、気にしないで進めます。

linux-headers-2.6.38-10 set to automatically installed.
Done
Cleaning up ...Done
------------------------------------------------------------
proc umounted
Checking that no-one is using this disk right now ...
OK
partition ends on cylinder 1023, beyond the end of the disk
Warning: partition 1 does not end at a cylinder boundary
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)

Formating boot partition

mkfs.vfat 3.0.9 (31 Jan 2010)

Formating root partition

mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=rootfs
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
243360 inodes, 972032 blocks
48601 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=998244352
30 block groups
32768 blocks per group, 32768 fragments per group
8112 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
`/tmp/tmpFbmTKT/u-boot/u-boot.img' -> `/tmp/tmp1JztPd/boot-disc/u-boot.img'
Will use kernel=/tmp/tmp1JztPd/binary/boot/vmlinuz-3.0.0-1404-linaro-lt-omap, initrd=/tmp/tmp1JztPd/binary/boot/initrd.img-3.0.0-1404-linaro-lt-omap, dtb=/tmp/tmp1JztPd/binary/boot/dt-3.0.0-1404-linaro-lt-omap/omap4-panda.dtb.
Copying spl '/tmp/tmpm_vSDq/spl/MLO' to boot partition.
`/tmp/tmpm_vSDq/spl/MLO' -> `/tmp/tmp1JztPd/boot-disc/MLO'
Image Name:   Linux
Created:      Fri Jan 20 15:18:05 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    5078984 Bytes = 4959.95 kB = 4.84 MB
Load Address: 80008000
Entry Point:  80008000
Image Name:   initramfs
Created:      Fri Jan 20 15:18:06 2012
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    2218421 Bytes = 2166.43 kB = 2.12 MB
Load Address: 00000000
Entry Point:  00000000
Image Name:   boot script
Created:      Fri Jan 20 15:18:07 2012
Image Type:   ARM Linux Script (uncompressed)
Data Size:    450 Bytes = 0.44 kB = 0.00 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
   Image 0: 442 Bytes = 0.43 kB = 0.00 MB
`/tmp/tmp1JztPd/boot-disc/boot.scr' -> `/tmp/tmp1JztPd/boot-disc/boot.ini'

Populating rootfs partition
Be patient, this may take a few minutes

SDカードをフォーマットして、ファイルをコピーしています。
ここでしばらく何も表示されません。

Creating /etc/flash-kernel.conf


Updating /etc/network/interfaces

Done creating Linaro image on /dev/sdb

できあがりました。
作業時間は22分程度でした。

作成したSD Cardの内容を調べる

パーティションは、以下のようになっていました。

kinneko@BuildSV:~/linaro-panda$ sudo fdisk -l /dev/sdb

Disk /dev/sdb: 4035 MB, 4035969024 bytes
125 heads, 62 sectors/track, 1017 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001bf5a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          14       53216    c  W95 FAT32 (LBA)
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 1, 32) logical=(0, 1, 2)
Partition 1 has different physical/logical endings:
     phys=(25, 127, 31) logical=(13, 92, 41)
Partition 1 does not end on cylinder boundary.
/dev/sdb2              14        1018     3888128   83  Linux
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(26, 0, 1) logical=(13, 92, 43)
Partition 2 has different physical/logical endings:
     phys=(1023, 127, 32) logical=(1017, 16, 10)
Partition 2 does not end on cylinder boundary.

sdb1の内容は以下でした。普通です。

kinneko@BuildSV:~/linaro-panda$ sudo mount /dev/sdb1 /media
kinneko@BuildSV:~/linaro-panda$ ls -al /media/
total 7409
drwxr-xr-x  2 root root     512 Jan  1  1970 .
drwxr-xr-x 25 root root    4096 Nov 28 18:10 ..
-rwxr-xr-x  1 root root   34436 Jan 21 15:18 MLO
-rwxr-xr-x  1 root root     340 Jan 21 15:18 board.dtb
-rwxr-xr-x  1 root root     514 Jan 21 15:18 boot.ini
-rwxr-xr-x  1 root root     514 Jan 21 15:18 boot.scr
-rwxr-xr-x  1 root root     442 Jan 21 15:18 boot.txt
-rwxr-xr-x  1 root root  245872 Jan 21 15:18 u-boot.img
-rwxr-xr-x  1 root root 5079048 Jan 21 15:18 uImage
-rwxr-xr-x  1 root root 2218485 Jan 21 15:18 uInitrd
kinneko@BuildSV:~/linaro-panda$ sudo umount /media/

sdb2の内容は以下でした。

kinneko@BuildSV:~/linaro-panda$ sudo mount /dev/sdb2 /media
kinneko@BuildSV:~/linaro-panda$ ls -al /media/
total 6624
drwxr-xr-x  22 root root    4096 Jan 21 15:24 .
drwxr-xr-x  25 root root    4096 Nov 28 18:10 ..
drwxr-xr-x   2 root root    4096 Sep 29 19:30 .disk
drwxr-xr-x   2 root root    4096 Jan 21 15:10 bin
drwxr-xr-x   3 root root    4096 Jan 21 15:16 boot
drwxr-xr-x   4 root root    4096 Sep 29 18:51 dev
drwxr-xr-x 130 root root    4096 Jan 21 15:24 etc
drwxr-xr-x   3 root root    4096 Sep 29 19:28 home
lrwxrwxrwx   1 root root      41 Jan 21 15:16 initrd.img -> boot/initrd.img-3.0.0-1404-linaro-lt-omap
drwxr-xr-x  19 root root    4096 Jan 21 15:11 lib
drwx------   2 root root   16384 Jan 21 15:17 lost+found
-rw-r--r--   1 root root 6679646 Sep 29 19:36 md5sum.txt
drwxr-xr-x   2 root root    4096 Sep 29 18:44 media
drwxr-xr-x   2 root root    4096 Apr 22  2011 mnt
drwxr-xr-x   2 root root    4096 Sep 29 18:44 opt
drwxr-xr-x   2 root root    4096 Apr 22  2011 proc
drwx------   2 root root    4096 Sep 29 19:28 root
drwxr-xr-x   2 root root    4096 Jan 21 15:13 sbin
drwxr-xr-x   2 root root    4096 Mar 21  2011 selinux
drwxr-xr-x   2 root root    4096 Sep 29 18:44 srv
drwxr-xr-x   2 root root    4096 Mar 29  2011 sys
drwxrwxrwt   2 root root    4096 Jan 21 15:17 tmp
drwxr-xr-x  10 root root    4096 Sep 29 18:44 usr
drwxr-xr-x  15 root root    4096 Sep 29 18:38 var
lrwxrwxrwx   1 root root      38 Jan 21 15:16 vmlinuz -> boot/vmlinuz-3.0.0-1404-linaro-lt-omap
kinneko@BuildSV:~/linaro-panda$ sudo umount /media/

起動テスト

作成したメディアの起動テストを行います。
PandaboardにSD Cardを挿して、HDMI側にディスプレイを接続し、起動します。
ボードの角側がHDMIで、NIC側がDVIです。


モニタがいけないのか、スクエアディスプレイでDVI変換では表示ができませんでした... orz
NICはupしていますし、アクセスLEDは光っているので、起動はしているようです。
シリアルはつなげていないので、状態はわかりません。


さらに細かい情報が必要な場合はこちらを参照してください。
http://wiki.linaro.org/Platform/DevPlatform/Ubuntu/ImageInstallation