Installing a rootfs

From Linux Exynos
Revision as of 01:59, 15 June 2014 by Swabbles (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The instructions on this page are only known to work for Linux Gentoo. Ask how you can help improve by sending an e-mail to the mailing list, or by visiting #linux-exynos, or if you are able to contribute to the current page, then you are welcome to do so.


Installing a rootfs

Mount your root partition and all the subjacent partitions (we assume for this example that /dev/mmcblk0p3 is the root partition, and that /dev/mmcblk0p1 is the boot partition):

mkdir -p /mnt/extern/
mount /dev/mmcblk0p3 /mnt/extern/
mkdir -p /mnt/extern/boot/
mount /dev/mmcblk0p1 /mnt/extern/boot/


To install a Debian rootfs, you can use debootstrap:

debootstrap --arch=armhf --foreign jessie /mnt/extern/

Finalise the bootstrap:

chroot /mnt/extern/ /debootstrap/debootstrap --second-stage

Set up fstab:

cat > /mnt/extern/etc/fstab <<EOF
/dev/mmcblk1p3 / ext4 errors=remount-ro 0 1
/dev/mmcblk1p1 /boot ext2 errors=remount-ro 0 1

Set up the apt sources and update:

cat > /mnt/extern/etc/apt/sources.list <<EOF
deb jessie main non-free contrib
deb-src jessie main non-free contrib
chroot /mnt/extern/ apt-get update

Set the root password to blank:

chroot /mnt/extern/ passwd -d root

Set the hostname:

echo "hostname" > /mnt/extern/etc/hostname


For some inexplicable reason the Fedora developers decided to only provide disk images rather than tarballs, but that is no problem. To install a Fedora rootfs, you'll have to pick an image type by setting the TYPE environment variable (options include: KDE, LXDE, XFCE, SoaS, Mate and Minimal), download the image, mount it using a loopback device, copy the rootfs, and finally you'll have to unmount and dispose the image.

For example, to download and install a Minimal Fedora rootfs, you'd do the following:

wget -O -$TYPE-armhfp-20-1-sda.raw.xz | xzcat >/root/fedora.img
losetup --show -fP /root/fedora.img
mkdir -p /mnt/loop/
mount /dev/loop0p3 /mnt/loop/
cp -ax /mnt/loop/ /mnt/extern/
umount /mnt/loop/
losetup -d /dev/loop0
rm /root/fedora.img


Download and extract the latest stage3 tarball to your rootfs, whilst preserving the permissions:

wget -O -$(wget -O - 2>/dev/zero | tail -n1) | tar xjp -C /mnt/extern/

Download and extract the Portage package manager:

wget -O - | tar xjp -C /mnt/extern/usr/

See the relevant sections of the Gentoo handbook to finalise the setup.


Download and extract the Ubuntu 13.10 rootfs tarball:

wget -O - | tar xzp -C /mnt/extern/

For other versions, such as a LTS-version, you can browse the Ubuntu releases directory.