Preface
This is a short guide to getting Ubuntu running on the IGEPv2 Rev C from a bootable SD card. There are a few guides around that I’ve based various sections on, but I couldn’t find a complete howto that was up to date with the current hardware. Most credit goes to Michael Opdenacker of Free Electrons.
- http://free-electrons.com/blog/ubuntu-1004-igepv2/
- http://labs.isee.biz/index.php/How_to_setup_a_cross_compiler
- http://labs.isee.biz/index.php/The_IGEP_X-loader
- https://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat
Download some Packages
- I’m assuming you’re building on Ubuntu. You’ll need to install a couple of extra packages.
$ sudo apt-get install ia32-libs git git-core qemu qemu-kvm-extras debootstrap build-essential
Install the poky toolchain
- First download the IGEP SDK Yocto Toolchain from here.
- Extract the toolchain to /.
$ sudo tar jxf igep-sdk-yocto-toolchain-*.tar.bz2 -C /
This should install the cross compiler to /opt/poky. To use the toolchain you need to configure your environment, which you can do with this shortcut:
$ source /opt/poky/1.2/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi
You’ll also need to add these to your environment.
$ export ARCH=arm $ export CROSS_COMPILE=arm-poky-linux-gnueabi-
Build the Kernel
- Clone the Linux OMAP Git repository
$ mkdir igep $ cd igep $ git clone git://git.igep.es/pub/scm/linux-omap-2.6.git $ cd linux-omap-2.6/
- Switch to the kernel version you want to build, in this case 2.6.37-6.
$ git tag v2.6.28.10-3 ... v2.6.37-4 v2.6.37-5 v2.6.37-6 $ git checkout -b v2.6.37-6_local v2.6.37-6
- Run the build with the default configuration.
$ make igep00x0_defconfig $ make -j 4
Create a Root Filesystem
- Download rootstock from here.
$ tar zxvf rootstock-0.1.99.3.tar.gz
- Build the filesystem. You can substitute your own username and password here.
$ cd rootstock-0.1.99.3 $ sudo ./rootstock --fqdn igepv2 --login joe --password 123456 --imagesize 2G --seed build-essential,openssh-server --dist lucid
Build IGEP-X-Loader
- Clone the Git repo
$ cd ~/igep $ git clone git://git.isee.biz/pub/scm/igep-x-loader.git $ cd igep-x-loader $ git checkout -b release-2.5.0-2_local release-2.5.0-2
- Build with the default configuration.
$ make igep00x0_config $ make
Format the SD Card
You’ll need a micro SD card at least 2GB in size. If you need some more details on how to do this step, you can find them here. I found this to be a much simpler experience.
Note: Substitute sdc with the actual device node of your SD card. I shouldn’t have to warn you that this will destroy all data on the SD card.
- Delete all the partitions.
$ sudo dd if=/dev/zero bs=512 count=1 of=/dev/sdc
- Run cfdisk to format the card.
$ sudo cfdisk /dev/sdc
- Create the boot partition.
- type: W95 FAT32 (LBA)
- size: 100MB is probably plenty
- Mark it as bootable
- Create the root partition.
- type: Linux
- size: Whatever is left
- Write the changes to the card and quit cfdisk.
- Format the partitions.
$ sudo mkfs.msdos /dev/sdc1 $ sudo mkfs.ext3 /dev/sdc2
- Mount the partitions.
$ sudo mkdir -p /media/boot $ sudo mkdir -p /media/rootfs $ sudo mount /dev/sdc1 /media/boot $ sudo mount /dev/sdc2 /media/rootfs
Copy Everything to the SD Card
- Copy the kernel and X-Loader.
$ cd ~/ $ sudo cp igep/igep-x-loader/MLO /media/boot $ sudo cp igep/linux-omap-2.6/arch/arm/boot/zImage /media/boot $ sudo cp igep/igep-x-loader/scripts/igep.ini /media/boot
- Copy the root filesystem.
$ cd /media/rootfs $ sudo tar zxvf ~/igep/rootstock-0.1.99.3/armel-rootfs-201306180112.tgz
- Install kernel modules.
$ cd ~/igep/linux-omap-2.6/ $ make INSTALL_MOD_PATH=/media/rootfs modules_install
Modify the X-Loader config
- Edit /media/boot/igep.ini.
- Specify the rootfstype.
; --- Configure MMC boot --- root=/dev/mmcblk0p2 rw rootwait ; add this line rootfstype=ext3
A Few Modifications to the Root Filesystem
- Copy tty config.
$ cd /media/rootfs $ sudo cp etc/init/tty1.conf etc/init/ttyO2.conf
- Edit etc/init/ttyO2.conf and change.
exec /sbin/getty -8 38400 tty1
to
exec /sbin/getty -8 115200 ttyO2
- Disable ureadahead.
$ sudo mv etc/init/ureadahead.conf etc/init/ureadahead.disabled
- Setup the network interface by editing etc/network/interfaces. This is just an example, you’ll probably have you own details to put here.
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.5.1 netmask 255.255.255.0 network 192.168.5.0 broadcast 192.168.5.255
- Add some more source repositories by editing etc/apt/sources.list.
deb http://ports.ubuntu.com/ubuntu-ports lucid main universe deb http://ports.ubuntu.com/ubuntu-ports lucid-updates main deb http://ports.ubuntu.com/ubuntu-ports lucid-security main
Testing the Build
- Unmount the SD card from your development machine.
$ cd ~/ $ sudo umount /media/rootfs $ sudo umount /media/boot
- Insert the card into the IGEPv2 and power it up.
The board should boot and you should see the kernel messages on the debug port. You can connect to the board over ssh using the username and password you used when creating the root filesystem, and the IP address you specified in /etc/network/interfaces.
I tried these instructions EXACTLY (multiple times), and by IGEPv2 just boots from the eMMC. I think it tries to boot from this but isn’t happy.
Actually, the only issue is that you need to resize the SD card ext3 partition to the nearest cylinder. Otherwise the bootloader freaks out about the partition table. Thanks for the primer.