Hi, all, I flied back and forth between ShenZhen China and Vancouver
Canada in January 2018, and took a holiday break in California USA
during Chinese Spring Festival in Febrary 2018. Now, I'm back to
Vancouver and write this blog. Today, we are going to talk about how to
flash the most recent Linux Kernel
onto an NanoPi
NEO. The board looks like (cited from NanoPi
NEO ):
Before starting, the following paragraph is cited to explain the
relationships among AllWinner,
Sunxi and Linaro.
In march 2014, Allwinner
joined Linaro as part of the new linaro digital home group. After this,
Allwinner stopped communicating
with the sunxi community,
as linaro membership apparently satisfies the marketing need to be seen
as an open source friendly company. Despite Linaro membership, Allwinner still violates the GPL on many
counts. (cited from http://linux-sunxi.org/Allwinner
.)
PART
A: Install Debian Server Built By Armbian onto NanoPi NEO
1. Download
Armbian Debian Server for NanoPi NEO
We FIRST go visiting the website https://www.armbian.com/nanopi-neo/
and click Debian server -- mainline kernel icon, a file
named
Armbian_5.38_Nanopineo_Debian_stretch_next_4.14.14.7z
will be automatically downloaded.
Then, we extract this .7z file by
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ 7za e Armbian_5.38_Nanopineo_Debian_stretch_next_4.14.14.7z
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=en_CA.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
Afterwards, use dd to install the downloaded Armbian
Ubuntu Desktop image.
1 2 3 4 5
$ sudo dd bs=4M if=Armbian_5.38_Nanopineo_Debian_stretch_next_4.14.14.img of=/dev/mmcblk0 conv=fsync [sudo] password for jiapei: 333+0 records in 333+0 records out 1396703232 bytes (1.4 GB, 1.3 GiB) copied, 157.712 s, 8.9 MB/s
PART
B: Boot Into Armbian, Network Configuration and Armbian Upgrading
As known, NanoPi NEO
comes with NEITHER a HDMI interface
for display, NOR a Wifi interface for
wireless network connection. Therefore, we may have to find a wired
cable, and connect our NanoPi NEO to
a router, which also connects with our host computer. Afterwards, we'll
have to find our NanoPi NEO
connection via router settings. Here in my case, I'm using a Cisco
DPC3848V DOCSIS 3.0 Gateway, with the gateway IP:
192.168.0.1. By visiting http://192.168.0.1 -> Setup
-> LAN Setup -> Connected Devices Summary, you should be
able to find out which is the newly connected network device, namely NanoPi
NEO.
$ ssh root@192.168.0.76 The authenticity of host '192.168.0.76 (192.168.0.76)' can't be established. ECDSA key fingerprint is SHA256:L0qZCYEGGallJo9jSpM63TWAYJ4vU/JzIbMJS80Lx8I. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.0.76' (ECDSA) to the list of known hosts. root@192.168.0.76's password:
Then you input 1234 as the password, you'll be asked
to change your password right away.
Creating a new user account. Press <Ctrl-C> to abort
Please provide a username (eg. your forename): nanopineo Trying to add user nanopineo perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US.UTF-8", LC_ALL = (unset), LC_MEASUREMENT = "en_CA.UTF-8", LC_PAPER = "en_CA.UTF-8", LC_MONETARY = "en_CA.UTF-8", LC_NAME = "en_CA.UTF-8", LC_ADDRESS = "en_CA.UTF-8", LC_NUMERIC = "en_CA.UTF-8", LC_MESSAGES = "en_US.UTF-8", LC_TELEPHONE = "en_CA.UTF-8", LC_IDENTIFICATION = "en_CA.UTF-8", LC_TIME = "en_CA.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("en_US.UTF-8"). Adding user `nanopineo' ... Adding new group `nanopineo' (1000) ... Adding new user `nanopineo' (1000) with group `nanopineo' ... Creating home directory `/home/nanopineo' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for nanopineo Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Y
Dear nanopineo, your account nanopineo has been created and is sudo enabled. Please use this account for your daily work from now on.
I noticed that when you reboot NanoPi NEO,
the IP address changed from time to time. The reason why it is so is
because the MAC address of NanoPi NEO
change randomly after Armbian reboot. Therefore, it's recommended to
manually set a static MAC address for NanoPi NEO in
file /etc/network/interfaces.
1
root@nanopineo:~# vim /etc/network/interfaces
Just make sure to uncomment this line hwaddress ether # if
you want to set MAC manually and write in a fixed MAC address.
The final /etc/network/interfaces for my NanoPi NEO is
as follows:
# Wired adapter #1 allow-hotplug eth0 no-auto-down eth0 iface eth0 inet dhcp #address 192.168.0.100 #netmask 255.255.255.0 #gateway 192.168.0.1 #dns-nameservers 8.8.8.8 8.8.4.4 hwaddress ether d2:d0:78:47:06:b3 # if you want to set MAC manually # pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838
# Wireless adapter #1 # Armbian ships with network-manager installed by default. To save you time # and hassles consider using 'sudo nmtui' instead of configuring Wi-Fi settings # manually. The below lines are only meant as an example how configuration could # be done in an anachronistic way: # #allow-hotplug wlan0 #iface wlan0 inet dhcp #address 192.168.0.100 #netmask 255.255.255.0 #gateway 192.168.0.1 #dns-nameservers 8.8.8.8 8.8.4.4 # wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf # Disable power saving on compatible chipsets (prevents SSH/connection dropouts over WiFi) #wireless-mode Managed #wireless-power off
# Local loopback auto lo iface lo inet loopback
And before reboot Armbian, we also need to set a **FIXED** IP address (Here in my case: 192.168.0.36) for the device with the static MAC address you just specified (Here in my case: **d2:d0:78:47:06:b3**).
## 3. Reboot Armbian
Now, reboot Armbian.
```console root@nanopineo:~# sudo reboot
After a while, ssh into Armbian with created user
nanopineo:
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:
#1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility.
[sudo] password for nanopineo: Hit:1 http://security.debian.org stretch/updates InRelease Hit:4 http://apt.armbian.com stretch InRelease Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease Hit:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease Hit:5 http://cdn-fastly.deb.debian.org/debian stretch-backports InRelease Hit:6 http://cdn-fastly.deb.debian.org/debian stretch Release Reading package lists... Done Building dependency tree Reading state information... Done 3 packages can be upgraded. Run 'apt list --upgradable' to see them. nanopineo@nanopineo:~$ apt list --upgradable Listing... Done linux-dtb-next-sunxi/stretch 5.41 armhf [upgradable from: 5.38] linux-image-next-sunxi/stretch 5.41 armhf [upgradable from: 5.38] tzdata/stable-updates 2018c-0+deb9u1 all [upgradable from: 2017c-0+deb9u1] nanopineo@nanopineo:~$ sudo apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: linux-dtb-next-sunxi linux-image-next-sunxi tzdata 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 20.2 MB of archives. After this operation, 240 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://cdn-fastly.deb.debian.org/debian stretch-updates/main armhf tzdata all 2018c-0+deb9u1 [264 kB] Get:2 http://apt.armbian.com stretch/main armhf linux-dtb-next-sunxi armhf 5.41 [175 kB] Get:3 http://apt.armbian.com stretch/main armhf linux-image-next-sunxi armhf 5.41 [19.7 MB] Fetched 20.2 MB in 14s (1387 kB/s) perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US.UTF-8", LC_ALL = (unset), LC_TIME = "en_CA.UTF-8", LC_MONETARY = "en_CA.UTF-8", LC_ADDRESS = "en_CA.UTF-8", LC_TELEPHONE = "en_CA.UTF-8", LC_MESSAGES = "en_US.UTF-8", LC_NAME = "en_CA.UTF-8", LC_MEASUREMENT = "en_CA.UTF-8", LC_IDENTIFICATION = "en_CA.UTF-8", LC_NUMERIC = "en_CA.UTF-8", LC_PAPER = "en_CA.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("en_US.UTF-8"). locale: Cannot set LC_ALL to default locale: No such file or directory Preconfiguring packages ... (Reading database ... 32833 files and directories currently installed.) Preparing to unpack .../tzdata_2018c-0+deb9u1_all.deb ... Unpacking tzdata (2018c-0+deb9u1) over (2017c-0+deb9u1) ... Preparing to unpack .../linux-dtb-next-sunxi_5.41_armhf.deb ... Unpacking linux-dtb-next-sunxi (5.41) over (5.38) ... Preparing to unpack .../linux-image-next-sunxi_5.41_armhf.deb ... update-initramfs: Deleting /boot/initrd.img-4.14.14-sunxi Removing obsolete file uInitrd-4.14.14-sunxi Unpacking linux-image-next-sunxi (5.41) over (5.38) ... Setting up linux-dtb-next-sunxi (5.41) ... Setting up tzdata (2018c-0+deb9u1) ... locale: Cannot set LC_ALL to default locale: No such file or directory
Current default time zone: 'Etc/UTC' Local time is now: Thu Mar 1 06:34:05 UTC 2018. Universal Time is now: Thu Mar 1 06:34:05 UTC 2018. Run 'dpkg-reconfigure tzdata'if you wish to change it.
Setting up linux-image-next-sunxi (5.41) ... update-initramfs: Generating /boot/initrd.img-4.14.18-sunxi update-initramfs: Converting to u-boot format nanopineo@nanopineo:~$
5. Kernel Doublechecking
Finally, we have the system and kernel doublechecked.
1 2 3 4 5 6 7 8 9 10 11
nanopineo@nanopineo:~$ uname -r 4.14.14-sunxi nanopineo@nanopineo:~$ uname -a Linux nanopineo 4.14.14-sunxi #1 SMP Thu Jan 25 12:20:57 CET 2018 armv7l GNU/Linux nanopineo@nanopineo:~$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.3 (stretch) Release: 9.3 Codename: stretch nanopineo@nanopineo:~$