I can compile my own OpenWrt Image

Have a look

Screenshot 2023-10-03 at 20.46.29

Screenshot 2023-10-03 at 20.46.54

Why build it myself?

For a long time, I am using OpenWrt image compiled by the master Esir. The first version I used from him is openwrt-gdq-winter[2022]-x86-64-generic-squashfs-legacy.img.gz, which is also the best version I used before. However, it is seems a little old as time goes, so I upgrade it to openwrt-gdq-v2[2023]-x86-64-generic-squashfs-combined.img.gz, also from Esir. It works barely satisfactory due to small bugs of custum DNS settings in openwrt.

Recently, I am tossing about self-hold tailscale(headscale). I need to install the tailscale client on my OpenWrt. But I failed as there is no enough space in overlay to do this. Expanding overlay, which I have done successfully on openwrt-gdq-winter[2022]-x86-64-generic-squashfs-legacy.img.gz followed by Esir’s tutorial, did not work fine in openwrt-gdq-v2[2023]-x86-64-generic-squashfs-combined.img.gz.

First of all, I decided to downgrade to openwrt-gdq-winter[2022]-x86-64-generic-squashfs-legacy.img.gz. Nevertheless, it is not convenient to upgrade software such as OpenClash due to squash file system. The Esir also suggested us to build it ourself so that we can configure the size as large as we like. So this is time for me to built a OpenWrt Image for myself, especially a large overlay size.

The failure in the past

In fact, I have tried to do compiling long time ago, ending with failure absolutely. I remember it clearly, due to the poor internet environment in China mainland, the download process takes a long time. And critical mistake I made is I forgot to resize my virrual machine, which crushed due to the only 20GB disk size. After that, I did not try it anymore until now. I also recalled that one of my friend, Sun suggested me that I should compile it on a oversea VPS, which is quite right proved by myself now.

The platform for compiling

How about vitual machine

The compiling process is a great power-consuming one, which need my MBP running all the time. And with my experience before, I would not thinking one time more about this solution.

How about Github Actions

In the beginning, I also think about the compile solution by Github Actions in some posts. But a Youtuber pointed out the fatal drawback of Github Actions——it only has 14 GB space for free, which could lead to crush like me before. Thanks to him for saving my time. So I rent VPS paying by hour to compiling.

VPS aboard, the best solution

The progress of renting VPS is also twisting. To begin with, I just using Vultr, the minitum recharge is 5$. The good news is that it give me 50$ bonus with 1 month time limit. Though 50$ more free, I still tried my best to save money. So I start and shutdown 10 VPS just in one day( I love switch high performance time by time, which also wasted my chances.). Which up to the platform’s limit. I did not know this rule at all. The result was the next day morning, I could not open a new machine though I have enough remaining fee.

Bad morning. I do not want to wait anymore. So I decide a new VPS server called LightNode. The minimum recharge is 10$, not a small size. I had no choice but to pay it. They also gave me 5$ gift with 365 days limit. And finally I success using VPS on this platform.

Compile process

We just need to follow the instruction in https://github.com/coolsnowwolf/lede.

Most of us just need change the settings of Luci-Application, in which almost all plugin are.

Do not change targe image settings, as the Lean has set it properly. I failed more than 3 times for changing this.

My extra plugin is using luci-theme-argon and luci-app-argon-config. In order to distinguish them from official package, we need do some tricky things.

For luci-theme-argon

Add it following instruction.

After we git clone it, we need to change the directory name to another one, like luci-theme-argone.

For luci-app-argon-config

Add it following instructin.

After we git clone it done, we need to edit the Makefile to change the PKG_NAME:=luci-app-argon-config as PKG_NAME:=luci-app-argone-config.

For OpenClash

Add it following instruciton.

Custom settings

Changing ip address

1
vim lede/package/basefiles/files/bin/config_generate

2022042303550089

Add compile author info

1
vim package/lean/autocore/files/x86/index.htm

2022042304114242

1
2
<tr><td width="33%"><%:Compiler author%></td><td>Doublefire.Chen</td></tr>
<tr><td width="33%"><%:Compiler date%></td><td>30th September, 2023</td></tr>

Reference