注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

讀萬卷書,行萬里路

开心快乐的方式有很多种,寻找自己的快乐方式

 
 
 

日志

 
 

How to Build CHROOT ARM Ubuntu Images for Android!  

2011-12-21 08:49:46|  分类: 我的网络 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
原帖连接:
1. https://wiki.ubuntu.com/ARM/RootfsFromScratch
2. http://androlinux.com/android-ubuntu-development/how-to-build-chroot-arm-ubuntu-images-for-android/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is for those of you who want to learn how to build your own CHROOT ARM Ubuntu images for Android from scratch.

Why?  For example, perhaps you might want to include certain programs like SSH, Web server, etc…etc… so the Ubuntu image you ultimately end up using on your Android device will not have stuff you don’t want/need.

Also, this is actually a great way to learn about the whole process of running ARM Ubuntu on your Android device whether it be a smartphone or tablet.

How to Build CHROOT ARM Ubuntu images for Android

*Note – This guide will work on all ARM-architectures of Android including TI-OMAP, Samsung Hummingbird, and Qualcomm, so long as they are ARMv7 architecture. (e.g. Nexus One, HTC Evo 4G, Droid X, Droid 2,Samsung Galaxy S, etc…etc…)

1) First, you will need to a Ubuntu system 9.10 (karmic) or later, I used Ubuntu Lucid Lynx 10.4 on my Intel Core i7 desktop. *Actually running that of VirtualBox on my Windows 7 64-bit.

2) Open up a terminal on your Ubuntu system.

3) Let’s make an ARM Ubuntu image using Rootstock command:
sudo rootstock \
--fqdn ubuntu \
--login ubuntu \
--password ubuntu \
--imagesize 4G \
--seed linux-image-omap,build-essential,mysql-server,tightvncserver,lxde,mysql-server-core-5.1,mysql-server-5.1,libmysqlclient16,mysql-common,mysql-client-core-5.1

Here, you can set login/password to your liking, image size, and also different programs you want installed beforehand. You can always use apt-get to install more packages after you CHROOT.

You should end up with a file like armel-rootfs-201101311759.tgz with the datestamp of the time you ran the command.

4) Let’s make an empty image file with command, “dd”:

dd if=/dev/zero of=ubuntu.img bs=1MB count=0 seek=4096

Here, you can change the seek parameter to how big of an image file you want to make. I have it set to 4096, which is 4GB. If you want smaller or larger, change this value accordingly. E.g. 8192 for 8GB.

5) Next, we are going to format the image as ext2/ext3 filesystem so it can be compatible with our Android OS:
mke2fs -F ubuntu.img

6) Next, we will mount the empty image file to directory /mnt:
sudo mount -o loop ubuntu.img /mnt

7) Next, we will uncompress (untar) the ARM image we made earlier into the /mnt directory:
sudo tar -C /mnt -zxf armel-rootfs-200904151837.tgz

8) Once all the files are copied over, we simply unmount the image file and we are ready to rock and roll (or copy it over to your Android device)!
sudo umount /mnt

9) If you have trouble installing software using apt-get after you made this image, try installing it under CHROOT on your Ubuntu (not Android) by using QEMU user mode emulation.

References


ARM RootfsFromScratch – This is a great place to start on learning to build ARM Ubuntu images for Android.   Just make sure to use “mke2fs” instead of “mkfs.ext4″ as Android currently doesn’t support ext4 file system type (as far as I know and I’ve tried).

  评论这张
 
阅读(1284)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017