Skip to content

Instantly share code, notes, and snippets.

@praveenbm5
Last active October 22, 2023 20:51
Show Gist options
  • 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:
@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?

@pneumus
Copy link

pneumus 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