Code Monkey home page Code Monkey logo

openwrtcompilescript's Introduction

OpenwrtCompileScript

Command_Line

序言

用于辅助Openwrt编译,但不会帮你完成整个编译过程,需要一点Openwrt编译基础

降低编译难度,减少重复的步骤,但不利于学习,此脚本适用于有点openwrt编译的基础的最佳,完全没有编译基础的请去补充相关知识

想学点东西请走这里: https://www.right.com.cn/forum/thread-324501-1-1.html

此脚本并不是无脑脚本,这个脚本对新手是无脑的但要点基础,起码你要会选择机型与插件,有点基础的可以说是辅助,加快你的编译速度,写这个脚本的初衷就是编译的过程重复太多,所以写了脚本

感谢 @学渣 @sjz 等的帮助

支持系统

The script is made to work on these OS :

  • Ubuntu 16.4
  • Ubuntu 18.4 (首选,脚本基于此版本编写测试)
  • win10子系统(ubuntu 18.04 LTS)
  • Deepin 15.11桌面版(群友测试ok)

脚本使用教程

脚本视频教程加群 :667491026拒绝大爷公子伸手党)

脚本问题反馈https://github.com/openwrtcompileshell/OpenwrtCompileScript/issues 或者加群反馈

Usage 使用方法

请勿使用Root进行编译!!!

1、使用git克隆下载脚本并赋予执行权限

git clone https://github.com/openwrtcompileshell/OpenwrtCompileScript.git && chmod +x OpenwrtCompileScript/openwrt.sh

2、进入脚本目录并执行

cd OpenwrtCompileScript && bash openwrt.sh

注意:执行脚本后会自动添加系统变量,第二次可使用如下命令运行脚本。(如果不行,请重启的你的Linux)

bash $openwrt

命令行调用脚本

用法: bash $openwrt [文件夹] [命令] 
脚本创建文件夹目录结构:/home/zhang/Openwrt/你起的文件夹名/lede 

首次编译建议:
   new_source_make    脚本新建一个文件夹下载你需要的源码并进行编译 

二次编译建议:
   noclean_make       不执行make clean清理一下源码然后再进行编译
   clean_make         执行make clean清理一下源码然后再进行编译
   update_clean_make  执行make clean 并同步最新的源码 再进行编译
   update_script      将脚本同步到最新
   update_script_rely 将脚本和源码依赖同步到最新


例子:  
  1.新建一个文件夹下载你需要的源码并进行编译(适合首次编译)  
   bash $openwrt new_source_make   

  2.不执行clean,执行make download 和make -j V=s(适合二次编译)   
   bash $openwrt 你起的文件夹名  noclean_make  

  3.清理编译文件,再重新编译(适合二次编译)   
   bash $openwrt 你起的文件夹名  clean_make    

  4.同步最新的源码清理编译文件再编译(适合二次编译) 
   bash $openwrt 你起的文件夹名  update_clean_make  

   bash $openwrt help   查看帮助  
   bash $openwrt update_script   将脚本同步到最新  


版本修改记录

++3.0版本

1.禁用图形界面 2.现在支持lean的源码,后期有时间再考虑其他

++2.9版本

  1. 修复误
  2. 将插件默认选上我经常用的
  3. 添加天气预报
  4. 个别变量改名
  5. 修改固件生成名字,添加日期和时间,方便分类
  6. 重写source_if整个模块(大改动)添加dl文件检测代码
  7. 支持gitpod云编译
  8. 新增 git_reset回退功能
  9. 适配lienol源码
  10. 更新OpenwrtCompileScript使用说明.pdf
  11. 修复windows10子系统无法更新
  12. 增加回退选择,报错可以选择回退到编译选择界面,方便继续编译,而不是重新开始
  13. 脚本支持Deepin 15.11桌面版
  14. 支持N1制作镜像源码
  15. 增加help模块
  16. 脚本支持命令模式

++2.8版本

  1. 更新dl下载代码,
  2. 补全if判断代码
  3. 修复之前代码不完整
  4. 新增变量openwrt_shfile
  5. 调整代码的阅读顺序,方便阅读调整
  6. 环境依赖加入判断,防止报错
  7. openwrt加入lean插件功能
  8. 颜色调整,方便阅读
  9. 新增功能按键 更新lean仓库
  10. 编写OpenwrtCompileScript使用说明.pdf
  11. 将二次编译与源码更新模块合并,并加入显示远端仓库的最近三条更新内容模块
  12. 加入比较源码参数
  13. 取消官方源码强制https
  14. 合并左右的部分脚本代码
  15. 删除dl国内服务器下载功能选项
  16. 增加software_Setting_Public模块

++2.7版本

  1. 修改脚本名字为《openwrt.sh》不再以版本命名,以后执行脚本bash openwrt.sh即可
  2. 加入if判断是否源码下载成功
  3. Dl服务器下载增加一个参数,解决证书不信任问题
  4. 增加脚本描述文本
  5. 文件夹创建提前
  6. 加入时间计算让自己更加直观看到编译耗时
  7. 增加多线程编译可以自己决定以多少线程进行编译
  8. 增加脚本自检程序
  9. 新增选项 9.更新脚本
  10. 优化一下代码
  11. 增加一个ls函数模块
  12. 适配win10子系统(ubuntu 18.04 LTS)
  13. 删除无用的5.选项替换DNS

++2.6版本

  1. 支持不在home底下也能正常运行,因为服了一下小白老是报错
  2. 只需要执行脚本就可以操作你任意的openwrt文件夹
  3. 新增国内DL服务器(感谢LGA1150)
  4. 新增选择( 6.其他选项),可以单独使用个别模块,如:支持单独只搭建编译环境,而不进行编译
  5. 创建文件时加入判断,防止覆盖之前的目录
  6. 删除之前的个别文件,脚本执行目录随意没有要求了,但Home目录底下的Openwrt目录禁止改名移动

++2.5版本

  1. 简化之前目录
  2. 代码的重写
  3. 一个目录方便管理
  4. 加入Lean_R9_source and Openwrt17.01_source

++2.4版本

  1. 增加config文件保存与调用(家里机型较多的可以更省事),此建议由 @兔巴哥提供

++2.3版本

  1. 合并功能按键并增加第5.HOST选项

openwrtcompilescript's People

Contributors

europeanwithssr avatar itdesk01 avatar juanbrend avatar sjz123321 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openwrtcompilescript's Issues

脚本错误

tmp/.config-package.in:48035:warning: config symbol defined without type
Your display is too small to run Menuconfig!
It must be at least 19 lines by 80 columns.
/home/sg1987/Openwrt/lean/lede/include/toplevel.mk:136: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 1

/home/sg1987/Openwrt/Script_File/OpenwrtCompileScript/openwrt.sh: 行 1323: redError: 未绑定的变量

ubuntu18 出现以上错误提示

多线程的代码好像缺内容.2333

你输入的线程是:8
准备开始执行编译

   3秒以后执行代码
   如果不需要执行代码以Ctrl+C 终止即可

openwrt.sh: 行 1182: 8: 未找到命令
本次运行时间: 15s

无法下载DL包

      -------------------------------------
      	    【 5.其他选项 】

	  1 只搭建编译环境,不进行编译

	  2 单独Download DL库 

	  3 更新lean软件库 

	  4 下载额外的插件 

	  0. 回到上一级菜单


	PS:请先搭建好梯子再进行编译,不然很慢!
		     By:ITdesk
      --------------------------------------

请输入数字:2

你的openwrt文件夹有以下几个
openwrt

请输入你的文件夹(记得区分大小写):openwrt

ubuntu@ubuntu:~$

编译了至少3次,只有插件,没有固件。。。

第四次报错,才看到了哪里问题。。。

make[5]: *** No rule to make target 'tools/objtool/objtool', needed by '/workspace/OpenwrtCompileScript/Openwrt/Lean/lede/build_dir/target-x86_64_musl/linux-x86_64/sched-cake-2019-03-12-057c7388/sch_cake.o'. Stop.
make[4]: *** [Makefile:1523: module/workspace/OpenwrtCompileScript/Openwrt/Lean/lede/build_dir/target-x86_64_musl/linux-x86_64/sched-cake-2019-03-12-057c7388] Error 2
make[3]: *** [Makefile:46: /workspace/OpenwrtCompileScript/Openwrt/Lean/lede/build_dir/target-x86_64_musl/linux-x86_64/sched-cake-2019-03-12-057c7388/.built] Error 2
make[3]: Leaving directory '/workspace/OpenwrtCompileScript/Openwrt/Lean/lede/package/kernel/kmod-sched-cake'
make[2]: *** [package/Makefile:109: package/kernel/kmod-sched-cake/compile] Error 2
make[1]: *** [package/Makefile:103: /workspace/OpenwrtCompileScript/Openwrt/Lean/lede/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make: *** [/workspace/OpenwrtCompileScript/Openwrt/Lean/lede/include/toplevel.mk:218: world] Error 2

怎么回事?我本地虚拟机编译都没有遇到过这样的问题。。。
Actions也没有这样的问题。。。

Public配置处理SSR P+可能有 问题..

在进入到make menuconfig后 不管选不选SSR P+的ssr服务端插件,都会默认编译,导致固件文件增大,最后因为固件大小超过了,出不来.bin 而在本地机器上,选同样配置可以出.bin

未绑定的变量

A package/other-plugins/luci-app-passwall/root/usr/share/passwall/test.sh
取出版本 1792。
取出版本 1792。
取出版本 1792。
grep: package/other-plugins/luci-app-passwall/luasrc/controller/fileassistant.lua: 没有那个文件或目录
/home/kennen/Openwrt/Script_File/OpenwrtCompileScript/openwrt.sh: 行 1349: fileassistant_display: 未绑定的变量

WSL2 Ubuntu 18.04 会遇到 feeds 不能更新的情况

image
手动在下载的固件文件夹内执行 ./scripts/feeds update -a 会出现如下情况提示:
image
运行这个 issue 里提到的命令后,就可以正常下载 feeds 了。coolsnowwolf/lede#3652
image
image
原以为是脚本漏装了一些东西,但仔细一看发现这个 issue 给出的命令中的所有包都已经写在了 rely_on() 里。
不太明白到底是什么原因导致单独运行脚本不能够安装这些包的部分或全部。
值得一提的是,单独运行该 issue 给出的命令时,曾有一个如图所示的要求确认提示,我选择了是。不知是否与脚本没有成功安装有关。
image
跟一个还算对 Linux 比较了解朋友交流了很久也没弄明白为什么,特来请教。

另外,wsl 编译时,还遇到这个问题,希望大大能把这条命令加到脚本里去。coolsnowwolf/lede#3295 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.