Funtoo Linux Installation on ARM

From Funtoo Linux
Revision as of 14:27, 18 December 2012 by Jeanfrancis (Talk | contribs)

Jump to: navigation, search

Funtoo now provides stage3 images for arm platform. At this time are only armv6j_hardfp and armv7a_hardfp stages available. If you would like us to support other processors (see the list below) leave a note on #IRC channel or ...

Contents

List of ARM processor "flavors"

  • armv4l-unknown-linux-gnu (Rebel NetWinder, HP Armada and other devices having an ARMv4 processor, which is only capable of running the old ABI. Nevertheless it should work on newer CPUs)
  • armv4tl-softfloat-linux-gnueabi (OpenMoko FreeRunner and other devices using an ARMv4T processor. Uses the new ARM EABI and software floating point by default)
  • armv5tel-softfloat-linux-gnueabi (almost all ARM NAS, devices based on the Marvell Orion and Marvell Kirkwood, Marvell Sheevaplug, Marvell OpenRD, Guruplug, Dreamplug, QNAP TS109/TS209/TS409/TS119/TS219/TS419, Buffalo Linkstation/Kurobox PRO, HP mv2120, HP iPAQ, Linksys NSLU2 and other devices using an ARMv5TE processor. Uses the new ARM EABI and software floating point by default)
  • armv6j-unknown-linux-gnueabi (Nokia N800/N810, Smart Q7, OMAP2-based devices and other multimedia devices using an ARMv6 CPU and VFP. Uses the new ARM EABI and hardware floating point by default)
  • armv7a-unknown-linux-gnueabi (OMAP3-based devices(Beagleboard, IGEPv2, Devkit8000, AlwaysInnovating Touchbook, Nokia N900), OMAP4-based devices(Pandaboard), Freescale i.MX515-based devices(Efika MX, Babbage Board, Lange Board…) Marvell Dove/Armada, Nvidia Tegra2-based devices(Toshiba AC100, Toshiba Folio), ST-Ericsson NOVA A9500-based devices(Snowball), Exynos 4412 (Odroid-X, Odroid-Q) and other devices using an ARMv7-A processor. Uses the new ARM EABI and generic(not NEON) hardware floating point by default
  • armv7a-hardfloat-linux-gnueabi (The same as armv7a-unknown-linux-gnueabi, but this one uses hardfloat instead of softfp. Read more about it here: http://wiki.debian.org/ArmHardFloatPort)

Default installation of Funtoo on your platform/board

These are some notes about installing Funtoo Linux on ARM based devices that are non-board specific. Other instructions can be found in the specific articles for the above mentioned devices.

Overview

If you are a Gentoo or a Funtoo user this won't be anything that new to you. Most of the boards come with a SD card slot, so you will need an empty SD card (xGB is enough to get you started), in most cases the boards are also equipped with debug port which can be used with USB-to-serial cables, if you have one, you can use it to login to the machine without the need of connecting keyboards or displays. You will need a network connection to be able to download stages, kernel and update your portage tree.

Kernel and bootloader setup

Before you start you will need a kernel and a bootloader for your device. Some of the devices look for bootloader (in most cases U-Boot) on the SD along with the kernel.

More information about the kernel and bootloader can be found on pages specific for your device.

Installing Funtoo

The installation on these devices differs from the normal installation procedure of booting an installation environment and chrooting from there to your new root, and can be little bit easier, but in some cases tricky.

To setup the installation:

  • Extract stage3 to the 2nd partition of the SD card
  • Extract portage snapshot (required to emerge things and ntp(see below))
  • Setup fstab
  • Setup root password
  • Configure hostname and networking (optional, but recommended)
  • Enable SSH access (optional, but recommended)
  • Enable serial console access (optional, but recommended)
  • Correct RTC "bug" with swclock

Now download your stage3 from [1], use the correct subarchitecture. And also download the portage snapshot from [2].

Extracting the stage3

Mount the partition that will hold your rootfs of the SD card and extract the stage3 you have downloaded.

mkdir /mnt/SD_root
mount /dev/sdcard-device-px /mnt/SD_root

(Extract the stage3, it may take a while)

tar xapf stage3-armv7a_hardfp-xxxx.tar.xz -C /mnt/SD_root

Extracting a portage snapshot (optional)

tar xapf portage-latest.tar.xz -C /mnt/SD_root/usr

Setup fstab

Edit the /mnt/SD_root/etc/fstab file to look like this:

/dev/mmcblk0p1		/boot		vfat		noauto,noatime	1 2
/dev/mmcblk0p2		/		ext4		noatime		0 1

Setting the default root password

This is almost the most important part of the installation. As without the root password we won't be able to login!

For setting the password, we need to be able to run passwd. However that's not possible since our PC can't run ARM binaries. Therefore we need to modify the file that contains the passwords (/etc/shadow) inside the chroot, so we can set a default root password.

(Generate a password)

openssl passwd -1
nano -w /mnt/SD_root/etc/shadow

(For example, this line makes the password be gentoo)

root:$6$I9Q9AyTL$Z76H7wD8mT9JAyrp/vaYyFwyA5wRVN0tze8pvM.MqScC7BBm2PU7pLL0h5nSxueqUpYAlZTox4Ag2Dp5vchjJ0:14698:0:::::

Setup hostname and networking

Please read the Funtoo Linux Networking to configure your network.

Using swclock

One of the problems some of the devices have, is that they don't have a battery to save the clock time. To mitigate this, on Funtoo we have an option in our init system called swclock which sets the date of the system upon boot from a last modified date of a file.

Adding swclock to the startup
ln -sf /etc/init.d/swclock /mnt/SD_root/etc/runlevels/boot

We remove hwclock from the startup because it sets the date from the RTC, which is 2000-01-01 upon startup and overrides swclock's date.

rm /mnt/SD_root/etc/runlevels/boot/hwclock

swclock uses the /lib/rc/cache/shutdowntime's modification time to set the date, therefore we update it to have the current date and time.

touch /mnt/SD_root/lib/rc/cache/shutdowntime

Although this doesn't fix the issue, at least helps to set a sane date and time. Note: Consider using NTP, documented on the next chapter

Enabling SSH access (optional)

We can add sshd to the startup,so we can access our devices using ssh.

ln -sf /etc/init.d/sshd /mnt/SD_root/etc/runlevels/default

Enabling serial console access (optional)

By default the ttyS0 port is configured at 9600 bps. However, almost all of the ARM devices run the serial port at 115200 bps. Also, the port device names differ (ttyO2 for Pandaboard, ttySAC1 for Odroid-X ...). So edit your /etc/inittab file:

nano -w /mnt/SD_root/etc/inittab
(For example for Pandaboard: )
s0:12345:respawn:/sbin/agetty 115200 ttyO2 vt100

Finishing the installation

Let's unmount the SD card

umount /mnt/SD_root

This is all that it is to it.

Booting up our new system

Once you have the card ready, put it into your device, and you should be able to boot it. If you have a debug port you will be able to see the boot process using minicom or similar program on another PC connected with the debug cable.

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff