port-ubuntu

 

port_ubuntu

Ubuntu on ARM

The web http://www.ubuntu.org.cn/products/whatisubuntu/arm/introduces Ubuntu on ARM.'

Other Soc company, example Mavell, TI,Freescaleis referred to web below:

 http://www.ubuntu.org.cn/products/whatisubuntu/arm/

The main topic is on the web below:

 https://wiki.ubuntu.com/ARM/RootfsFromScratch

OMAP Ubuntu Main

 http://www.omappedia.org/wiki/OMAP_Ubuntu_Main

Using rootstock

 Rootstockwill automate the creation of a rootfs tarball and exposes some config options to tweak the contents/setup.

First run rootstock to create your rootfs (check ARM/RootStockfor more info about rootstock).

If you're running Ubuntu 9.10 (karmic) or later, you just need to install the rootstock package and it will pull the appropriate dependencies.

Run “sudo apt-get install rootstock” on the terminal. It will install in /usr/bin/rootstock.

If you install rootstock manually or if you are running it from a bzr checkout, you will also need:

qemu (see Installation/QemuEmulator) Arm version is Cortex-A8 in default.

a recent debootstrap: debootstrap_1.0.10ubuntu3_all.deb or newer

To create an armel rootfs tarball of, for instance, xubuntu-desktop:

  $ sudo rootstock \

  --fqdn myhostname \

  --login ubuntu \

  --password temppwd \

  --imagesize 2G \

  --seed xubuntu-desktop

Here's another example for ubuntu-desktop:

   $ sudo rootstock \

  --fqdn ubuntu \

  --login ubuntu \

  --password ubuntu \

  --imagesize 3G \

  --seed ubuntu-desktop

Some typical flags when developing headless (connecting over the network):

--seed build-essential,openssh-server

Note that you should edit /etc/network/interfaces and set up your network device on first login for this.

If you want a really light desktop (lxde), use:

--seed lxde,gdm

The options --fqdn (or -f), --login (or -l) and --password (-p) are required for the initial setup. Calling the script with --help shows you all the additional options that can be used to change the setup of the created rootfs.

Building a root filesystem image instead of a tarball

In case you just need a root filesystem for use with qemu and you don't want a rootfs tarball, e.g. for usage with qemu, pass --notarball to rootstock:

  $sudo rootstock --fqdn qemu-test \

  --login qemu \

  --password qemupwd \

  --notarball

You can also create a root filesystem from a tarball as follows:

Create the blank image file using dd; this example creates a 1GB image; use seek=3072 for 3GB or seek=2048 for 2GB etc.:

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

Create linux filesystem on the newly created image:

  mkfs.ext4 -F ubuntu-arm.img

(You might want to pass some extra flags to mkfs to tweak the reserved blocks, labels, or other filesystem options.)

Loop mount the new image:

  sudo mount -o loop ubuntu-arm.img /mnt

Extract the rootfs tarball inside the mounted dir and umount:

  $ sudo tar -C /mnt -zxf armel-rootfs-200904151837.tgz

    sudo umount /mnt

Now you are set and ready to use the ubuntu-arm.img.

Please run “sudo ./rootstock –help” if you don’t understand how to use the shell.

Example: Option is following.

-d --dist (jaunty, karmic, lucid or maverick)

Specify Release to build

(default version is dependent on your local PC version).

-i --imagesize <size>M/G

Size of the target filesystem to be created (i.e. 500M)(default: 1G).

--serial <devicename>

Create a serial tty of <devicename> inside the rootfs for login (i.e. ttyS0)

In default the serial port only output the message.

--kernel-image <http url to kernel .deb>

install board specfic kernel package from http accessible deb package inside rootfs.

Take care

1. Rootstock version 0.1.99.3 has bug so you had better upgrade to 0.1.99.4. If you use Ubuntu version after 10.10(Maverick) it will install 0.1.99.4 automatically.

2. Ubuntu Jaunty can build for armv5, Karmic for armv6, Lucid(10,04) for armv7( thumb 2), Maverick(10.10) for armv7( thumb 2), Natty (11.04) for armv7(thumb2). Oneiric(11.10).

3. Option –seed can be Xubuntu-desktop[xfce], Kubuntu-desktop[KDE], ubuntu-desktop[GNOME], ubuntu-netbook. But if option –seed is ubuntu-netbook you run “sudo apt-get install ubuntu-netbook”.

4. On my PC I can only build –seed lxde,gdm. Others does not success. It is bug for building Arm Ubuntu.

5. When you run the img of rootfs you build you may see “ureadhead …… “on the serial port, you can run “sudo mv /etc/init/ureadhead.conf /etc/init/ureadhead.conf.disable” in your rootfs on your PC.

6. When you meet “could not update ……”, you can chown root:root the file you just meet.

7. The size of SD card is more then 4G for storing rootfs. So you had better change flash.sh to 2G for rootfs.

8. You must select lxde before you enter the system ubuntu in the bottom on your board if you build option –seed lxde, gdm.

9. When you tar your rootfs img you must run by sudo.

10. Copy our module to your lib/modules in your rootfs. Run sudo cp –ra 2.6.38-sirf+ your rootfs lib/modules.

11. I have build rootfs in the option –seed lxde,gdm in 8G SD card. The password is ubuntu.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以使用Packer来创建一个基于Ubuntu的机器映像。通过定义一个Packer模板,你可以指定要使用的操作系统、软件包和配置。以下是一个示例的Packer模板,用于创建一个Ubuntu 20.04的机器映像: ```json { "builders": [ { "type": "qemu", "accelerator": "kvm", "iso_url": "https://releases.ubuntu.com/20.04/ubuntu-20.04.3-live-server-amd64.iso", "iso_checksum": "sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "iso_checksum_type": "sha256", "boot_wait": "5s", "ssh_username": "ubuntu", "ssh_password": "ubuntu", "ssh_port": 22, "ssh_wait_timeout": "10m", "format": "qcow2", "output_directory": "output-qemu", "disk_size": 10000 } ], "provisioners": [ { "type": "shell", "inline": [ "echo 'provisioning script'" ] } ] } ``` 在这个示例中,我们使用qemu builder来创建一个基于QEMU虚拟化的机器映像。我们指定了Ubuntu 20.04的ISO镜像地址和校验和,以及SSH连接所需的用户名和密码。在`provisioners`部分,你可以添加一些自定义的脚本或命令来进行进一步的配置。 请注意替换`iso_url`中的URL和`iso_checksum`中的校验和为你所需的Ubuntu版本的实际值。 完成配置后,你可以运行以下命令来生成机器映像: ``` $ packer build ubuntu.json ``` 这将启动Packer创建一个基于Ubuntu的机器映像。生成的机器映像将保存在`output-qemu`目录下。 这只是一个简单的示例,你可以根据自己的需求进行更复杂的配置和定制。更多关于Packer的信息可以在Packer官方文档中找到。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值