【OpneWRT】编译ipk

环境配置

使用清华大学的镜像软件站https://mirrors.tuna.tsinghua.edu.cn/

SDK直接下载:
https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/18.06.8/targets/ramips/mt7620/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64.tar.xz

直接解压:

tar -xf openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64.tar.xz

配置环境变量 PATH 和 STAGING_DIR

export PATH=$PATH:"/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/bin"
export STAGING_DIR='/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/staging_dir'

配置环境

/etc/profile文件为系统的每个用户设置环境变量信息,此文件的修改会影响到所有用户。

/etc/profile 和 .bashrc的区别:/etc/profile影响所有用户,.bashrc影响当前用户。

1)进入root权限
2)打开配置文件 /etc/profile

vi /etc/profile

3)在文件中添加命令

export PATH=$PATH:路径

export PATH=$PATH:"/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/bin"
export STAGING_DIR='/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/staging_dir'

编译

make V=s

直接编译

make V=s

报错,刚接触OpenWRT,暂时没有找到原因。

Generating index for package ./kmod-zram_4.14.171-1_mipsel_24kc.ipk
Generating index for package ./libatomic_7.3.0-2_mipsel_24kc.ipk
Generating index for package ./libgcc_7.3.0-2_mipsel_24kc.ipk
Generating index for package ./libpthread_1.1.19-2_mipsel_24kc.ipk
Generating index for package ./librt_1.1.19-2_mipsel_24kc.ipk
Generating index for package ./libstdcpp_7.3.0-2_mipsel_24kc.ipk
Generating index for package ./helloworld_1_mipsel_24kc.ipk
Generating index for package ./helloworld_1_mipsel_24kc.ipk
Signing package index...
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
Cannot open file '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/key-build' for reading
package/Makefile:82: recipe for target 'package/index' failed
make[2]: *** [package/index] Error 1
make[2]: Leaving directory '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64'
Makefile:55: recipe for target 'world' failed
make[1]: *** [world] Error 2
make[1]: Leaving directory '/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64'
/home/admin/Downloads/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64/include/toplevel.mk:209: recipe for target 'world' failed
make: *** [world] Error 2

make package/helloworld/compile

编译单个 ipk:helloworld

编译命令

make package/helloworld/compile

编译成功
查找对应ipk位置

find ./ -name '*.ipk' | grep hello
./bin/packages/mipsel_24kc/base/helloworld_1_mipsel_24kc.ipk

参考资料

openWRT的SDK编译环境的安装和设置https://blog.csdn.net/sun_sky1/article/details/107963827
openwrt使用sdk编译应用程序http://www.javashuo.com/article/p-ryzsseme-ds.html
linux下配置编译器的环境变量https://blog.csdn.net/weixin_45647721/article/details/123557026
/etc/profile文件简单介绍https://blog.csdn.net/weixin_42031299/article/details/119089926

备注

一开始忘记配置环境变量 PATH 和 STAGING_DIR,导致编译不成功。

【OpneWRT】编译ipk相关推荐

  1. openwrt 下编译ipk

    openwrt插件都是以.ipk方式发布的,ipk可以直接通过opkg安装到系统.上文我们编译了简单的hello,本文探究hello.ipk的编译过程. 一. 环境准备 cd ~/openwrt/bi ...

  2. openwrt 遍译php_【教程笔记】用OpenWRT单独编译ipk插件

    hahaya说道: 你好 看了你的视频 请教下单独编译rosy遇到的问题 整体编译可以 单独编译包如下错误 求指导 make package/luci-theme-rosy/compile V=99 ...

  3. openwrt针对RT5350代码下载,配置和编译

    最近买了块官方板的RT5350: 先介绍代码下载,以下命令都是用登录用户执行,无须root: mkdir openwrt   //待会代码下载到此目录下 cd openwrt svn   co   s ...

  4. 基于ipk安装包形式移植helloworld驱动模块到openwrt系统

    在根据网上相关教程对openwrt系统进行helloworld驱动模块的文件进行添加的过程中,由于网上相关问题所使用的openwrt系统的版本较早,不具备较强的参考性,因此记录解决办法. 一.环境 o ...

  5. openwrt编译流程分析

    最近开始整5G CPE项目,系统基于OpenWrt系统移植裁剪,打算详细研究了一下整个工程的构建过程,记录一下: Openwrt编译过程概述 编译的总体过程如下: 1.编译host工具 2.编译交叉工 ...

  6. OpenWRT的ROM固件内置软件包修改与定制

    为什么80%的码农都做不了架构师?>>>    1.下载Feeds Feeds是OpenWrt环境所需要的软件包(opk)资源管理组件,在make menuconfig中配置buil ...

  7. 手把手教你玩转OpenWRT路由器系统,视频教程合集

    手把手教你玩转OpenWRT路由器系统,视频教程合集 以NewifiD2(新三)路由器为基础,录制了OpenWRT系列视频教程,欢迎观看. <[视频教程]手把手教你用虚拟机安装ubuntu操作系 ...

  8. 制作自己的openwrt刷机包_OpenWRT的ROM固件内置软件包修改与定制

    1.下载Feeds Feeds是OpenWrt环境所需要的软件包(opk)资源管理组件,在make menuconfig中配置built-in的软件包时会依赖Feeds.Feeds需要连接互联网才能执 ...

  9. openwrt web中文语言支持,并设置默认中文

    OPENWRT WEB中文语言支持,并设置默认中文 在menuconfig中先选择支持luci-i18n-zh_ch 然后修改配置文件: 修改配置文件,配置默认中文 vim feeds/luci/mo ...

  10. 怎么制作自己的校园网路由器(广州大学版)

    庆用的是锐捷的系统,你能买到的锐捷校园网路由器都大同小异,直接购买即可 此文主要是写给愿意折腾的同学,将我本人组all in one服务器踩到的一些坑分享给大家,如果你想用树莓派软路由.x86虚拟机软 ...

最新文章

  1. 实现做出html的上标以及下标
  2. PAT甲级1101 Quick Sort:[C++题解]DP、快速排序划分个数、快排
  3. mysql与web服务器之间的分离操作
  4. 《数据结构与算法分析—Java语言描述》pdf
  5. C# 以管理员身份运行程序
  6. Boost Graph
  7. HDU.2111 Saving HDU(贪心)
  8. 关于人生的10个真相, 希望你越早知道越好
  9. Pandas-常用统计分析方法 describe、quantile、sum、mean、median、count、max、min、idxmax、idxmin、mad、var、std、cumsum
  10. Windows 10 常用软件推荐
  11. 阿里 java 电话面试_阿里Java开发电话面试经历--惨败
  12. 亚马逊中国发布2015图书排行榜
  13. 如何制作你自己的电脑游戏
  14. uboot源码中start.S里中断向量表中不直接LDR   PC ,异常地址,而是使用一个标号
  15. [C#] 控制系统音量-第二章
  16. mysql 唯一性榆树_榆树有什么特点?
  17. 「无刷新跳转」window.history两个新方法pushState和replaceState详解
  18. 数据库输出带字段注释的查询
  19. 祝你一路顺风_吴奇隆_酷音小伟编曲_C调简单版
  20. 太空射击python

热门文章

  1. Linux操作系统启动流程、daemon与服务(service)、systemctl管理服务
  2. Verilog 锁存器 触发器 寄存器区别
  3. p6spy mysql8_P6Spy配置使用
  4. python中pytz库用法详解
  5. swagger注解介绍
  6. 如何使用Python查找文本文件的Zipf分布
  7. 【通信电子电路】谐振功率放大电路multisim仿真
  8. 第一章 嵌入式系统概述——ARM
  9. 电容器原理和计算公式及电容单位换算
  10. python绘制基因结构图_分分钟教你绘制基因结构图!