lost and found ( for me ? )

How to build Chromium OS n’ fly that w/ VMware Player

root@hat1:~# cat /etc/lsb-release | tail -1
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

root@hat1:~# uname -a
Linux hat1 2.6.32-24-server #43-Ubuntu SMP Thu Sep 16 16:05:42 UTC 2010 x86_64 GNU/Linux

root@hat1:~# cat /proc/cpuinfo | grep "model name" | uniq
model name      : AMD Phenom(tm) II X4 925 Processor

[ 必要なツールをインストール ]

install-build-deps.sh ( Utuntu専用 ) を使用すると自動で必要なツールをインストールしてくれる。

hattori@hat1:~$ sudo apt-get install subversion
hattori@hat1:~$ sudo apt-get install git-core

hattori@hat1:~$ wget http://src.chromium.org/svn/trunk/src/build/install-build-deps.sh
hattori@hat1:~$ sudo sh install-build-deps.sh

hattori@hat1:~$ svn co http://src.chromium.org/svn/trunk/tools/depot_tools
hattori@hat1:~$ export PATH=`pwd`/depot_tools:"$PATH"

hattori@hat1:~$ pwd
/home/hattori
hattori@hat1:~$ gclient config http://src.chromium.org/git/chromiumos.git

.glient というファイルができる。

hattori@hat1:~$ cat .gclient
solutions = [
 { "name"        : "chromiumos.git",
   "url"         : "http://src.chromium.org/git/chromiumos.git",
   "custom_deps" : {
   },
   "safesync_url": "",
 },
]

エラーになるなー。

hattori@hat1:~$ gclient sync
Syncing projects:   3% (3/94)

________ running 'git clone -b master http://src.chromium.org/git/crosutils.git /home/hattori/chromiumos.git/src/scripts' in '/home/hattori'
Initialized empty Git repository in /home/hattori/chromiumos.git/src/scripts/.git/
error: RPC failed; result=22, HTTP code = 502

gclient あきらめー。

repo でソースをゲット。

http://www.chromium.org/chromium-os/building-chromium-os/using-cros_workon#TOC-Get-the-Source

repo 、、gclient の置き換わりらしい。

--
We are using repo as our new repository overlay tool. repo is used to checkout multiple repositories and sync them. It replaces the functionality that was previously provided by gclient.
--

hattori@hat1:~$ repo init -u http://git.chromium.org/git/manifest -m minilayout.xml

1時間以上かかる。。

hattori@hat1:~$  repo sync

Initializing project chromiumos ...
remote: Counting objects: 22034, done.
remote: Compressing objects: 100% (10389/10389), done.

* [new tag]         0.8.72.3   -> 0.8.72.3
Fetching projects: 100% (8/8), done.
Checking out files: 100% (1102/1102), done.
Checking out files: 100% (89225/89225), done.iles:  26% (23725/89225)
Syncing work tree: 100% (8/8), done.

hattori@hat1:~$

src ディレクトリができる。

hattori@hat1:~$ cd src/scripts/
hattori@hat1:~/src/scripts$ ./make_chroot --replace

hattori@hat1:~/src/scripts$ ./enter_chroot.sh
INFO   : Mounting chroot environment.
INFO   : Not mounting chrome source
INFO   : Mounting depot_tools
INFO   : mounting ~/.subversion into chroot
(cros-chroot) hattori@hat1 ~/trunk/src/scripts $

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./setup_board --board=x86-generic --default

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./build_packages

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./build_image
Elapsed time: 5m54s
To copy to USB keyfob, OUTSIDE the chroot, do something like:
 ./image_to_usb.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --to=/dev/sdX
To convert to VMWare image, INSIDE the chroot, do something like:
 ./image_to_vm.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --board=x86-generic
from the scripts directory where you entered the chroot.

イメージができた

(cros-chroot) hattori@hat1 ~/trunk/src/build/images/x86-generic/0.8.73.2010_09_2
4_2053-a1 $ pwd
/home/hattori/trunk/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1

(cros-chroot) hattori@hat1 ~/trunk/src/build/images/x86-generic/0.8.73.2010_09_2
4_2053-a1 $ ls
boot.config                chromiumos_image.bin  unpack_partitions.sh
boot.desc                  config.txt
chromiumos_base_image.bin  pack_partitions.sh

vmdk イメージの作成

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./image_to_vm.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --board=x86-generic --make_vmx --format vmware --vmdk chromium_os_x86-generic.vmdk --vmx chromium_os_x86-generic.vmx

エラーが・

Creating final image
./image_to_vm.sh: line 254: qemu-img: command not found
(cros-chroot) hattori@hat1 ~/trunk/src/scripts $

qemu-img をインストール。

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ sudo emerge app-emulation/qemu-softmmu

再度トライ。

(cros-chroot) hattori@hat1 ~/trunk/src/scripts $ ./image_to_vm.sh --from=../build/images/x86-generic/0.8.73.2010_09_24_2053-a1 --board=x86-generic --make_vmx --format vmware --vmdk chromium_os_x86-generic.vmdk --vmx chromium_os_x86-generic.vmx

Wrote the following config to: /home/hattori/trunk/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1/chromium_os_x86-generic.vmx
#!/usr/bin/vmware
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "4"
memsize = "1024"
ide0:0.present = "TRUE"
ide0:0.fileName = "chromium_os_x86-generic.vmdk"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Chromium OS"
guestOS = "otherlinux"
ethernet0.addressType = "generated"
floppy0.present = "FALSE"
(cros-chroot) hattori@hat1 ~/trunk/src/scripts $

vmx , vmdk ファイルができた。

4_2053-a1 $ pwd
/home/hattori/trunk/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1

(cros-chroot) hattori@hat1 ~/trunk/src/build/images/x86-generic/0.8.73.2010_09_2
4_2053-a1 $ ls *.vm*
chromium_os_x86-generic.vmdk  chromium_os_x86-generic.vmx

chroot からぬけて、上記をコピー。

hattori@hat1:~/src/build/images/x86-generic/0.8.73.2010_09_24_2053-a1$ cp *.vm* /home/hattori/

hattori@hat1:~$ pwd
/home/hattori
hattori@hat1:~$ ls *.vm*
chromium_os_x86-generic.vmdk  chromium_os_x86-generic.vmx

vmware player で起動。

起動したー


日本語も入力できた ^_^ 。ちょっとだけさわった印象は、、Chrome ブラウザだ。。


えーと shutdown は、、

Ctrl + Alt + T でコマンドラインモードに。


rootになって、shutdown -h now 。
root になるには、sudo su

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.