Compiling Machine
$ uname -a
Linux codespaces_a8953f 5.4.0-1067-azure #70~18.04.1-Ubuntu SMP Thu Jan 13 19:46:01 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Target Machine
# uname -a
Linux LOGI 3.14.79 #0 SMP Fri Feb 1 20:24:57 2019 mips PandoraBox
# cat /etc/openwrt_release
DISTRIB_ID="PandoraBox"
DISTRIB_CODENAME="19.02"
DISTRIB_RELEASE="19.02"
DISTRIB_VERSION="4802"
DISTRIB_REVISION="2019-02-01-git-93f2639a7"
DISTRIB_TARGET="ralink/mt7621"
DISTRIB_DESCRIPTION="PandoraBox 19.02 2019-02-01-git-93f2639a7"
DISTRIB_TAINTS="no-all busybox"
DISTRIB_MANUFACTURER="PandoraBox-Team"
DISTRIB_MANUFACTURER="http://www.pandorabox.com.cn"
# cat /proc/cpuinfo
system type : MediaTek MT7621
machine : Phicomm K2P
processor : 0
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
core : 0
VPE : 0
VCED exceptions : not available
VCEI exceptions : not available
# ...
Install Build Tools
$ sudo apt update
$ sudo apt install -y build-essential ccache flex gawk gettext git liblzma-dev libncurses5-dev libssl-dev python subversion u-boot-tools unzip wget xsltproc zlib1g-dev upx-ucl
Download ToolChain
$ TOOL_CHAIN_LOCATION=http://downloads.pangubox.com:6380/pandorabox/19.02/targets/ralink/mt7621/
$ TOOL_CHAIN_NAME=PandoraBox-SDK-ralink-mt7621_gcc-5.5.0_uClibc-1.0.x.Linux-x86_64-2019-02-01-git-0231ad4b5
$ curl -LO ${TOOL_CHAIN_LOCATION}${TOOL_CHAIN_NAME}.tar.xz
$ tar xf ${TOOL_CHAIN_NAME}.tar.xz
$ cd $TOOL_CHAIN_NAME
Install Dependencies
$ echo "src-git packages https://github.com/openwrt/packages.git" >> feeds.conf.default
$ ./scripts/feeds update -a
$ ./scripts/feeds install -a
Add Custom Packages
$ git clone https://github.com/WingLim/pandorabox-k2p-package.git package/k2p
$ # Change the version number in package/k2p/frpc/Makefile.
Select Packages
$ make menuconfig
$ #Select [Network ---> Web Servers/Proxies ---> <*> frpc]
Start Building
$ make package/k2p/frpc/{clean,compile} V=s
Install Packages
$ scp bin/packages/mipsel_1004kc_dsp/base/frpc_0.39.0-1_mipsel_1004kc_dsp.ipk home:/tmp
$ ssh home
# cd /tmp
# opkg install frpc_0.39.0-1_mipsel_1004kc_dsp.ipk
# rm -f frpc_0.39.0-1_mipsel_1004kc_dsp.ipk
References