编辑环境搭建
选择Ubuntu16.04 LTS 32位操作系统进行OpenWrt编译
系统安装在vm12里面,网卡桥接模式,系统自动分区
安装时建立用户:openwrt,密码:jlcssadmin
安装完成后,使用openwrt用户名登陆系统,输入ifconfig查看IP地址
系统DNS可以设置成118.118.118.1
利用Xshell软件,连接系统
给root用户设置密码
sudo passwd root
1. 使用root用户更新系统
su -
2. #配置静态IP地址
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 genisoimage 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/
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资 源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。