How to get the Ubuntu distribution
From IGEP - ISEE Wiki
Contents
How to get the Ubuntu distribution
The Ubuntu project is excited to be working with the ARM ecosystem to port Ubuntu for ARM-based devices. This work fits with our goals of making Ubuntu available as an open platform to as many people as possible. Some points to note:
- Ubuntu will target the new ARM EABI.
- For now, builds will expect a minimum of an ARMv5 instruction set.
- Ubuntu will target ARM with VFP (Vector Floating Point).
- We will continue to work with vendors to provide hardware drivers for various ARM-based devices.
- Ubuntu will likely have a different set of kernels than Debian (although the specific set is still under discussion).
Overview of How-To
This How-To is meant to be a starting point for people to learn install an Ubuntu image for OMAP3-based IGEP platforms as quickly and easily as possible.
Unless otherwise noted, this How-To works with the Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine but most of the contents are valid also for other GNU/Linux distributions. We do not issue any guarantee that this will work on other distributions.
This How-To will start out by a Make a bootable MMC card on Linux.
And then, we will cover the Getting a copy of a ubuntu root file system for various Ubuntu releases. These should give you a good basis overview of creating an ubuntu-based ARM root filesystem.
Requirements
- A SD card at least 2GB ( recommended 4GB )
Feedback and Contributing
Creating articles in the wiki is a collaborative process, at any point, if you see a mistake you can contribute to this article.
Please, use the discussion tab for user comments. This is useful to separate page content and the discussion thereof and also, if you don't want to give normal users the right to edit the page but still want user contributed notes.
Editing permissions are restricted to registered users. Register in the main IGEP site and you will have single sign-on.
Consult the User's Guide for information on using the wiki software.
References
Much of this How-To is extracted from different sources. If you would like to read some of the original articles or resources, please visit them and thank the authors:
- The Ubuntu website ( http://www.ubuntu.com )
- Ubuntu on ARM ( http://www.ubuntu.com/products/whatisubuntu/arm )
- The rootstock project ( https://launchpad.net/project-rootstock )
- ARM rootfs from scratch ( https://wiki.ubuntu.com/ARM/RootfsFromScratch )
Make a bootable MMC card on Linux
Thanks to Graeme Gregory and Steve Sakoman, you can now use a script to automate the tedious process of creating a bootable SD/microSD card.
Take care if you do not have your system in English. You have to change the word "Disk" in the former script, line #10 with the translation in the language of your system.
Having followed this excellent tutorial it's time to mount your SD card boot partition (/media/boot). With your preferred editor create a boot-ini.source file like this.
# Set bootargs for ubuntu MMC boot setenv bootargs 'console=ttyS2,115200n8 console=tty0 omapfb.mode=dvi:1024x768MR-16@60 root=/dev/mmcblk0p2 rw rootwait ' # Read kernel from OneNAND onenand read 80200000 280000 400000 # and boot ... bootm 80200000
And use the mkimage tool to convert this file into a script image which can be executed using U-Boot's source command.
$ source /usr/local/poky/eabi-glibc/arm/environment-setup $ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Boot setup script' -d boot-ini.source boot.ini
The result will be a boot.ini file which you will copy to SD card boot partition
$ cp boot.ini /media/boot
Ubuntu releases
Ubuntu 9.04 (Jaunty Jackalope)
In order to get a copy of a ARM ubuntu root file system, you will need to install qemu and a recent version of debootstrap and the qemu package. On some systems you may also need the qemu-kvm-extras package to run the ARM emulation.
$ sudo apt-get install qemu $ sudo apt-get install qemu-kvm-extras $ wget http://ports.ubuntu.com/pool/main/d/debootstrap/debootstrap_1.0.12_all.deb $ sudo dpkg -i debootstrap_1.0.12_all.deb
Next, you will download a helper program to build the rootfs
$ wget http://launchpad.net/project-rootstock/trunk/0.1/+download/rootstock-0.1.3.tar.gz $ tar xzf rootstock-0.1.3.tar.gz $ cd rootstock-0.1.3
The following example will create a tarball of ubuntu-desktop based image for your target device:
$ sudo ./rootstock --fqdn ubuntu --login jdoe --password letmein --imagesize 3G --seed ubuntu-desktop --dist jaunty
Typical images (example settings):
To build a xubuntu-desktop image use the following options:
--imagesize 2G --seed xubuntu-desktop
For an ubuntu-desktop image (a similar size is needed if you want a kubuntu image):
--imagesize 3G --seed ubuntu-desktop
A typical remote development comandline environment if you run an armel board headless (note that you should edit /etc/network/interfaces and set up your network device on first login for this):
--imagesize 3G --seed build-essential,openssh-server
A very light desktop (lxde):
--seed lxde,gdm
This step can take a long time. For example, building ubuntu-desktop on a Celeron 1.6GHz laptop takes approximately 10 hours. When it is finished, a file named armel-rootfs-[date].tgz will be in your working directory.
Next, mount your SD card ext3 partition (/media/rootfs) and untar the rootfs
$ sudo tar xzf armel-rootfs-[date].tgz -C /media/rootfs
Finally, umount the SD card, insert the card in your board and power up.
Ubuntu 10.10 (Maverick Meerkat BETA)
With latest rootstock and debootstrap, you can repeat the same steps changing only "-d jaunty" in "-d maverick" in the rootstock command.
Alternatively:
First, download the compressed image from http://cdimage.ubuntu.com/ubuntu-netbook/ports/releases/
wget http://cdimage.ubuntu.com/ubuntu-netbook/ports/releases/maverick/beta/ubuntu-netbook-10.10-beta-preinstalled-netbook-armel+omap.img.gz
Next, uncompress the image with
gunzip ubuntu-netbook-10.10-beta-preinstalled-netbook-armel+omap.img.gz
Then write the raw image to a blank SD card (the card size should be >2G)
sudo dd if=<uncompressed image> of=/dev/mmcblk0 # change /dev/mmcblk0 with appropriate device
Remove all file but uImage from /media/rootfs and create a boot.source file like this
setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000' setenv bootargs 'mem=512M console=ttyS2,115200n8 console=tty0 omapfb.mode=dvi:1024x768MR-16@60 root=/dev/mmcblk0p2 rw rootwait' boot
create the boot.ini with
$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Boot setup script' -d boot.source boot.ini
I have only an ethernet cable, so I'm going on. Put these lines in /media/rootfs/etc/rc.local :
apt-get install -y openssh-server 2>&1 | tee /root/install.log useradd -G admin,root -s /bin/bash -m igep echo "igep:igep" | chpasswd exit 0
Check /etc/interfaces for "auto eth0", then boot the board with ethernet cable and wait some minutes. You can verify sshd status for example with (I've used a mac so nmap may differ):
sudo nmap -sS -PN -e <interface> -p22 <ip>
If you prefer passwordless ssh key authentication, create a key with ssh-keygen and copy the content of your .ssh/id_rsa.pub in authorized_keys :
* ON THE IGEP * $ cd /media/rootfs/home/igep $ mkdir .ssh $ chmod 700 .ssh $ touch authorized_keys $ chmod 600 authorized_keys $ cat /wherever/it/is/your's/id_rsa.pub >> authorized_keys
Remember to enable PubkeyAuthentication in /media/rootfs/etc/ssh/sshd_config :
PubkeyAuthentication yes
Minor problems
- /etc/hosts is missing and generates a sudo error
--- That's all folks ---