Configure Network

In order to make sure we always use the same IP address, we should use a static ip address. But first, we want the device to obtain an unused local ip address.

sudo nano /etc/network/interfaces

Replace all the current text with:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Include files from /etc/network/interfaces.d:

source-directory /etc/network/interfaces.d

auto lo

iface lo inet loopback auto eth0

allow-hotplug eth0

iface eth0 inet dhcp

Hit Ctrl + X

type y

hit enter

Add a nameserver to the resolv.conf file (Might not be needed)

sudo nano /etc/resolv.conf If the file is empty, add the following line to the file, if it's not empty, leave it like it is!:

nameserver 8.8.8.8 Save and quit:

Ctrl + X y Enter

Connect via SSH (Optional but recommended)

Now that you have your network setup, you have the option to connect to your Rock64 with SSH. This is some sort of remote desktop.

If you want to use SSH, follow these steps. If you don’t want to connect via SSH, you can just continue with Changing Root to the HDD/SDD below.

Find out your current ip address:

sudo ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.1.114 netmask 255.255.255.0 broadcast 192.168.1.255

inet6 xxxx::xxxx:xxxx:xxxx:xxxx prefixlen 64 scopeid 0x20<link>

ether 6e:dc:ee:0d:a2:94 txqueuelen 1000 (Ethernet)

RX packets 16680449 bytes 24520569327 (22.8 GiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 3636875 bytes 623746277 (594.8 MiB)

TX errors 21 dropped 0 overruns 21 carrier 0 collisions 0

device interrupt 39

Copy the ip address marked bold above.

Now open the network config again, this time to make sure we use a static IP Address.

sudo nano /etc/network/interfaces

Replace all the current text with this. Replace ipaddress with the address you just copied.

# interfaces(5) file used by ifup(8) and ifdown(8)

# Include files from /etc/network/interfaces.d:

auto lo

iface lo inet loopback auto eth0

iface eth0 inet static

address ipaddress

netmask 255.255.255.0

gateway 192.168.1.1

Alright, now we can setup SSH on a static IP address. I used software called PuTTY for my windows machine. It’s free to use.

To setup SSH, follow this tutorial

Changing Root to the HDD/SDD

The next thing we would like to do is changing the root directory from the SD card to the HDD/SSD disc.

To do this, I used a tutorial from pine64.pro. Sadly, this didn’t work for me and it took me quite some time to find out what was wrong. Here’s how I did it:

Follow this tutorial on Pin64.pro

Quick note: Some things have slightly changed since this tutorial, so if something is a little bit different (like not being able to choose primairy or extended partition, and partition sda5 might be called sda2 for you). Don’t worry, think logical and you’ll manage!

Unfortunately, there are some things that don’t work in this tutorial, so we need to alter some things.

Set the correct root folder in the right file

Find the correct UUID of your HDD/SDD:

sudo blkid /dev/sda1 (Or any other name of your HDD/SDD)

Copy the UUID name of your HDD/SDD, for example: UUID=”e1eccc0f-cb29–4adf-ac2a-3bfd10b58370"

sudo nano /boot/efi/extlinux/extlinux.conf Replace the file with this: TIMEOUT 30

DEFAULT kernel-4.14 MENU TITLE Rock64 boot options LABEL kernel-4.14

kernel /Image

initrd /initrd.img

fdt /dtb

append earlycon=uart8250,mmio32,0xff130000 rw root=YOUR_UUID rootwait rootfstype=ext4 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} Make sure to replace YOUR_UUID with the UUID line you just copied, for example: root=UUID=”e1eccc0f-cb29–4adf-ac2a-3bfd10b58370" CTRL X y enter

Now we need to fix something before we reboot, or we might end up in a locked device. We need to fix the fstab file on the HDD/SDD:

sudo mount /dev/sda1 /mnt

sudo nano /mnt/etc/fstab Replace EVERYTHING in the file with only this:

LABEL=boot /boot/efi vfat defaults,sync 0 0 sudo reboot

Note: It could be that your Rock64 won’t boot anymore after these changes, or is stuck in a loop. If this is the case, something went wrong with your root=UUID reference, or the last step. You can remove the SD card from your Rock64 and read the extlinux.conf file from your pc. Alter the root label to what it was before:

root=LABEL=linux-root

Save and put the SD card back in your Rock64. It might be that it boots again. If not, something went wrong with the fstab file. This is very tricky to fix. I ended up restarting from scratch. If you have another linux machine, you could try to connect the HDD or SDD to that machine, and alter the /etc/fstab file there.

Check if your root is indeed changed, if not, retry. It took me a while before I rodid everything correct.

df -h Filesystem Size Used Avail Use% Mounted on

udev 2.0G 0 2.0G 0% /dev

tmpfs 393M 11M 383M 3% /run

/dev/sda1 136G 26G 104G 20% /

tmpfs 2.0G 0 2.0G 0% /dev/shm

tmpfs 5.0M 4.0K 5.0M 1% /run/lock

tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup

/dev/mmcblk1p6 100M 42M 59M 42% /boot/efi

tmpfs 393M 0 393M 0% /run/user/1000

If the name of your HD is assigned to / then you’re good to go. Boot will still be done by the SD card. You can’t change this.