安装Debian发行版

启用windows 适用于linux 的 windows子系统

安装Debian

参考p3terx的文章把debian装到非系统盘上:

https://p3terx.com/archives/compiling-openwrt-with-wsl.html

配置环境与编译openwrt

设置编译环境

安装编译过程需要的工具

更换debian源(当前debian版本为stretch)

sudo nano /etc/apt/sources.list

在文件最开头添加以下内容

deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib

令行输入 sudo apt-get update

然后输入 sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3.5 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf

取消WSL PATH 与windows PATH关联

#在Debian中修改/etc/wsl.conf
sudo nano /etc/wsl.conf
#加入内容
[interop]
appendWindowsPath=false
[automount]
enable=false
#管理员身份cmd运行以下命令重启wsl
net stop LxssManager
net start LxssManager
#结果看不到windows的环境变量了
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

在wsl使用win10的proxy

#示例
export http_proxy=socks5://127.0.0.1:10800
export https_proxy=socks5://127.0.0.1:10800

开始编译工作

#为了避开wsl与windows文件系统的一些兼容性问题
#在Debian用户目录下,如/home/you_name执行下面的操作 git clone https://github.com/coolsnowwolf/lede.git
cd lede
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make -j8 download V=s #下载dl库
make -j1 V=s #(-j 后面是线程数。第一次编译推荐用单线程)即可开始编译固件了

非常感谢lean大的代码

参考:

http://www.win10.uk/article/11785.html

https://blog.csdn.net/notMine/article/details/103302371

https://github.com/coolsnowwolf/lede

https://p3terx.com/archives/compiling-openwrt-with-wsl.html

最新文章

  1. PCD文件去除曲率的脚本
  2. 【转】java.lang.OutOfMemoryError: Java heap space的解决
  3. 堆block和栈block的区分
  4. Redis教程(六):Sorted-Sets数据类型
  5. Git的安装以及一些操作
  6. ios开发中常用的也是最基本的mysql语句
  7. MVC4的bundling功能简介
  8. JSP与Servlet之间传值
  9. Linux上配置Nginx+PHP5(FastCGI)
  10. C#:获取时间年月日时分秒格式
  11. WIN phone 8.1 SDK 坑遇到 Hyper-V
  12. HTML target 属性
  13. LD_LIBRARY_PATH vs LIBRARY_PATH
  14. angular项目——小小记事本1
  15. [补] winpcap编程——EAP协议与EAPSOCKET实现
  16. python第二课
  17. H5学习之旅-xhtml语法(15)
  18. [二十五]JavaIO之RandomAccessFile
  19. react初探(一)之JSX、状态(state)管理、条件渲染、事件处理
  20. Palindrome Function HDU - 6156(数位dp)

热门文章

  1. Java JDK Proxy和CGLib动态代理示例讲解
  2. petite-vue和Vue的比较
  3. 重学SpringBoot. step5 再学SpringMVC
  4. Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation
  5. 关于异常处理的return
  6. STM32F1库函数初始化系列:DMA—ADC采集
  7. 浏览界面servlet实现
  8. NoSQL(简介、历史)
  9. Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'xxx' in 'where clause'
  10. Postgresql的csv日志设置