在padavan运行wifidog

    技术2023-08-02  122

    wifidog

    作为一款wifi认证插件,在网上资料对于源码的分析可以说数不胜数。 而编译方面的是,偏向于OpenWtr固件。对于我这种使用padavan固件来说,想要使用wifidog的话,就只能自己摸索动手丰衣足食,使用交叉编译来完成编译wifidog的任务了。 虽然网上有着H大编译好的版本,但是对于本人来说H大编译的固件插件太多了,所以一直使用的padavan都是自己编译的纯净版,啥插件也没有的那种

    环境

    Ubuntu 16.04 LTSpadavan工具链

    编译

    先吧padavan工具链准备好

    安装好编译padavan所需要的依赖,依次执行下面两条命令

    sudo apt update sudo apt install unzip libtool-bin curl cmake gperf gawk flex bison nano fakeroot cpio git python-docutils gettext automake autopoint texinfo build-essential help2man pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev wget module-init-tools

    然后使用git下载padavan源码

    git clone --depth=1 https://gitee.com/hanwckf/rt-n56u.git /opt/rt-n56u

    编译工具链,依次执行三条命令,需要点时间

    cd /opt/rt-n56u/toolchain-mipsel ./clean_toolchain ./build_toolchain

    如果你有好一点的科学上网,也可以不需要自己编译工具链(毕竟花的时间有点长),使用脚本下载预编译的工具链

    sh dl_toolchain.sh

    编译wifidog

    使用git克隆源码

    git clone https://github.com/wifidog/wifidog-gateway wifidog

    开始编译,依次执行下面几条命令

    cd wifidog ./autogen.sh ./configure CC=/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-gcc CXX=/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-g++ LD=/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-ld RANLIB=/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-ranlib AR=/opt/rt-n56u/toolchain-mipsel/toolchain-3.4.x/bin/mipsel-linux-uclibc-ar --build=x86_64-pc-linux-gnu --host=mipsel-unknown-linux-gnu --target=mipsel-unknown-linux-gnu --prefix=/home/wifidog_install/ make sudo make install

    等一会后,编译好的输出文件在 /home/wifidog_install/ 目录中,bin目录里面的就是可执行文件。 我通过解包固件方法,把wifidog放进固件里(因为我不会直接打包进固件里呀,下次一定学) 刷进路由器后,通过ssh执行wifidog即可运行认证服务

    Processed: 0.009, SQL: 9