2008-12-29
x86 AndroidのUSBブートイメージを作成
※2月27日追記
以下の手順より、こちらの手順の方がわかりやすいと思います。またUSBイメージもこちらからダウンロード出来ます。
$ uname -a Linux dpc2 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux $ gcc --version gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cd $ mkdir cupcake && cd cupcake $ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake $ repo sync $ vi ./.repo/local_manifest.xml <manifest> <project name="platform/vendor/asus/eee_701" path="vendor/asus/eee_701"/> </manifest> $ repo sync $ TARGET_ARCH=x86 TARGET_PRODUCT=eee_701 DISABLE_DEXPREOPT=true make -j2 installer_img
$ cd $ cd cupcake/kernel $ wget http://junkyard.googlecode.com/files/x86_android.dot.config $ cp x86_android.dot.config .config #12/30更新 情報提供 by 通りすがりさん $ make -j2 && make -j2 modules $ sudo make modules_install
- USBイメージの作成
$ cd $ sudo su #以下の作業はrootで $ mount -t ext3 /dev/sdb1 /mnt/usb #ext3でフォーマットしたUSBメモリをマウント $ cp -fr cupcake/out/target/product/eee_701/root/* /mnt/usb/ $ cp -fr out/target/product/eee_701/system/* /mnt/usb/system/ $ cp -fr out/target/product/eee_701/data/* /mnt/usb/data/ $ mkdir /mnt/usb/boot $ mkinitramfs -o /mnt/usb/boot/initrd.img-2.6.27-android 2.6.27-android $ cp cupcake/kernel/arch/x86/boot/bzImage /mnt/usb/boot/vmlinuz-2.6.27-android $ chmod 666 /mnt/usb/system/usr/keylayout/* $ chmod 666 /mnt/usb/system/usr/keychars/* #忘れていたので1/28 追記 $ rm /mnt/usb/system/app/SoftKeyboard.apk #自分の環境では何故かSoftKeyboardがバグって動かないので削除… $ wget http://junkyard.googlecode.com/files/init.rc $ cp init.rc /mnt/usb/
$ cd $ sudo su #以下の作業はrootで $ mkdir /mnt/usb/boot/grub $ grub-install --root-directory=/mnt/usb --no-floppy /dev/sdb #USBメモリにGRUBをインストール $ wget http://junkyard.googlecode.com/files/menu.lst $ cp menu.lst /mnt/usb/boot/grub/
以上の手順で、x86 AndroidのUSBブートイメージを作成できます。
もしブートしない様でしたら、カーネルコンフィグとGRUBの設定を環境に合わせて変更してみてください。(自分はLet's note CF-R6で動作確認をしています)
また、何か不明点やツッコミが御座いましたら気軽にコメント下さい。
トラックバック - http://d.hatena.ne.jp/naka-3/20081229/1230541175
リンク元
- 11 http://groups.google.com/group/android-group-japan/browse_thread/thread/9935ae0bc3cfd6a3
- 10 http://d.hatena.ne.jp/androidzaurus/20081230/1230609355
- 10 http://groups.google.co.jp/group/android-group-japan/browse_thread/thread/9935ae0bc3cfd6a3?hl=ja
- 8 http://d.hatena.ne.jp/androidzaurus/
- 6 http://d.hatena.ne.jp/keyword/Android
- 4 http://b.hatena.ne.jp/bird_dip_jp/
- 3 http://b.hatena.ne.jp/add?mode=confirm&title=x86 Android%u306EUSB%u30D6%u30FC%u30C8%u30A4%u30E1%u30FC%u30B8%u3092%u4F5C%u6210 - Foolish%u306A%u65E5%u3005&url=http://d.hatena.ne.jp/naka-3/20081229/1230541175
- 3 http://bird.dip.jp/mt/archives/2008/12/31/1019.html
- 3 http://d.hatena.ne.jp/androidzaurus/20081230
- 3 http://www.google.co.jp/reader/view/
年末でお忙しいかと思いますが、よろしければ手順と公開していただけないでしょうか
手順はまとめて近日中に公開できればと考えておりますので、
もう少々お待ちください。
どうも、参考になれば幸いです。
もし、手順に何か問題があるようでしたら気軽にコメント下さい。
>androidzaurusさん
Android Zaurusの記事はいつも参考にさせて頂いています。
やっぱソフトキーボード、動かないですよね?実はBeagleBoardでも動いていなくて、
自分もそのうち例外原因を調査しようと思ってるんですが年内は厳しい情勢です…
qemu上でCONFIG_NE2000=yにするとinterfaceにアドレスがついて
net.eth0.dns1などのプロパティも設定されるのですが、vmwareで試してもアドレスが付きませんでした。手動でifconfigするか、dhcpcdを起動して、setprop net.eth0.dns1=...などとすると web browserで外にアクセスできたり、adbdを起動して、ホストからadb shellなどとして接続できたりするようです。
しかし動作はするものの、なぜこういう違いがあるのかはさっぱりわかりません...
... vga=788 androidboot.hardware=eee_701<改行>
このためro.hardwareの値が"eee_701\n"に設定されて
init.eee_701.rcが実行されていませんでした。
この場合/system/etc/init.eee_701.shに書かれた"netcfg eth0 dhcp"が実行されずにeth0が設定されていませんでした。
改行コードを削除すれば良いのですが、viで編集したいので、順番をかえてvga=788を最後にしたところ、問題なくなりました。
結局のところ、CONFIG_PCNET32=yだけでネットワークが使えます。
追加情報、ありがとうございます。
PCNET32って調べてみるとVMware playerの仮想NICが使用するドライバなんですね。
CONFIG_PCNET32=yにしたファイルを更新しておきます。
キーボードでの操作がまともにできていないので、この辺りから調べて行こうと思います。
キーマップを自分の環境に合わせる必要がある場合はandroidzaurusさんの
http://androidzaurus.seesaa.net/article/107106587.html
が便利だと思います。
自分も大変お世話になりました。
自分の環境では何故か普通に動作していたりします。
なので、てっきり環境依存の問題だと思っていたんですが。。。
power.cが無くてきかなくなる問題は、もしかしたら
com.android.server.PowerManagerServiceのコンストラクタで
mUserState = mPowerState = 0;
としている所を
mUserState = mPowerState = SCREEN_ON_BIT;
とすると回避できませんか?
おぉぉぉぉ。効きますね、これ。ビットだけだと気持ち悪いので、finalのSCREEN_BRIGHTを入れてみました。ありがとうございます。
1> Environment
Distros ==> Ubutun-8.04
Laptop ==> IBM/Lenovo R60
Mobile Disk (with usb 2.0) ==> sdb/sdb1/sdb2/sdb3(bootable image with android)
2> Building the full source of android and kernel is both passed
3> Creating a bootable usb with android (most likely with problems)
Upon your step of esablishing a bootable usb, there are some places that are modified as bellow,
a> (original) mount -t ext3 /dev/sdb1 /mnt/usb
(updated) mount -t ext3 /dev/sdb3 /mnt/usb
Furthermore, this set of commands means what, "mkinitramfs -o /mnt/usb/boot/initrd.img-2.6.27-android 2.6.27-android"
4> Making grub for a bootable usb
Under making grub inside a bootable usb, i completely follow these instructions as mentioned above, but if possible, please spell out that "grub-install --root-directory=/mnt/usb --no-floppy /dev/sdb"
5> Checking menu.list
after typing in "cat menu.list" under the directory "/mnt/usb/boot/grub/" and entering, and then show me that information below not modified before,
(original)
title Android
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-android root=/dev/sda1 init=/init rw selinux=0 vga=788 quiet
initrd /boot/initrd.img-2.6.27-android
(updated)
title Android
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-android root=/dev/sda3 init=/init rw selinux=0 vga=788 quiet
initrd /boot/initrd.img-2.6.27-android
5> Rebooting
After ending up finishing the above steps, i shortly reboot my laptop by terminal!! However, i can't go into the android's desk, while still entering into the normal startup with ubutun-8.04!!
6> Feedback
Looking forward to your responses to that!!
>ubuntu 8.10のgccで発生する問題であり、ヘッダーファイルを追加すればよいということが分かりましたが
自分の環境は8.04なのでよくわからないのですが、
その情報のネタ元と、どのようなエラーになるのか教えて頂ければ何か分かるかもしれません。
Hi,Samuel
Please check the boot sequence setting.
Is the First Boot Device a Mobile Disk ?
> please spell out that "grub-install --root-directory=/mnt/usb --no-floppy /dev/sdb"t
In the meaning,the system root is assumed to be /mnt/usb and GRUB is installed on the MBR of /dev/sdb.
as you mentioned, i have got into BIOS and changed the boot priority order in bid to start up from the bootable usb first, as showed below,
(default)
1.USB FDD
2.ATAPI CD0:
3.USB CD:
4.ATA HDD0:
5.PCI LAN:
6.+USB HDD:
7.ATA HDD1:
8.
(updated)
1.+USB HDD:
2.USB FDD
3.ATAPI CD0:
4.USB CD:
5.ATA HDD0:
6.PCI LAN:
7.ATA HDD1:
8.
First of all, i have found out that under the directory of /mnt/usb/boot/grub there is only a file, called "menu.lst", when compared with the normal "grub" that it seems that there's lack of some files, such as "stage1" or "stage2" or other remaining that should be included?
Next, for these contents in the file "menu.lst", if should i modify somewhere i should for showing me a booting menu, as described in the following?
(default)
title Android
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-android root=/dev/sda1 init=/init rw selinux=0 vga=788 quiet
initrd /boot/initrd.img-2.6.27-android
Eventually, associated with these phenomena, reasons of not booting up a bootable usb with android are summarized into the following,
(note that my mobile disk is partitioned into three (or four) parts, sdb | sdb1 | sdb2 | sdb3<--->/mnt/usb)
Q1: never change the boot priority order for an android-specific usb
A1: please double-check the above booting order
Q2: where on earth is "boot" as well as "grub" placed?
A2: please help me double-check it
Q3: can't lead grub after changing the setting of the boot order inside BIOS
A3: please help me double-check it (i have followed those steps as indicated
above.)
Q4: whether to need to modify the setting of menu.lst under the directory
of /mnt/usb/boot/grub or not
A4: please help me double-check it
Please correct me any mistakes!! Many thanks to you and others for helping!!
Would you mind to try this script to make a live image?
http://code.google.com/p/android/issues/detail?id=1598
And android-porting in Google groups has a lot of info and how-to.
http://groups.google.com/group/android-porting?hl=en
IMHO, your questions are nothing related to Android, rather Linux how-to. I guess you are asking help in a wrong place.
Good luck,
Therefore, i really hope that there are any guys that can help me out, especially those problems as described above!!