1.編譯OpenWRT鏡像
參考
https://github.com/coolsnowwolf/lede
中文:如何編譯自己需要的 OpenWrt 固件
注意:
1. 不要用 root 用戶 git 和編譯E蕖Eと省有缆!
2. 國內(nèi)用戶編譯前最好準(zhǔn)備好梯子
3. 默認(rèn)登陸IP 192.168.1.1, 密碼 password
編譯命令如下:
1. 首先裝好 Ubuntu 64bit略号,推薦 Ubuntu 14 LTS x64
2. 命令行輸入 sudo apt-get update 努酸,然后輸入
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint
3. git clone https://github.com/coolsnowwolf/lede命令下載好源代碼揩环,然后 cd lede 進(jìn)入目錄
4. ./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
5. 最后選好你要的路由诉探,輸入 make -j1 V=s </pre>
2.make menuconfig 設(shè)備選擇
Target System (QEMU ARM Virtual Machine) --->
Subtarget (ARMv8 multiplatform) --->
LuCI --->Applications --->選擇自己需要的APP
其他默認(rèn)
編譯成功之后在lede/bin/targets/armvirt/64目錄下openwrt-armvirt-64-root.ext4.gz
或者直接用OpenWRT官方鏡像https://downloads.openwrt.org/releases/18.06.2/targets/armvirt/64/openwrt-18.06.2-armvirt-64-default-rootfs.tar.gz
3.制作斐訊N1的OpenWRT鏡像
鏡像母版使用Armbian_5.60_Aml-s9xxx_Debian_stretch_default_4.18.7_20180922.img
//解包原版鏡像
tar xvf openwrt-armvirt-64-rootfs.tar.gz -C openwrt
//掛載母版鏡像
losetup -P -f --show Armbian_5.60_Aml-s9xxx_Debian_stretch_default_4.18.7_20180922.img
mount /dev/loop0p2 /armbian
//刪除OpenWRT中firmware modules
rm -rf openwrt/lib/firmware
rm -rf openwrt/lib/modules
//替換armbian
mv armbian/lib/modules openwrt/lib/
mv armbian/lib/firmware openwrt/lib/
mv armbian/etc/modprobe.d openwrt/etc/
mv armbian/etc/fstab openwrt/etc/
//切換到openwrt/lib/modules/4.18.7-aml-s9xxx
cd openwrt/lib/modules/4.18.7-aml-s9xxx
//創(chuàng)建link-ko.sh
nano link-ko.sh
//內(nèi)容為:
for x in `find -name *.ko`
do
ln -s $x .
done
//給予link-ko.sh運(yùn)行權(quán)限
chmod +x link-ko.sh
//運(yùn)行l(wèi)ink-ko.sh
./link-ko.sh
//回到openwrt目錄
cd openwrt
//編輯openwrt/etc/init.d/boot
nano openwrt/etc/init.d/boot
//內(nèi)容是在第38行也就是“/sbin/kmodloader”之前先较,增加以下內(nèi)容:
ulimit -n 51200
//清空armbian
rm -rf armbian/*
//把openwrt目錄下所有剪切到armbian
mv openwrt/* armbian/
//新建boot目錄
mkdir armbian/boot
//同步
sync
//卸載media和openwrt目錄
umount armbian
losetup -d /dev/loop0
Armbian_5.60_Aml-s9xxx_Debian_stretch_default_4.18.7_20180922.img已被修改為openwrt系統(tǒng)
寫入U(xiǎn)盤掏击,插入N1盒子卵皂,插電,啟動(dòng)成功砚亭,電腦直接接入盒子lan口灯变,進(jìn)入管理界面設(shè)置成輔助網(wǎng)關(guān)即可。
echo 0xDEADBEEF > /etc/config/google_fu_mode