Using Ubuntu base arm64 rootfs for RPI3

Following my previous post here, we now can now boot our kernel thru u-boot. Now we’re going to create a filesystem base from arm64 ubuntu base rootfs.

Create a folder were we will extract the Ubuntu base rootfs, and tar to extract.

mkdir rootfs
cd rootfs/
sudo tar –xzvf ubuntu-base-16.04.2-base-arm64.tar.gz

Install the kernel module into the rootfs folder.

sudo ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH={directory}/rootfs/

Check that it was installed correctly.

ls rootfs/lib/modules/4.11~

build           modules.builtin        modules.devname         modules.symbols.bin
kernel        modules.builtin.bin      modules.order        source
modules.alias         modules.dep     modules.softdep
modules.alias.bin   modules.dep.bin    modules.symbols

We’ll use chroot to further setup our filesystem.

sudo cp –av /usr/bin/qemu-aarch64-static {directory}/rootfs/usr/bin

Note*:
• /usr/bin/qemu-arm-static is for 32-bit armhf architecture
• /usr/bin/qemu-aarch64-static is for 64-bit arm64 architecture

Enter chroot environment:

sudo chroot {directory}rootfs/

Now that you’re in the chroot environment, we can now add an admin user with sudo permission.

useradd -G sudo -m -s /bin/bash rpi3
echo rpi3:raspberry | chpasswd

Note*: The format input line of chpasswd is: user_name:password.

Setup a hostname for your target device.

echo U-Base_min > /etc/hostname
echo 127.0.0.1 localhost

Fetch the latest package lists from server then upgrade.

apt-get update
apt-get upgrade

Install minimal packages:

apt-get install sudo ifupdown net-tools ethtool udev wireless-tools iputils-ping perl resolvconf wget apt-utils dialog wpasupplicant initramfs-tools</>

Create a Ramdisk(optional).

mkinitramfs -o /boot/initrd.img /lib/modules/4.11~

When everything you want to setup has been done, exit chroot:

exit

Then copy the rootfs/ content to the 2nd partition of your µSD car. Now boot it up and you should now be able to login.

Net post will be about setting up the wifi.

Reference:

http://docs.khadas.com/social/BuildUbuntuRootfsViaUbuntuBase/

https://gnu-linux.org/building-ubuntu-rootfs-for-arm.html

 

 

Advertisements
About

From Philippines. a new comer in using raspberry pi 3

Tagged with:
Posted in Raspberry pi 3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: