一、挂载overlay

1、登录ssh,创建文件 /etc/init.d/miwifi_overlay

vi /etc/init.d/miwifi_overlay

2、右键粘贴以下内容

#!/bin/sh /etc/rc.common

START=00

. /lib/functions/preinit.sh

start() {
        [ -e /data/overlay ] || mkdir /data/overlay
        [ -e /data/overlay/upper ] || mkdir /data/overlay/upper
        [ -e /data/overlay/work ] || mkdir /data/overlay/work

        mount --bind /data/overlay /overlay
        fopivot /overlay/upper /overlay/work /rom 1

        #Fixup miwifi misc, and DO NOT use /overlay/upper/etc instead, /etc/uci-defaults/* may be already removed
        /bin/mount -o noatime,move /rom/data /data 2>&-
        /bin/mount -o noatime,move /rom/etc /etc 2>&-
        /bin/mount -o noatime,move /rom/ini /ini 2>&-
        /bin/mount -o noatime,move /rom/userdisk /userdisk 2>&-

        return 0
}

:wq保存退出
3、执行以下代码

chmod 755 /etc/init.d/miwifi_overlay #更改文件权限
/etc/init.d/miwifi_overlay enable
sync
reboot #重启

二、更换官方软件源

小米官方固件内的软件源并不存在,我们需要更换他
1、登录ssh,修改文件 /etc/opkg/distfeeds.conf

rm /etc/opkg/distfeeds.conf
vi /etc/opkg/distfeeds.conf

右键粘贴以下内容

src/gz openwrt_base http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/base
src/gz openwrt_luci http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/luci
src/gz openwrt_packages http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages
src/gz openwrt_routing http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/routing

:wq保存退出

2、运行

opkg update

然后就可以安装一些openwrt软件了,比如要按安装sftp

opkg install openssh-sftp-server