5 5
hyphop

Building OpenWRT images for Orange Pi Zero with the Armbian kernel

Recommended Posts

i have test this device and i can say wifi can work fine without delays

 

i use kernel + firmware from armbian + enveroment from openwrt

 

load manually wifi modules  only!!!!

xradio_wlan

root@MusicBox:~# lsmod
mac80211 358445 1 xradio_wlan
xradio_wlan 210530 0 

i have normal ping at any time !!!

64 bytes from oc2 (10.20.20.2): icmp_req=559 ttl=64 time=1.15 ms
64 bytes from oc2 (10.20.20.2): icmp_req=560 ttl=64 time=1.34 ms
64 bytes from oc2 (10.20.20.2): icmp_req=561 ttl=64 time=1.41 ms
64 bytes from oc2 (10.20.20.2): icmp_req=562 ttl=64 time=1.39 ms
64 bytes from oc2 (10.20.20.2): icmp_req=563 ttl=64 time=1.86 ms

Share this post


Link to post
Share on other sites

 

i have test this device and i can say wifi can work fine without delays

 

i use kernel + firmware from armbian + enveroment from openwrt

 

load manually wifi modules  only!!!!

xradio_wlan

root@MusicBox:~# lsmod
mac80211 358445 1 xradio_wlan
xradio_wlan 210530 0 

i have normal ping at any time !!!

64 bytes from oc2 (10.20.20.2): icmp_req=559 ttl=64 time=1.15 ms
64 bytes from oc2 (10.20.20.2): icmp_req=560 ttl=64 time=1.34 ms
64 bytes from oc2 (10.20.20.2): icmp_req=561 ttl=64 time=1.41 ms
64 bytes from oc2 (10.20.20.2): icmp_req=562 ttl=64 time=1.39 ms
64 bytes from oc2 (10.20.20.2): icmp_req=563 ttl=64 time=1.86 ms

 

 

Hello there,

 

I got my Opi Zero today and I am trying to do exactly what you did.

 

Run OpenWRT with a custom kernel/modules that support this board. Can you please share the method to build OpenWRT with support for OPi Zero.

 

It would be even better if you can share your image with the community. I am sure many like me are looking for it.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Hello there,

 

I got my Opi Zero today and I am trying to do exactly what you did.

 

Run OpenWRT with a custom kernel/modules that support this board. Can you please share the method to build OpenWRT with support for OPi Zero.

 

It would be even better if you can share your image with the community. I am sure many like me are looking for it.

 

Thanks in advance.

 

You don't need to build OpenWRT yourself. Just use sunxi img from here: https://downloads.openwrt.org/chaos_calmer/15.05.1/sunxi/generic/ + /boot/ and /lib/modules/ from Armbian.

Share this post


Link to post
Share on other sites

Without u-boot suitable for H3 OpenWRT will not be able to boot and then it's a way better idea to rely on mainline kernel with the fixed xradio_wlan driver from there. Trying to use OpenWRT with the smelly 3.4.x Android kernel is not a good idea.

 

PS: I moved your posts since off-topic stuff belongs to 'Free' forum.

Share this post


Link to post
Share on other sites

Care to explain even further?

Haven't done things like this before

 

Thanks in advance

 

What I did is simple:

1. Install Armbian

2. delete everything except /boot and /lib/modules from rootfs

3. copy over OpenWRT rootfs 

 

And that's it. This means I use u-boot, kernel, initrd and all settings from Armbian, only userland from OpenWRT. 

 

And one minor tweak. Since how OpenWRT organize kernel modules is different, I have to do following:

1. symlink all .ko files to /lib/modules/3.4.112 using

for x in `find -name *.ko`
do
    ln -s $x .
done

2. OpenWRT's /sbin/kmodloader seems trying to open all ko files at once for stat and Armbian has a lot of modules under /lib/modules/3.4.112 dir so kmodloader will run out of file handle. I'm lazy to try to figure out which one is needed, so I simply change ulimit before kmodloader is ran in /etc/init.d/boot. Add one line at line 40:

ulimit -n 10000

Share this post


Link to post
Share on other sites

Without u-boot suitable for H3 OpenWRT will not be able to boot and then it's a way better idea to rely on mainline kernel with the fixed xradio_wlan driver from there. Trying to use OpenWRT with the smelly 3.4.x Android kernel is not a good idea.

 

PS: I moved your posts since off-topic stuff belongs to 'Free' forum.

 

I did try to build mainline kernel last week (using Igor's script) but didn't find xradio_wlan driver. Did I miss something?

Share this post


Link to post
Share on other sites

Without u-boot suitable for H3 OpenWRT will not be able to boot and then it's a way better idea to rely on mainline kernel with the fixed xradio_wlan driver from there. Trying to use OpenWRT with the smelly 3.4.x Android kernel is not a good idea.

 

PS: I moved your posts since off-topic stuff belongs to 'Free' forum.

 

i have build small openwrt image already !!! its work fine !!! sure just for test only ))) not have any problem with pings ! but i use same armbian kernel !

Share this post


Link to post
Share on other sites

i have build small openwrt image already !!! its work fine !!! sure just for test only ))) not have any problem with pings ! but i use same armbian kernel !

Folks, please let's start to use this forum in a productive way. It's not about Armbian but about collecting knowledge and joining development efforts.

 

What about posting a simple tutorial how to create an OpenWRT image based on Armbian? Next step: suggestion how to 'mis-use' Armbian's build system to produce 'foreign' OS Images?

 

We currently support +40 SBC with our build system. And we *CARE* about settings and squeezing the max out of the boards unlike other projects (DietPi as a negative example). And when you look around the wheel gets reinvented every second. OpenWRT is one example, Kali Linux or Volumio are others. So sad.

Share this post


Link to post
Share on other sites

Folks, please let's start to use this forum in a productive way. It's not about Armbian but about collecting knowledge and joining development efforts.

 

What about posting a simple tutorial how to create an OpenWRT image based on Armbian? Next step: suggestion how to 'mis-use' Armbian's build system to produce 'foreign' OS Images?

 

We currently support +40 SBC with our build system. And we *CARE* about settings and squeezing the max out of the boards unlike other projects (DietPi as a negative example). And when you look around the wheel gets reinvented every second. OpenWRT is one example, Kali Linux or Volumio are others. So sad.

 

I'm not familiar with Armbian's build system other than use it for several times. But my post #6 above can surely produce a working OpenWRT image manually. Maybe someone can integrate it into Armbian's build system.

Share this post


Link to post
Share on other sites

Folks, please let's start to use this forum in a productive way. It's not about Armbian but about collecting knowledge and joining development efforts.

 

What about posting a simple tutorial how to create an OpenWRT image based on Armbian? Next step: suggestion how to 'mis-use' Armbian's build system to produce 'foreign' OS Images?

 

We currently support +40 SBC with our build system. And we *CARE* about settings and squeezing the max out of the boards unlike other projects (DietPi as a negative example). And when you look around the wheel gets reinvented every second. OpenWRT is one example, Kali Linux or Volumio are others. So sad.

 

we talking about same wifi module which work in openwrt fine !!! i meen may be u need fix problem in your awesome armbian distr )))) ???

Share this post


Link to post
Share on other sites
we talking about same wifi module which work in openwrt fine !!! i meen u need fix problem in your awesome armbian distr ))))

 

If it works in Openwrt with our kernel it must work also in Armbian. There is nothing that we need to fix.

 

The only diff could be firmware ... just install our full packages and it will most likely work.

apt-get install armbian-firmware-full

If you are talking about some openwrt in general, than keep in mind that this is router distro and their main objective is network stack. Our focus / support ends with on board phy.

Share this post


Link to post
Share on other sites

If it works in Openwrt with our kernel it must work also in Armbian. There is nothing that we need to fix.

 

The only diff could be firmware ... just install our full packages and it will most likely work.

apt-get install armbian-firmware-full

If you are talking about some openwrt in general, than keep in mind that this is router distro and their main objective is network stack. Our focus / support ends with on board phy.

 

must work same but not working same ! i think some another loaded modules or cpu performance or some another tuning from distr make this troubles !

 

i choose openwrt for testing  because its very clear for understand what wrong - opposite huge last debian distros

 

any way tnx for your works

Share this post


Link to post
Share on other sites

 

What I did is simple:

1. Install Armbian

2. delete everything except /boot and /lib/modules from rootfs

3. copy over OpenWRT rootfs 

 

And that's it. This means I use u-boot, kernel, initrd and all settings from Armbian, only userland from OpenWRT. 

 

And one minor tweak. Since how OpenWRT organize kernel modules is different, I have to do following:

1. symlink all .ko files to /lib/modules/3.4.112 using

for x in `find -name *.ko`
do
    ln -s $x .
done

2. OpenWRT's /sbin/kmodloader seems trying to open all ko files at once for stat and Armbian has a lot of modules under /lib/modules/3.4.112 dir so kmodloader will run out of file handle. I'm lazy to try to figure out which one is needed, so I simply change ulimit before kmodloader is ran in /etc/init.d/boot. Add one line at line 40:

ulimit -n 10000

This is very interesting info. Thank's for that. I am using OpenWrt from some time for my LamoboR1. Armbian is great project, but for server purposes i couldn't find some useful and user friendly firewall (ip tables), router like solution. All is crazy command line chains i have to describe manually for simplest things even, or outdated and functionally limited GUI-s. Which is not related to Armbian itself, of course. OpenWrt is simple enough in firewall part and easy for maintaining and monitor. So i sacrifice Desktop and multimedia part in a favour of current needs.

The problem is - i try to make some OrangePi-s of mine, something like backup router and although Orange Pi Plus and 2 is supported by OpenWrt i couldn't build image that can work with OrangePi PC for example. I try to replace bootable part with the one from Armbian and Loboris images, but non bootable again. But never thought of doing it the opposite way :). What i don't understand is the part with relinking .ko files. Maybe it's a dumb question, but you symlink .ko files to what exactly?

And this OpenWrt rootfs you using, for what kernel version is built? I tried 4xxxx kernel and it worked ok, but OpenWrt packages reported wrong version and was uninstallable, only prebuilt worked. So i am with kernel 3.18.29 now. But this combination with Armbian boot part, is it make OpenWrt packages compatible from OpenWrt repos, or need to be prebuilt?

Share this post


Link to post
Share on other sites

This is very interesting info. Thank's for that. I am using OpenWrt from some time for my LamoboR1. Armbian is great project, but for server purposes i couldn't find some useful and user friendly firewall (ip tables), router like solution. All is crazy command line chains i have to describe manually for simplest things even, or outdated and functionally limited GUI-s. Which is not related to Armbian itself, of course. OpenWrt is simple enough in firewall part and easy for maintaining and monitor. So i sacrifice Desktop and multimedia part in a favour of current needs.

The problem is - i try to make some OrangePi-s of mine, something like backup router and although Orange Pi Plus and 2 is supported by OpenWrt i couldn't build image that can work with OrangePi PC for example. I try to replace bootable part with the one from Armbian and Loboris images, but non bootable again. But never thought of doing it the opposite way :). What i don't understand is the part with relinking .ko files. Maybe it's a dumb question, but you symlink .ko files to what exactly?

And this OpenWrt rootfs you using, for what kernel version is built? I tried 4xxxx kernel and it worked ok, but OpenWrt packages reported wrong version and was uninstallable, only prebuilt worked. So i am with kernel 3.18.29 now. But this combination with Armbian boot part, is it make OpenWrt packages compatible from OpenWrt repos, or need to be prebuilt?

1. About relinking .ko files. It's just a quick hack because I don't want to figure out why OpenWRT's kernel module is organized that way. I just linked all ko files to /lib/modules/3.4.113/. Just check OpenWRT dir layout. 

2. This solution has nothing to do with OpenWRT's own kernel image an kernel module. It's just Armbian's kernel 3.4.113. If you find yourself not able to understand this maybe you need to catch up with some basic Linux concepts. 

Share this post


Link to post
Share on other sites

1. About relinking .ko files. It's just a quick hack because I don't want to figure out why OpenWRT's kernel module is organized that way. I just linked all ko files to /lib/modules/3.4.113/. Just check OpenWRT dir layout. 

2. This solution has nothing to do with OpenWRT's own kernel image an kernel module. It's just Armbian's kernel 3.4.113. If you find yourself not able to understand this maybe you need to catch up with some basic Linux concepts. 

I am not sure i still understand 1, maybe if i going to do it i will catch it up. I am not into programming and can't figure it out what is "x" and if it links to directory /lib/modules/3.4.113/, or to contents of this directory. And i don't understand what to do with this code you show. Nevermind, as you see there is a lot i don't understand and have to learn :).

About 2, i think i wasn't very clear. I used to build original OpenWrt from some sources for LamoboR1 (A20), with OpenWrt 3xxxx and 4xxxx kernel. But sunxi packages from repos for OpenWrt report incompatibility for 4xxxx (OpenWrt) kernel, while those for 3xxxx kernel was ok. If i built image with these packages included they worked, but i can't install anything later. So my question was - are OpenWrt packages compatible with Armbian boot part and will be able to install from OpenWrt repos?

Share this post


Link to post
Share on other sites

 

What I did is simple:

1. Install Armbian

2. delete everything except /boot and /lib/modules from rootfs

3. copy over OpenWRT rootfs 

 

And that's it. This means I use u-boot, kernel, initrd and all settings from Armbian, only userland from OpenWRT. 

 

And one minor tweak. Since how OpenWRT organize kernel modules is different, I have to do following:

1. symlink all .ko files to /lib/modules/3.4.112 using

for x in `find -name *.ko`
do
    ln -s $x .
done

2. OpenWRT's /sbin/kmodloader seems trying to open all ko files at once for stat and Armbian has a lot of modules under /lib/modules/3.4.112 dir so kmodloader will run out of file handle. I'm lazy to try to figure out which one is needed, so I simply change ulimit before kmodloader is ran in /etc/init.d/boot. Add one line at line 40:

ulimit -n 10000

 

I did all the above and created a file system on a MicroSD card. Now after booting from this MicroSD card, how do I login to OpenWRT?

 

I tried connecting my laptops LAN to the LAN on OPiZero and I tried connecting the LAN on OPiZero to my Wifi Router's LAN. Either ways I am unable to connect to the OPZero with above OpenWRT image.

 

Please help.

 

Thank you.

Share this post


Link to post
Share on other sites

Here is the exact process I followed.

 

  1. Installed Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a 16 GB SD card using Win32DiskImager.
  2. Mounted the uSD in Ubuntu Laptop and expanded the partition using GParted.
  3. Deleted everything from uSD except /boot and /lib/modules
  4. Mounted openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt
  5. Copied over the contents of /mnt/openwrt to the root of uSD by merging folders when prompted.
  6. Modified /etc/init.d/boot and added ulimit -n 10000 before /sbin/kmloader command (line39).
  7. Executed the following code inside /lib/modules/3.4.113-sun8i 

    for x in `find -name *.ko`
    do
        ln -s $x .
    done
    
    

After executing the above steps, I transferred the uSD to OPiZero and booted from it. Then I connected the OPZ LAN to my wifi routers LAN socket and scanned my local network for new devices. Nothing showed up. Read on OpenWRT website that when OpenWRT is freshly installed, it assigns 192.168.1.1/24 to the LAN interface. I double checked that there is no IP conflict on my lan but still nothing showed up on my network scan. I was unable to ping or telnet to 192.168.1.1.

 

I even tried connecting my OPZ directly to my laptop using normal ethernet cable. I assigned my Laptop LAN 192.168.1.2/24 and tried to ping OPZ. Nothing happened. Since my laptop has Gbit ethernet I assumed a cross cable is not necessary since Gbit NIC can auto configure connects.

Share this post


Link to post
Share on other sites

Here is the exact process I followed.

 

  1. Installed Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a 16 GB SD card using Win32DiskImager.
  2. Mounted the uSD in Ubuntu Laptop and expanded the partition using GParted.
  3. Deleted everything from uSD except /boot and /lib/modules
  4. Mounted openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt
  5. Copied over the contents of /mnt/openwrt to the root of uSD by merging folders when prompted.
  6. Modified /etc/init.d/boot and added ulimit -n 10000 before /sbin/kmloader command (line39).
  7. Executed the following code inside /lib/modules/3.4.113-sun8i 

     

    for x in `find -name *.ko`
    do
        ln -s $x .
    done
    
    

After executing the above steps, I transferred the uSD to OPiZero and booted from it. Then I connected the OPZ LAN to my wifi routers LAN socket and scanned my local network for new devices. Nothing showed up. Read on OpenWRT website that when OpenWRT is freshly installed, it assigns 192.168.1.1/24 to the LAN interface. I double checked that there is no IP conflict on my lan but still nothing showed up on my network scan. I was unable to ping or telnet to 192.168.1.1.

 

I even tried connecting my OPZ directly to my laptop using normal ethernet cable. I assigned my Laptop LAN 192.168.1.2/24 and tried to ping OPZ. Nothing happened. Since my laptop has Gbit ethernet I assumed a cross cable is not necessary since Gbit NIC can auto configure connects.

 

Sorry there is another folder from Armbian that needs to be retained, which is /lib/firmware. 

 

To be sure whether it boots or had anything wrong during the process, you better have a TTL cable to attach to serial console. Otherwise you'd have to guess.

Share this post


Link to post
Share on other sites

Sorry there is another folder from Armbian that needs to be retained, which is /lib/firmware. 

 

To be sure whether it boots or had anything wrong during the process, you better have a TTL cable to attach to serial console. Otherwise you'd have to guess.

 

Already ordered one and waiting for delivery  :)

 

How did you connect to to the OPZ after preparing everything as above and booting OPZ with it?

Share this post


Link to post
Share on other sites

Sorry there is another folder from Armbian that needs to be retained, which is /lib/firmware. 

 

To be sure whether it boots or had anything wrong during the process, you better have a TTL cable to attach to serial console. Otherwise you'd have to guess.

 

Can you please share the openwrt image you are using for OPZ.... Will be of great help. Thank you.

Share this post


Link to post
Share on other sites

Here is the exact process I followed.

Thank you, your post appear to be the most useful here. But although i don't want to be mean, this topic appear to be one of those useless and time waste i already seen a lot. Someone brag to to something for himself, but no details and have to pull out words, one by one from his mouth. Well, i am happy for those persons success, but there was no need of this, really...

Share this post


Link to post
Share on other sites

Sorry there is another folder from Armbian that needs to be retained, which is /lib/firmware. 

 

To be sure whether it boots or had anything wrong during the process, you better have a TTL cable to attach to serial console. Otherwise you'd have to guess.

 

Still not working even after retaining the /lib/firmware folder from Armbian. Any more tips?

Share this post


Link to post
Share on other sites

Thank you, your post appear to be the most useful here. But although i don't want to be mean, this topic appear to be one of those useless and time waste i already seen a lot. Someone brag to to something for himself, but no details and have to pull out words, one by one from his mouth. Well, i am happy for those persons success, but there was no need of this, really...

 

I understand your frustration! Been there, felt that! but I beg to differ with you! Getting things up and running is a lot of hard work and more importantly guess work. Many a times we ourselves do not remember the exact steps taken.

 

Over above that, once its working and if we report the results back in a forum like this, it suddenly becomes a duty of us to write a NOOB (me :P ) friendly guide to reproduce the results.

 

By the way I sincerely thank those who report back their process diligently but I cannot condone those who do not. People get caught up in silly nuances of life in spite of best intentions   :) . Take a chill pill and hope for the best. You can ofcourse, borderline pester them for details.  :P

 

And try to contribute something back to the community yourself before asking it of others. People generally reciprocate.

 

I am taking the liberty to document DreamDreams process of porting OpenWRT to OPZ using Armbian uBoot and Kernel in this GitHub gist here - 

 

https://gist.github.com/praveenbm5/3c81692e6b2b651bb450fb7fc45dff4d

 

Please contribute... Everybody... its a humble request

Share this post


Link to post
Share on other sites

Still not working even after retaining the /lib/firmware folder from Armbian. Any more tips?

 

Without serial console there is not much more I can guess.

 

Does the LED on the board lid up? If it doesn't, it means it did not boot. If you boot into Armbian you will know which LED it is. 

Share this post


Link to post
Share on other sites

Without serial console there is not much more I can guess.

 

Does the LED on the board lid up? If it doesn't, it means it did not boot. If you boot into Armbian you will know which LED it is. 

 

Yes it does light up. Double blinks for a while and then lights up solid.

Share this post


Link to post
Share on other sites

Yes it does light up. Double blinks for a while and then lights up solid.

 

How did you config you OpenWRT network? suggest you put lan section like below and comment out wan section temporarily. Post your /etc/config/network will help diagnose. 

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.1.1'
	option ifname 'eth0'

Share this post


Link to post
Share on other sites

This is my /etc/config/network


config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd90:b7e4:45cc::/48'

config interface 'lan'
	option ifname 'eth0'
	option force_link '1'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
5 5