ubuntu16.04 for arm64

Creating Ubuntu filesystem

 

Table of contents

    • Ubuntu 14.04.5 LTS
    • Ubuntu 16.04.4 LTS

 

Among one of file systems supported by ESPRESSObin is Ubuntu file system (latest available releases are 14.04.5 LTS and 16.04.4 LTS). Here we will show you how to create Ubuntu file system for ESPRESSObin for both releases. Note that you will need a Linux machine to follow the instructions on this page.

Ubuntu 14.04.5 LTS


Begin by downloading a copy of Ubuntu file system (14.04.5 LTS). Make a directory where you will download the file system (for example /home/espressobin/ubuntu_14.04/):

user@laptop:~$ mkdir -p ubuntu_14.04
user@laptop:~/ubuntu$ wget http://cdimage.ubuntu.com/ubuntu-base/releases/14.04.5/release/ubuntu-base-14.04.5-base-arm64.tar.gz


After the download is complete, make a new directory where we will extract the file system:

user@laptop:~/ubuntu_14.04$ mkdir fs && cd fs
user@laptop:~/ubuntu_14.04$ sudo tar -xvf ../ubuntu-base-14.04.5-base-arm64.tar.gz


Our fs/ directory now has Ubuntu file system.

Now we will need to edit a few configuration files in order for the Ubuntu file system to boot properly. Open the file etc/init/rc-sysinit.conf and there set the variable DEFAULT_RUNLEVEL to 3:

user@laptop:~/ubuntu_14.04/fs$ sudo vim etc/init/rc-sysinit.conf

 # Default runlevel, this may be overriden on the kernel command-line
 # or by faking an old /etc/inittab entry
 env DEFAULT_RUNLEVEL=3


Next we will remove the login password for root by editing the /etc/passwd file (remove the x after the first root):

user@laptop:~/ubuntu_14.04/fs$ sudo vim etc/passwd

root::0:0:root:/root:/bin/bash


Last thing we need to do is to create a file ttyMV0.conf in /etc/init directory:

user@laptop:~/ubuntu_14.04/fs$ sudo vim etc/init/ttyMV0.conf


and in it we paste the following (if this is incorrect the boot will freeze):

start on stopped rc or RUNLEVEL=[12345]
stop on runlevel [!12345]
respawn
exec /sbin/getty -L 115200 ttyMV0 vt100 -a root


Now, copy the kernel image and device tree to the boot/ directory:

user@laptop:~/ubuntu_14.04/fs$ sudo cp ~/kernel/4.4.52/arch/arm64/boot/Image boot/
user@laptop:~/ubuntu_14.04/fs$ sudo cp ~/kernel/4.4.52/arch/arm64/boot/dts/marvell/armada-3720-community.dtb boot/


Kernel image 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.

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

user@laptop:~/ubuntu_14.04/fs$ cd ..
user@laptop:~/ubuntu_14.04$ sudo tar -cjvf rootfs.tar.bz2 -C fs/ .


This tar containing the Ubuntu 14.04.5 LTS root file system (with kernel binary and dtb file included) can also be downloaded from our Tech Spec page, Software table under Ubuntu 14.04.5 LTS.

Head over to Boot from removable storage - Ubuntu page to see how to properly format either a microSD card or USB device, extract the Ubuntu file system onto it and boot Ubuntu on your ESPRESSObin.

Ubuntu 16.04.4 LTS


We will begin by downloading a copy of Ubuntu OS (16.04.4. LTS). First we make a directory where we will download the iso image (for example /home/user/ubuntu_16.04/):

user@laptop:~$ mkdir -p ubuntu_16.04
user@laptop:~/ubuntu_16.04$ wget http://cdimage.ubuntu.com/releases/16.04.5/release/ubuntu-16.04.4-server-arm64.iso


After the iso image has been downloaded, create a new subdirectory where we will mount the iso image:

user@laptop:~/ubuntu_16.04$ mkdir tmp
user@laptop:~/ubuntu_16.04$ sudo mount -o loop ubuntu-16.04.4-server-arm64.iso tmp/


The Ubuntu file system (named filesystem.squashfs) is located in the /install subdirectory:

user@laptop:~/ubuntu_16.04$ ls tmp/install/
filesystem.manifest  filesystem.squashfs      hwe-initrd.gz  hwe-vmlinuz  netboot
filesystem.size      filesystem.squashfs.gpg  hwe-netboot    initrd.gz    vmlinuz


Next we will unsquash that file system into a directory named rootfs:

user@laptop:~/ubuntu_16.04$ sudo unsquashfs -d rootfs/ tmp/install/filesystem.squashfs
Parallel unsquashfs: Using 4 processors
11381 inodes (12201 blocks) to write

[=====================================================================================|] 12201/12201 100%

created 9488 files
created 1130 directories
created 1809 symlinks
created 79 devices
created 0 fifos


and we can list the contents of our file system:

user@laptop:~/ubuntu_16.04$ ls rootfs/
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var


All that is left is a bit of tweaking of the created file system. First we need to remove the password for root login. To do that, we open rootfs/etc/passwd file and remove the first 'x' between root: and :0 so that the line looks like this:

# open the file with your favorite editor
user@laptop:~/ubuntu_16.04$ sudo vim rootfs/etc/passwd
# in the first line
root:x:0:0:root:/root:/bin/bash
# we need to remove 'x'
root::0:0:root:/root:/bin/bash


Next we need to append ttyMV0 to the end of file /etc/securetty so open the file:

user@laptop:~/ubuntu_16.04$ sudo vim rootfs/etc/securetty


and at the end of the file append ttyMV0 like this:

# Serial Console for MIPS Swarm
duart0
duart1

# s390 and s390x ports in LPAR mode
ttysclp0
ttyMV0


Lastly, we also need to copy the kernel binary and dtb file to the root file system. Kernel image 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-3720-community.dtb dtb file to the rootfs/boot directory:

user@laptop:/ubuntu$ sudo cp ~/kernel/4.4.52/arch/arm64/boot/Image rootfs/boot/
user@laptop:/ubuntu$ sudo cp ~/kernel/4.4.52/arch/arm64/boot/dts/marvell/armada-3720-community.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:

user@laptop:~/ubuntu_16.04$ sudo tar -cjvf rootfs.tar.bz2 -C rootfs/ .


This tar containing the Ubuntu root file system (with kernel binary and dtb file included) can also be downloaded from our Tech Spec page, Software table under Ubuntu 16.04.4 LTS.

Head over to Boot from removable storage - Ubuntu page to see how to properly format either a micro SD card or USB device and extract the Ubuntu file system onto it.

你可能感兴趣的:(ubuntu)