Difference between revisions of "IMX233/ArchLinuxARM"

m (Partition the SD card)
m (Generate a custom filesystem)
 
(4 intermediate revisions by the same user not shown)
Line 33: Line 33:
 
Write it to the first partition at 2 kiB offset:
 
Write it to the first partition at 2 kiB offset:
 
  <nowiki>dd if=u-boot.sb of=/dev/sdcardpartition_1 bs=512 seek=4</nowiki>
 
  <nowiki>dd if=u-boot.sb of=/dev/sdcardpartition_1 bs=512 seek=4</nowiki>
 +
 +
TODO: Configuration of U-Boot, links to docs, uEnv.txt.
  
 
=== Install the root filesystem ===
 
=== Install the root filesystem ===
  
Download the [http://os.archlinuxarm.org/os/ArchLinuxARM-olinuxino-latest.img.gz rootfs tarball] from [http://os.archlinuxarm.org/os/ this listing on ofarchlinuxarm.org] and extract it on the mounted rootfs partition. It is important to do the extraction root, not with sudo.
+
Download the [http://os.archlinuxarm.org/os/ArchLinuxARM-olinuxino-latest.img.gz rootfs tarball] from [http://os.archlinuxarm.org/os/ this listing on archlinuxarm.org] and extract it on the mounted rootfs partition. It is important to do the extraction root, not with sudo.
  
 
  <nowiki>wget http://os.archlinuxarm.org/os/ArchLinuxARM-olinuxino-latest.img.gz
 
  <nowiki>wget http://os.archlinuxarm.org/os/ArchLinuxARM-olinuxino-latest.img.gz
Line 43: Line 45:
 
tar -xzvpf ArchLinuxARM-olinuxino-latest.img.gz -C /mnt/rootfs
 
tar -xzvpf ArchLinuxARM-olinuxino-latest.img.gz -C /mnt/rootfs
 
sync
 
sync
umount /mnt/rootfs
+
umount /mnt/rootfs</nowiki>
 +
 
 +
==== Generate a custom filesystem ====
 +
 
 +
You can generate your own alarm root filesystem with the pacstrap tool. This can be done from within a running alarm installation, on an imx233-olinuxino, another more powerful board, or even from within qemu running alarm:
 +
<nowiki># as root
 +
pacman -S arch-install-scripts
 +
 
 +
# this creates the rootfs on a local disk, but the steps
 +
# can be executed directly on a mounted sdcard partition
 +
mkdir rootfs
 +
pacstrap --help
 +
 
 +
# this will setup a new alarm root filesystem in ./rootfs and install the listed packages
 +
# this is possibly the absolute minimum for a working system with network
 +
pacstrap -cdGiM ./rootfs filesystem linux-olinuxino \
 +
    inetutils iputils nano vi netctl dialog openssh \
 +
    pacman ppp systemd-sysvcompat usbutils \
 +
    wireless_tools wpa_supplicant
 +
 
 +
# install a custom kernel
 +
pacman -r ./rootfs -S linux-olinuxino-<TODO: upload, add link>-.tar.xz
 
</nowiki>
 
</nowiki>
  
==== Generate a custom filesystem ====
+
Beyond the bare minimum, you can install more packages to the newly created rootfs:
 +
<nowiki>pacman -r ./rootfs -S bash-completion vim samba lighttpd git</nowiki>

Latest revision as of 13:27, 6 May 2013

ArchLinuxARM on iMX233-OLinuXino

This page explains the ways to install ArchLinuxARM (alarm for short) on iMX233-OLinuXino boards. Instructions should work on all 3 variants: maxi, mini and micro.

The official image

The easiest way to install alarm: just follow the official instructions. The image is pre-partitioned and has everything in place. It uses bootlets, so any time the kernel cmdline or DT binary need to be changed the bootstream needs to be rebuilt and reflashed.

When upgrading the kernel or installing a custom kernel package it is essential that you hit "y" when asked "Do you want the new kernel flashed onto mmcblk0p1? [y|N]". If not, the bootstream containing the new kernel will not be used after a reboot, with its modules already uninstalled.

U-Boot makes the board much more hacker-friendly.

U-Boot install

This will hopefully soon become the official installation method, but it requires a few advanced steps at this point.

Partition the SD card

Achieve the following partition layout using parted, fdisk, cfdisk or something else:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048        6143        2048   53  OnTrack DM6 Aux3
/dev/sdd2            6144     3842047     1917952   83  Linux

There are step by step instructions here. The first partition is of the special 0x53 type, 2 MiB are enough. It will contain the bootloader and its environment.

The second is your rootfs partition. You may create additional ones if you like and edit /etc/fstab to your liking.

Install the bootloader

Download a prebuilt u-boot.sb file or follow the instructions here to build one.

Write it to the first partition at 2 kiB offset:

dd if=u-boot.sb of=/dev/sdcardpartition_1 bs=512 seek=4

TODO: Configuration of U-Boot, links to docs, uEnv.txt.

Install the root filesystem

Download the rootfs tarball from this listing on archlinuxarm.org and extract it on the mounted rootfs partition. It is important to do the extraction root, not with sudo.

wget http://os.archlinuxarm.org/os/ArchLinuxARM-olinuxino-latest.img.gz
sudo mount /dev/sdcardpartition_2 /mnt/rootfs
sudo su
tar -xzvpf ArchLinuxARM-olinuxino-latest.img.gz -C /mnt/rootfs
sync
umount /mnt/rootfs

Generate a custom filesystem

You can generate your own alarm root filesystem with the pacstrap tool. This can be done from within a running alarm installation, on an imx233-olinuxino, another more powerful board, or even from within qemu running alarm:

# as root
pacman -S arch-install-scripts

# this creates the rootfs on a local disk, but the steps 
# can be executed directly on a mounted sdcard partition
mkdir rootfs
pacstrap --help

# this will setup a new alarm root filesystem in ./rootfs and install the listed packages
# this is possibly the absolute minimum for a working system with network
pacstrap -cdGiM ./rootfs filesystem linux-olinuxino \
    inetutils iputils nano vi netctl dialog openssh \
    pacman ppp systemd-sysvcompat usbutils \
    wireless_tools wpa_supplicant

# install a custom kernel
pacman -r ./rootfs -S linux-olinuxino-<TODO: upload, add link>-.tar.xz

Beyond the bare minimum, you can install more packages to the newly created rootfs:

pacman -r ./rootfs -S bash-completion vim samba lighttpd git