編輯環境搭建css
選擇Ubuntu16.04 LTS 32位操做系統進行OpenWrt編譯python
系統安裝在vm12裏面,網卡橋接模式,系統自動分區linux
安裝時創建用戶:openwrt,密碼:jlcssadmingit
安裝完成後,使用openwrt用戶名登錄系統,輸入ifconfig查看IP地址github
系統DNS能夠設置成118.118.118.1shell
利用Xshell軟件,鏈接系統ubuntu
給root用戶設置密碼ruby
sudo passwd root
1. 使用root用戶更新系統bash
su -
2. #配置靜態IP地址ide
cat >/etc/network/interfaces <<EOF # This file describes the networkinterfaces available on your system # and how to activate them. For moreinformation, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto ens32 #iface ens32 inet dhcp iface ens32 inet static address 10.0.0.80 netmask 255.255.255.0 network 10.0.0.0 broadcast 10.0.0.255 gateway 10.0.0.254 dns-nameservers 8.8.8.8 EOF
reboot #配置完IP地址後,重啓系統
3. 更換下載源
mv /etc/apt/sources.list cat > /etc/apt/sources.list <<EOF debhttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main multiverse restricteduniverse debhttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main multiverserestricted universe debhttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main multiverserestricted universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/xenial-security main multiverse restricted universe debhttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main multiverserestricted universe deb-srchttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main multiverse restricteduniverse deb-srchttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main multiverserestricted universe deb-srchttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main multiverserestricted universe deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/xenial-security main multiverse restricted universe deb-srchttp://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main multiverserestricted universe EOF
4. 更新系統並重啓
apt-get -y update && reboot
5. 開始安裝編譯環境須要的軟件包
sudo apt-get install -y asciidoc build-essential binutilsbc bzip2 fastjar \ flex git-core gcc g++ util-linux patch gawk bison intltoollibgtk2.0-dev \ zlib1g-dev jikespg make genisop_w_picpath libncurses5-dev libssl-dev perl \ perl-modules python python-dev rsync rubysdcc unzip wget gettextxsltproc \ autoconf texinfo zip unrar p7zip p7zip-rar p7zip-full sharutilssubversion \ ncurses-term gcc-multilib libxml-parser-perl mercurial bzr ecj cvs quilt zlibcopenssl
#下載openwrt源代碼
#lede項目源代碼(openwrt最新分支,更新速度快)
git clone https://github.com/lede-project/source.git
#或
gitclone https://git.lede-project.org/source.git
#更新軟件包
~/source/scripts/feeds update -a ~/source/scripts/feeds install -a
#備份源碼包
tar -zcvf lede.source.tar.gz ~/source/