Ubuntu1804 编译 Openwrt_x86 固件

环境:

Ubuntu 1804,4核8G

安装依赖:

sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev zlib1g-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex node-uglify gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx-ucl libelf-dev autoconf automake libtool autopoint device-tree-compiler python2.7

下载Lienol openwrt源码(初次编译尽量运行在科学上网的全局模式下,方便下载相关依赖):

1:拉取源码:

        git clone https://github.com/Lienol/openwrt.git

2:进入目录:cd openwrt。添加下面代码到 openwrt 或 lede 源码根目录下的 feeds.conf.default 文件最后:

        src-git kenzo https://github.com/kenzok8/openwrt-packages
        src-git small https://github.com/kenzok8/small

3:安装扩展、依赖:

        ./scripts/feeds clean

        ./scripts/feeds update -a

        ./scripts/feeds install -a

        feeds命令是安装扩展代码包编译选项,运行后在menuconfig配置将提供这些扩展包的选项。

        若报错,则直接删除 rm -rf openwrt/feeds 文件夹重新运行命令:WARNING: Makefile 'package/lean/shadowsocksR-libev-full/Makefile' has a dependency on 'libpcre', which does not exist

 4:进入编译选项:运行 make defconfig (检查编译工具是否齐全,生成默认的编译配置文件".config")之后再运行 make menuconfig。

        选择系统类型:Target System 选择 x86。

        固件格式:Target Images 选择 VMDK 。

        添加LuCI web配置:

                LuCI > 1. Collections>luci

                LuCI > 2. Modules > Translations-----------------------(zh-cn)

                LuCI > 3. Applications>luci-app-uhttpd

        添加EXT4硬盘格式支持:Kernel modules > Filesystem > kmod-fs-ext4

        添加USB键盘支持:Kernel modules > USB Support

        若仅编译 x86固件的话,Lienol源码很多选项都已经默认勾选了。不了解的选项可用默认参数。

最后:

        /openwrt/bin/targets/x86/ 下 , 查看生成的固件

注意:    

        1、不建议使用 root 用户编译。

        2、ulimit -s 10240 这个命令是防止爆栈 ​。

        3、初次编译,建议使用科学上网的全局模式。

引用:

        OpenWrt 编译 LuCI-> Applications 添加插件应用说明-L大【2021.11.18】 - OPENWRT专版 - 恩山无线论坛 - Powered by Discuz!
https://www.right.com.cn/forum/thread-344825-1-1.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值