Loading...
 

Creating Ubuntu filesystem

Among one of file systems supported by MACCHIATObin is Ubuntu file system. This page will show how to download and create an Ubuntu file system image for MACCHIATObin. Note that you will need a Linux machine to follow the instructions on this page.

We begin by downloading a copy of Ubuntu Operating System (16.04.3 LTS). Make a directory where you will download the iso image (for example /home/mcbin/ubuntu/):

mcbin@buildserver:~$ mkdir ubuntu
mcbin@buildserver:~$ cd ubuntu
mcbin@buildserver:~/ubuntu$ wget http://cdimage.ubuntu.com/releases/16.04.3/release/ubuntu-16.04.3-server-arm64.iso

 
After the iso image has been downloaded, make a new directory to mount the iso image:

mcbin@buildserver:~/ubuntu$ mkdir temp
mcbin@buildserver:~/ubuntu$ sudo mount -o loop ubuntu-16.04.3-server-arm64.iso temp/


The Ubuntu file system is available at the install sub-directory named filesystem.squashfs:

mcbin@buildserver:~/ubuntu$ ls temp/install/
filesystem.manifest  filesystem.squashfs      hwe-initrd.gz  hwe-vmlinuz  netboot
filesystem.size      filesystem.squashfs.gpg  hwe-netboot    initrd.gz    vmlinuz


Next step you'll need to unsquash the file system into a directory named rootfs:

mcbin@buildserver:~/ubuntu$ sudo unsquashfs -d rootfs/ temp/install/filesystem.squashfs
mcbin@buildserver:~/ubuntu$ ls rootfs/
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var


Now we have a Ubuntu file system in the sub-directory rootfs. To remove the password required for root login, you'll need to modify the file rootfs/etc/passwd on its first line to remove the 'x' in between root: and :0. Please check the example of this line after the modification:

mcbin@buildserver:~/ubuntu/rootfs/etc$ cat passwd
root::0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
[truncated output]


The root file system you have created here is able to run on the MACCHIATObin board. Lastly, we also need to copy the kernel binary and dtb file over to the Micro SD card. Kernel binary and dtb file are available by either following instructions at Build from source - Kernel or they can be downloaded at Tech Spec page, Software table under Linux kernel. Either way, copy the Image kernel binary and the armada-8040-mcbin.dtb dtb file to the boot directory:

mcbin@buildserver:/ubuntu$ sudo cp ~/kernel/4.4.52/arch/arm64/boot/Image rootfs/boot/
mcbin@buildserver:/ubuntu$ sudo cp ~/kernel/4.4.52/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb rootfs/boot/


Now we will zip the folder up to later extract it to a removable media such as micro SD card or USB stick:

mcbin@buildserver:~/ubuntu$ sudo tar -cjvf rootfs.tar.bz2 -C rootfs/ .


This root file system with kernel binary and dtb file included can also be downloaded from our Tech Spec page, Software table under Ubuntu.

Please refer to the page Boot from MicroSD card/USB stick - Ubuntu on how to extract the root file system on a removable media for MACCHIATObin.