The officially official Devuan Forum!

You are not logged in.

#1 2019-11-17 03:22:22

Registered: 2019-11-14
Posts: 183  

[ ARMHF ] build for Olimex OlinuXino Lime2

Hello All,
This is the aarch32( armhf ) counterpart, for Linux Sunxi, Allwinner A20 Hardware..
In the next Iterations, will be also there  a 'Desktop' build type..
In this case, there is a v0.5beta Server build.

Features & Versions:

1) - Arm Trusted Firmware  - Mainline ( built for armhf )
      U-boot boot-loader       - v201910 ( built for armhf )
2) - Linux Kernel                - Stable 5.7.0 + Lima driver + Cedrus driver ( built for armhf )
3) - UserSpace                  - Devuan Beowulf ( for armhf )

4) - Changelog                   - Kernel Update, HDMI Audio driver, UPS Monitoring, WireGuard VPN Kernel Driver
5) - Known Problems         - Activating Zram, doesn't hapen automatically, but it should need more investigation..

1)  BootLoader( aarch32.. only u-boot )

Disk Partitioning scheme:

# parted /dev/mmcblk0
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  101MB   99.6MB  primary  ext2
 2      101MB   1500MB  1399MB  primary  ext4

a)   - Bootloader( Arm Trusted Firmware + U-Boot ), is between [ beginning - 1st partition ]( starting at sector 16( 8KiB ), til 1MiB )
  a1) - The Bootloader will search for a file called 'boot.scr', and after initialise the u-boot environment, will execute that script..
  a2) - In  'boot.scr', for this image, it will point to 'Olimex Olinuxino Lime2' Device Tree Binary File by default( was tested there.. )..
  a3) - IF you have other board than  'Olimex Olinuxino Lime2', please Read Bellow in the 'Notes Section'..   
b)   - 1st Partition( after BootLoader ) is mounted as  '/boot'
c)   - 2nd Partition is mounted as rootfs '/'

The Bootloader in a) usually takes ~600KiB..
Each time a bootloader is built, all area [ 8KiB - 1MiB ], needs to be clean first( so that you can flash the new bootloader.. because could still be there any bits of the previous one.. which could lead to unpredictable consequences.. ).

If you have Other Board than 'Olimex Olinuxino Lime2', situation described in a3):
The 'boot.cmd' script( format, Human Readable ):

# Send debug info to uart, and also display
setenv stdout serial,vga
setenv stderr serial,vga
setenv bootargs debug=on console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait panic=15
setenv fdtfile sun7i-a20-olinuxino-lime2.dtb
load mmc 0:2 0x43000000 usr/lib/linux-image-5.7.0/${fdtfile}
load mmc 0:1 0x42000000 vmlinuz
bootz 0x42000000 - 0x43000000

Write this Image, to a sd-card.
Mount 1st Partition in '/mnt',

mount /dev/sdb1 /mnt

Then change the 'boot.cmd' script to point to your board..
# You can find a list of supported boards 'dtb' files in: '/usr/lib/linux-image-5.4.6'
# Edit the file 'boot.cmd', with 'vi' for example.
# change the line:

setenv fdtfile sun7i-a20-olinuxino-lime2.dtb


setenv fdtfile your_board.dtb

Save the file,
# Generate the real script file( binary ), 'boot.scr'

mkimage -C none -A arm -T script -d /mnt/boot.cmd /mnt/boot.scr


2)  Linux Kernel

There are 3 packages installed( in the future will be at least the graphics drivers more.. ):

# dpkg -l |grep -E "(linux-.*(headers|image|libc-dev))"
ii  linux-headers-5.7.0          5.7.0-5                      armhf        Linux kernel headers for 5.7.0 on armhf
ii  linux-image-5.7.0            5.7.0-5                      armhf        Linux kernel, version 5.7.0
ii  linux-libc-dev:armhf         5.7.0-5                      armhf        Linux support headers for userspace development

The target will be to reach, at least the Linux kernel 5.{7,8}( since there still are few things that need support, but not much.. ), and of course.. work improve the Device Tree Bindings, for each board, when possible.. most important things missing HDMI Audio Codec( see 5.d), included now ), and keypad driver..

3)  UserSpace -Users & Passwords:

a) root      - password 'toor'
b) devuan - password 'devuan'

SSH is enabled, so that you can login, but root login, is disabled, you should login as 'devuan', only then switch to 'root', if you want to.. for that,
After Login as 'devuan', issue:

sudo su -

And type your 'devuan' password, that's it..

4)  ChangeLog

a) -  Migration to Devuan Beowulf
b) - sun4i_ss prng driver( no more need to use /dev/urandom in rng-tools config.. )
c) - Realtek Network Driver( not generic one.. )
d) - Micrel Network Driver( Newer Boards come with it.. )
e) - Audio sun4i_codec Driver.. see Section 5d)
f)  - Kernel Update to 5.7.0
g) - sun4i-csi - Camera{ BT656, Parallel }, activated
h) - Hardware VPU Decode Acceleration, now supports( MJPEG, MPEG2, H.264, HEVC/H.265 )
i) - 3d Graphics Kernel Driver( Lima )
j) - UPS Monitoring Script
k) - WireGuard VPN Kernel Driver( present in Linux since 5.6 kernel )

5)  Known Problems or Things to test

a) - Activating Zram, doesn't happen automatically( but it should.. need more investigation.. ).
b) - Testing is needed, on camera interfaces { BT656, Parallel } merged in Kernel 5.5.0 for Allwinner A20 drivers sun4i-csi ..
c) - Compile V4l2 Cedrus driver, test it via libvdpau..
d) - HDMI Audio Codec, was submitted in January 2020, Included here as a V3 patch!Tested and Working OK!
e) - Lima Kernel Driver, needs the Userspace Kernel Side( Lima Mesa Driver )
f) - Tests on UPS monitoring Script, shows it his working OK!
g) - WireGuard VPN, needs Compilation of Userspace tools, and testing..

For this image, to reach more Supported Hardware and Users, your help is also needed smile
Testing this image, posting your feedback, and improvements..

$ sha256sum devuan_beowulf_3.0.0_armhf_olinuxino_lime2_0.5.img.xz 
9ca1c9293ac6a0edea431d04b4face2fbbe914c1422eb5704da4864c706a4ae9  devuan_beowulf_3.0.0_armhf_olinuxino_lime2_0.5.img.xz

Best Regards,

Last edited by tuxd3v (2020-06-04 20:55:49)

Best Regards,


#2 2020-05-20 04:33:56

Registered: 2019-11-14
Posts: 183  

Re: [ ARMHF ] build for Olimex OlinuXino Lime2

The '/etc/update-motd.d/20-monitor', for OLime2
This piece of the puzzle was still missing smile
Yeah UPS Monitoring working..

~# ls -l /etc/update-motd.d/20-monitor
lrwxrwxrwx 1 root root 22 May 21 14:37 /etc/update-motd.d/20-monitor -> /usr/local/bin/monitor
~# which monitor

Battery Disconnected:

Last edited by tuxd3v (2020-06-04 19:34:13)

Best Regards,


Board footer