Skip to content

Instantly share code, notes, and snippets.

@praveenbm5
Last active October 22, 2023 20:51
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • Save praveenbm5/3c81692e6b2b651bb450fb7fc45dff4d to your computer and use it in GitHub Desktop.
Save praveenbm5/3c81692e6b2b651bb450fb7fc45dff4d to your computer and use it in GitHub Desktop.
OpenWRT on Orange Pi Zero using Armbian uBoot and Kernel
Guide:
1. Install Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a uSD card using Win32DiskImager or Ubuntu Disk Image Writer
2. (Optional) Mount the uSD in Ubuntu Laptop and expand the partition using GParted.
3. Delete everything from uSD except /boot, /lib/modules and /lib/firmware.
4. Mount openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt
#mount -o loop openwrt-15.05.1-sunxi-root.ext4 /mnt/openwrt
5. Copy over the contents of /mnt/openwrt to the root of uSD by merging folders when prompted.
6. Modify /etc/init.d/boot and add 'ulimit -n 10000' before '/sbin/kmloader' command (line39).
7. Change directory to /lib/modules/3.4.113-sun8i - "#cd /lib/modules/3.4.113-sun8i"
8. Create link-ko.sh - "#touch link-ko.sh"
9. Edit link-ko.sh - "#nano link-ko.sh"
10. Copy the below contents into that file, save (Ctrl + O) and close (Ctrl + X) file.
for x in `find -name *.ko`
do
ln -s $x .
done
11. Then make link-ko.sh executable - "#chmod +x link-ko.sh"
12. Execute link-ko.sh - "#./link-ko.sh"
13. To enable WiFi - #printf "xradio_wlan\nxradio_wlan" >> /etc/modules.d/xradio_wlan
14. Replace Lan section in /etc/config/network with the below. (You can customize the below to suit you LAN and Router configuration.)
Option 1:
config interface 'lan'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.1.1'
option ifname 'eth0'
Option 2:
config interface 'lan'
option proto 'dhcp'
option ifname 'eth0'
15. Transfer the uSD to OPiZero and power up.
16. 'telnet 192.168.1.1', update password using '#passwd root' and then exit.
If you are unable to login,
wait for 10 mins to complete first boot up,
switch off OPiZero,
remove uSD and
repeat steps from network configuration using /etc/config/network
17. 'ssh 192.168.1.1' - peace.
Notes:
@dodolloh
Copy link

dodolloh commented Jan 5, 2017

nice.....
thx bro

@praveenbm5
Copy link
Author

Hello Dodolloh,

I have elaborated the previous step 7 into finer steps. Let me know if you still run into difficulties.

@hillz2
Copy link

hillz2 commented Jan 26, 2017

What are the bugs you've found so far ?

@darkcurrent
Copy link

Hi @praveenbm5,

I'am stuck at step 14 because there is no file named "network" in the directory of "/etc/config/" on the uSD card.

I think that the only difference I made was using "Armbian5.25Orangepizero_Ubuntu_xenial_default_3.4.113.img" image instead of your image you used in your document "Armbian5.24.161216Orangepizero_Ubuntu_xenial_3.4.113.img"

What do you suggest in this point?

Regards,

capture

@darkcurrent
Copy link

darkcurrent commented Feb 18, 2017

Hi again,

  1. I can not find "network" file so I created a file named "network" and put the static and dhcp config rows as you mentioned in step 14.
  2. When i transfer uSD to my orangepi zero and power it, ethernet lights gets off state in a short while and the leds on da orangepi zero board keep itself on (green led).
  3. Telnet and SSH connections wont work neither because there is no ethernet connection after powering up the board as i stated in second article

So what is your opinion @praveenbm5?

If you could help me, I'd appreciate it.

Regards,

@zhenpengtang
Copy link

would u share the /etc/config/wireless and network files

@EUA
Copy link

EUA commented Apr 22, 2017

This also works with LEDE
Only missing thing is WiFi interface at Luci.
Do you know that how to enable it?
PS: Here is how to do. :)

15. Enable wifi radio device, put this into /etc/config/wireless:

config wifi-device radio0
        option type     'mac80211'
        option channel  'auto'
        option path 'platform/soc/1c10000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'

Unfortunately, only could scan the WiFi. Not connects or AP mode via Luci, yet...

@Niagara104
Copy link

step 10 : why create a script "link-ko.sh ?
when you run the script "link-ko.sh" > error

@podi-putha
Copy link

Hi Guys, I am dying to know how to use this as AP mode via Luci.. I've already taken a little effort. But still no use. Can somebody help me ?

@adrianmihalko
Copy link

Guys, I am following the guide, but I am unable to boot:

Begin: Running /scripts/init-bottom ... done.
mount: mounting /run on /root/run failed: No such file or directory
run-init: /sbin/init: No such file or directory
[ 3.640294] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

/root/run is empty, /sbin/init is exist.

What's wrong here? Or could you please upload a working image?

@sonus89
Copy link

sonus89 commented Oct 23, 2017

Do you have a working image?

@fractalspace
Copy link

Here are pre-built OpenWrt flash images from orangepi website:
http://www.orangepi.org/downloadresources/

@lepz0r
Copy link

lepz0r commented Sep 26, 2019

can you port newer openwrt to orange pi zero?

@kinggx9
Copy link

kinggx9 commented Dec 3, 2019

I am using version 18 (Tried 15)
But still not successful
Don’t show wifi wireless network and don’t work

I have configured /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 'fdd0:3fab:1a10::/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'

config interface 'wwan'
option proto 'dhcp'

I have configured /etc/config/network

config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/sunxi-mmc.1/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option htmode 'HT20'
option disabled '0'
option channel '2'
option txpower '20'
option country '00'
config wifi-iface
option network 'wwan'
option ssid 'AP CLIENT'
option encryption 'psk2'
option device 'radio0'
option mode 'sta'
option bssid 'C0:XX:E1:C1:E3:XX'
option key 'password'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment