I build and run it on MiWifi Router 3G (mips MT7621) device, OpenWrt OS #2271
Replies: 7 comments 16 replies
proxychains4 wget https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt7621/openwrt-sdk-23.05.4-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz
# or download from tsinghua tuna mirror cdn:
wget https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/23.05.4/targets/ramips/mt7621/openwrt-sdk-23.05.4-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz
tar -xJf openwrt-sdk-23.05.4-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz
cd openwrt-sdk-23.05.4-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64
# cd home/mac/SSoftwareFiles/openwrt-sdk/openwrt-sdk-23.05.4-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64
pwd
# 寻找工具链目录
export SDK_PATH=$(pwd)
export TOOLCHAIN_PATH=$SDK_PATH/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl
export PATH=$TOOLCHAIN_PATH/bin:$PATH
export STAGING_DIR=$SDK_PATH/staging_dir
export SYSROOT=$SDK_PATH/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl
cd ..
proxychains4 git clone https://github.com/fastfetch-cli/fastfetch
cd fastfetch
# cd /home/mac/SSoftwareFiles/fastfetch
pwd
mkdir build_mips && cd build_mips
rm -rf ./*
cmake .. \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=mips \
-DCMAKE_C_COMPILER=mipsel-openwrt-linux-gcc \
-DCMAKE_CXX_COMPILER=mipsel-openwrt-linux-g++ \
-DCMAKE_STAGING_PREFIX=$SDK_PATH/staging_dir/target-mipsel_24kc_musl \
-DCMAKE_FIND_ROOT_PATH=$SYSROOT \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DCMAKE_C_FLAGS="--sysroot=$SYSROOT -msoft-float -mips32r2 -nostdinc -I$SYSROOT/include -I$SYSROOT/usr/include" \
-DENABLE_ZLIB=OFF \
-DENABLE_DRM=OFF -DENABLE_X11=OFF -DENABLE_WAYLAND=OFF -DENABLE_VULKAN=OFF -DENABLE_DBUS=OFF -DENABLE_PCI=OFF
make -j$(nproc)
# 瘦身
ls -lh ./fastfetch
mipsel-linux-gnu-strip ./fastfetch
ls -lh ./fastfetch
cp ./fastfetch ./fastfetch-linux-mipsel
scp ./fastfetch-linux-mipsel root@192.168.5.1:/usr/bin/fastfetch |
|
2分钱谢了。。。 |
|
Shell 那行是啥情况。你试下 |
|
Cudy WR3000E (v1) ..,,.. root@REDACTED
,;odOMMMMMMMMObo:. ------------
,odOMMMMMO""''""OMMMMMObo. OS: OpenWrt 24.10.7 aarch64
.dMMMM" .,,. "OMMMb, Host: Cudy WR3000E v1
'0" ,;ddMMMMMMMMbb:. "0' Kernel: Linux 6.6.141
oOMMMMO""''""OMMMMOo Uptime: 7 days, 14 hours, 9 mins
;. '0" .,,. "0' .: Shell: ash 1.36.1
.OMM* .odMMMMMMbo. *MMO. Terminal: dropbear
MMMO "0"````"0" OMMM CPU: mt7981 (2)
iOMM .oo. MMMi Memory: 121.98 MiB / 234.64 MiB (52%)
OMMl :MMMM: lMMO Swap: Disabled
iMMM 'oo' MMMi Disk (/): 4.63 MiB / 39.76 MiB (12%) - overlay
OMMb dMMO Local IP (wan): REDACTED
'OMMO. ,OMMO' Locale: C
"MMMb. ,dMMM"
"MMMMbgo-,,-ogdMMMM"
"*MMMMMMMMMM*"
`'""'`Netgear Nighthawk R7800 (Nighthawk X4S AC2600) ..,,.. root@REDACTED
,;odOMMMMMMMMObo:. ---------
,odOMMMMMO""''""OMMMMMObo. OS: OpenWrt 25.12.5 armv7l
.dMMMM" .,,. "OMMMb, Host: Netgear Nighthawk X4S R7800
'0" ,;ddMMMMMMMMbb:. "0' Kernel: Linux 6.12.94
oOMMMMO""''""OMMMMOo Uptime: 1 day, 14 hours, 29 mins
;. '0" .,,. "0' .: Shell: ash 1.37.0
.OMM* .odMMMMMMbo. *MMO. Terminal: dropbear
MMMO "0"````"0" OMMM CPU: ipq8064 (2) @ 1.73 GHz
iOMM .oo. MMMi Memory: 125.49 MiB / 461.99 MiB (27%)
OMMl :MMMM: lMMO Swap: Disabled
iMMM 'oo' MMMi Disk (/): 3.73 MiB / 77.50 MiB (5%) - overlay
OMMb dMMO Local IP (br-lan.1): REDACTED
'OMMO. ,OMMO' Locale: C
"MMMb. ,dMMM"
"MMMMbgo-,,-ogdMMMM"
"*MMMMMMMMMM*"
`'""'`However, I did not bother with the OpenWRT toolchain, I just run an Alpine Docker container for the target architecture (which emulates the CPU) and compiled statically on the standard Alpine toolchain. Although, compiling fastfetch wasn't as simple as setting Unfortunately, this isn't possible for mips/mipsel since Alpine doesn't support them, so OpenWRT SDK container for those: PS. A huge thank you to VincentZyu233 for the instructions above, helped a lot as a starting point. I had done a cross-compilation for my first OpenWRT router YEARS ago, but had forgotten it all :P TP-Link Archer A7 (v5) ..,,.. root@REDACTED
,;odOMMMMMMMMObo:. -----------
,odOMMMMMO""''""OMMMMMObo. OS: OpenWrt 24.10.7 mips
.dMMMM" .,,. "OMMMb, Host: TP-Link Archer A7 v5
'0" ,;ddMMMMMMMMbb:. "0' Kernel: Linux 6.6.141
oOMMMMO""''""OMMMMOo Uptime: 5 hours, 22 mins
;. '0" .,,. "0' .: Shell: ash 1.36.1
.OMM* .odMMMMMMbo. *MMO. Terminal: dropbear
MMMO "0"````"0" OMMM CPU: qca9563
iOMM .oo. MMMi Memory: 80.88 MiB / 118.29 MiB (68%)
OMMl :MMMM: lMMO Swap: Disabled
iMMM 'oo' MMMi Disk (/): 2.55 MiB / 7.81 MiB (33%) - overlay
OMMb dMMO Disk (/overlay): 2.55 MiB / 7.81 MiB (33%) - jffs2
'OMMO. ,OMMO' Local IP (br-lan): REDACTED
"MMMb. ,dMMM" Locale: C
"MMMMbgo-,,-ogdMMMM"
"*MMMMMMMMMM*"
`'""'`TP-Link Archer C6U ..,,.. root@REDACTED
,;odOMMMMMMMMObo:. ------------
,odOMMMMMO""''""OMMMMMObo. OS: OpenWrt 24.10.7 mips
.dMMMM" .,,. "OMMMb, Host: TP-Link Archer C6U v1
'0" ,;ddMMMMMMMMbb:. "0' Kernel: Linux 6.6.141
oOMMMMO""''""OMMMMOo Uptime: 13 mins
;. '0" .,,. "0' .: Shell: ash 1.36.1
.OMM* .odMMMMMMbo. *MMO. Terminal: dropbear
MMMO "0"````"0" OMMM CPU: archer-c6u-v1 (4)
iOMM .oo. MMMi Memory: 84.25 MiB / 116.43 MiB (72%)
OMMl :MMMM: lMMO Swap: Disabled
iMMM 'oo' MMMi Disk (/): 1.91 MiB / 7.31 MiB (26%) - overlay
OMMb dMMO Disk (/overlay): 1.91 MiB / 7.31 MiB (26%) - jffs2
'OMMO. ,OMMO' Locale: C
"MMMb. ,dMMM"
"MMMMbgo-,,-ogdMMMM"
"*MMMMMMMMMM*"
`'""'`PS. |










Uh oh!
There was an error while loading. Please reload this page.
https://github.com/VincentZyu233/fastfetch_ForMiWifiRouter3G
All reactions