Installing a rootfs

From Linux Exynos
Jump to: navigation, search

The instructions on this page are only known to work for Linux Gentoo. Ask how you can help improve linux-exynos.org 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.

Contents

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/

Debian

To install a Debian rootfs, you can use debootstrap:

debootstrap --arch=armhf --foreign jessie /mnt/extern/ http://http.debian.net/debian

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
EOF

Set up the apt sources and update:

cat > /mnt/extern/etc/apt/sources.list <<EOF
deb http://ftp.uk.debian.org/debian jessie main non-free contrib
deb-src http://ftp.uk.debian.org/debian jessie main non-free contrib
EOF
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

Fedora

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:

TYPE=Minimal
wget -O - http://download.fedoraproject.org/pub/fedora/linux/releases/20/Images/armhfp/Fedora-$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

Gentoo

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

wget -O - http://distfiles.gentoo.org/releases/arm/autobuilds/$(wget -O - http://distfiles.gentoo.org/releases/arm/autobuilds/latest-stage3-armv7a_hardfp.txt 2>/dev/zero | tail -n1) | tar xjp -C /mnt/extern/

Download and extract the Portage package manager:

wget -O - http://distfiles.gentoo.org/releases/snapshots/current/portage-latest.tar.bz2 | tar xjp -C /mnt/extern/usr/

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

Ubuntu

Download and extract the Ubuntu 13.10 rootfs tarball:

wget -O - http://cdimage.ubuntu.com/ubuntu-core/releases/13.10/release/ubuntu-core-13.10-core-armhf.tar.gz | tar xzp -C /mnt/extern/

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