关于无线路由器的刷机,看了很多文章, 万变不离其宗。从嵌入式系统的视角来零零碎碎的写一些东西,初学者不一定看得懂。
- U 盘挂载,是格式化一个 ext4 文件系统,然后建立一个 /opt 目录,老毛子会自动挂载 /opt ; mdev -s 查看
- 有了 /opt 以后, 运行 opkg.sh ; opkg.update , 系统就有巨大的容量了
手工挂载: mount -o bind /media/AiDisk_a1/opt /opt
从内存挂载: mount -t tmpfs -o size=10M tmpfs /opt/
固件的备份和恢复,这个适合 OpenWrt 不一定适合 老毛子
备份:
cat /proc/mtd
dd if=/dev/mtd0 of=/tmp/all.bin
cd /www
touch all.bin
mount --bind /tmp/all.bin /www/all.bin
wget http://192.168.2.1/all.bin
恢复
cat /proc/mtd
mtd write /tmp/all.bin ALL
mtd write /tmp/eeprom.bin Factory
mtd write /tmp/fs.bin firmware
OpenWrt 的 extroot,扩容:
# opkg install block-mount fdisk
挂接好外部存储后:
# mount –bind / /tmp/cproot
# tar -C /tmp/cproot -cvf – . | tar -C /mnt/sda1 -xf –
# umount /tmp/cproot
修改自动挂接配置: /etc/config/fstab,把整个的根放到外部存储
config mount option target / option device /dev/sda1 option fstype ext3 option options rw,sync option enabled 1 option enabled_fsck 0
关于透明代理,有人已经写了现成的脚本:
# opkg remove dnsmasq; opkg install dnsmasq-full; opkg install coreutils-base64 curl ca-certificates ca-bundle
# opkg install coreutils-base64 curl ca-certificates ca-bundle
# cd /tmp && opkg update && opkg install curl ca-bundle && curl -s -L https://github.com/ysy/ss/raw/master/openwrt_tproxy.tgz -ot.tgz && tar x -z -f t.tgz && cd openwrt_tproxy && ./setup.sh
optware 的 Pkg Source: http://pkg.entware.net/binaries/mipsel/
老毛的固件网站: https://opt.cn2qq.com/ 刷机后,默认会从这个网站下载很多应用和文件。
斐讯 K2 PSG1218 Rev. A 的 OpenWrt 官方固件: https://openwrt.org/toh/hwdata/phicomm/phicomm_k2_psg1218