43

Lichee Nano Pi - Will it run Debian? - James Dawson

 3 years ago
source link: https://blog.jmdawson.co.uk/lichee-nano-pi-will-it-run-debian/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Lichee Nano Pi – Will it run Debian?

LicheePi-Nano-Board-Large.jpg?fit=1414%2C976&ssl=1

Introduction

The Lichee Nano Pi is a $6 Linux Development board powered by an Allwinner F1C100s ARM9 Processor. The Lichee Nano Pi features 32MB DDR integrated into SoC, a 16MB SPI Flash, an onboard TF Slot, and is able to be booted from a TF card. It is around the size of an SD card.

Whilst there are Linux images available for the Lichee Nano Pi it is recommended to use buildroot to build a very lightweight Linux install. There are some instructions on doing that here: https://github.com/unframework/licheepi-nano-buildroot

Buildroot is great for creating a light weight Linux install I wanted to see if I could run full Debian 10 on this tiny SBC. As there are no Debian images available for this board I had to get creative.

Building a Debian Image

If you would prefer to skip this and use a pre-built SD card click here.

Starting by downloading a Linux image designed for the Lichee Pi here: https://steward-fu.github.io/website/mcu/lichee-nano/flash_image.htm

I then flashed this to a micro SD card and expanded the rootfs partition from ~183MB to 1GB. I then removed the contents of the rootfs partition and created a Debian rootfs using multistrap:

We then need to create the multistrap config I created a file called buster.conf as follows:

[General]
unpack=true
bootstrap=Debian
aptsources=Debian

[Debian]
packages=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=buster

Then I ran the following:

multistrap -a armel -f buster.conf -d path/to/sd/card/mount

This created a bootable half finished Debian install, I then booted this up on the Lichee nano and connected using my DSD TECH USB to TTL Serial adapter and ran the following to finish setting up the packages:

dpkg --configure -a

This gave me a somewhat working install of Debian however no init system is included, I wanted to run full systemd and include a few packages.

The easiest way to do this without networking was to use debootstrap, on my Linux desktop I ran the following:

mkdir lichee_packages && debootstrap  --arch=armel --include=htop,procps,zsh,nano,systemd,isc-dhcp-client,ifupdown stable lichee_packages

This outputs a full chroot environment into the directory lichee_packages however I only wanted the .deb packages.

I ran the following to copy the .deb packages to the Lichee Nano’s SD Card:

cp lichee_packages/var/cache/apt/archive/*.deb /path/to/mounted/sd/card/root/

I then inserted the SD card into the Lichee Nano and booted it once again and installed the packages as follows:

dpkg -i /root/*.deb

This took a few minutes to complete although once finished I have a fully working Debian 10 install on my Lichee Nano.

I then created a swap file as 32MB of RAM does not go far!:

image-1.png?resize=750%2C363&ssl=1

dd if=/dev/zero of=/var/swapfile bs=1M count=256 &&
chmod 600 /var/swapfile &&
mkswap /var/swapfile &&
echo /var/swapfile none swap defaults 0 0 |  tee -a /etc/fstab &&
swapon -a

One more reboot and we’re good to go!

image.png?resize=750%2C132&ssl=1

Debian SD Card image

I understand that most people probably don’t want the hassle of building a custom SD card image for their Lichee Nano so I have provided one here

This can be flashed using etcher, dd or any other image burning tool extract the image file first.

Conclusion

Was this worthwhile? I’d say so, I can now easily install packages on my Lichee Nano by connecting it to my Pluggable OTG Ethernet Adapter and whilst Debian is heavy in comparison to a buildroot install it still only uses 7 MB of RAM at idle!

Whilst this should be an almost fully compatible Debian install we are not using the Debian Kernel or Debian uboot.
If anyone wants to try this themselves the Lichee Nano is available on aliexpress for just over $6

Like this:

Loading...
Published 1st January 2021By James
Categorised as Hardware, Linux

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK