SlideShare a Scribd company logo
1 of 39
Download to read offline
OpenWrt Guide
sean
Doc version
● V1 2018-04-28
– Source,build,download
– Feeds,init rc,uci,ubus
Being-towards-death
Build script
● ./m.sh
– cd qsdk
– make defconfig # openwrt standard
– make V=s -j8
– cd -
– ./pack.sh
● cp -rvf qsdk/bin/ipq806x/openwrt* common/build/ipq #use new build squashfs-root.img
● cd common/build/
● python update_common_info.py #build mtd single bin
● cp -vf bin/nornand-ipq40xx-single.img /media/sean/project/IPQ4019/img/spf5.img # release fw
● cd -
● Mount smb of 176 to local path
– sudo mount -t cifs //192.168.180.176/project/ /media/sean/project/ -o guest
Build env
● Ubuntu 14.04
– Glibc 2.17
● sudo apt-get install gcc g++ binutils patch bzip2 flex make gettext

pkg-config unzip zlib1g-dev libc6-dev subversion libncurses5-dev
gawk 
sharutils curl libxml-parser-perl ocaml-nox ocaml-nox ocaml
ocaml-findlib 
libpcre3-dev binutils-gold python-yaml
● sudo apt-get install u-boot-tools
● sudo apt-get install device-tree-compiler
● sudo apt-get install mtd-utils
Juci build env
● feeds/juci/openwrt-bootstrap.sh
Download fw
● Self upgrade (recommend)
– Copy fw bin to device
● Use scp # see ssh to openwrt
– Use sysupgrade
● Tftp download
– Need to connect serial port
– See uboot and tftpboot
● Flash program
– Need program device
Telnet to openwrt

If not set root passwd

telnet 192.168.1.1
●
passwd #set root password, needed by
scp&ssh
ssh to openwrt

ssh root@192.168.1.1

scp /pathto/spf502.img root@192.168.1.1:/tmp/

sysupgrade

sysupgrade -c -v /tmp/xxx-single.img

Not need serial port

openwrt 升级功能介绍
 https://blog.csdn.net/u013485792/article/details/50505
706

WARN: can't upgrade from nor to nornand
uboot

reset # soft reboot

set # set var, used by $var
tftpboot

set ipaddr 192.168.1.11

set serverip 192.168.1.xx

ping ${serverip}

tftpboot 0x84000000 xxxx-ipq40xx-single.img

imgaddr=0x84000000 && source $imgaddr:script
Check firmware version

cat /proc/version | less
 Build user and hostname
 Build time
 Kernel version
 ...
ROM

df -h

/tmp 115

/rom 15

/ | /overlay 38
RAM

free -m
 Total 236 used 134 free 102
Feeds folder
Qsdk/feeds
├── luci -> ../qca/feeds/luci
├── luci.index -> luci.tmp/.packageinfo
├── luci.targetindex -> luci.tmp/.targetinfo
├── packages -> ../qca/feeds/packages
├── packages.index -> packages.tmp/.packageinfo
├── packages.targetindex -> packages.tmp/.targetinfo
Add feeds

src-git juci https://github.com/mkschreder/juci-
openwrt-feed.git

src-git vuci https://github.com/zhaojh329/vuci.git

./scripts/feeds update vuci juci

./scripts/feeds install -a -p vuci
Feeds command

./scripts/feeds list -s

./scripts/feeds install -a -f -p juci
Makefile
● https://openwrt.org/docs/guide-developer/packag
es
● define Package/lighttpd/Default
● define Package/lighttpd
– $(call Package/lighttpd/Default)
● define Package/lighttpd/config
● define Package/lighttpd/install
● define Build/Configure
● define Build/Prepare
● define Build/Compile
feeds/juci/libblobpack/Makefile
+PKG_VERSION=2.16.09-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
make[3]: Entering directory `/work/workspace/SPF5.02/qca-networking-2017-spf-5-0-
2_qca_oem.git/qsdk/feeds/juci/libblobpack'
Makefile:43: *** Download/default is missing the FILE field.. Stop.
Configuration .config
cp qca/configs/qsdk/ipq806x_standard.config
.config

make defconfig

Modify manual

make defconfig # again before real make

**Use version control .config

make menuconfig # for modify
luci and juci conflict
● cp v9.luci.config .config
● cp v9.juci.config .config
●
make menuconfig
– Select luci and unselect all juci
– Select juci and unselect all luci
Usb net

CONFIG_PACKAGE_kmod-usb-net=y

CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y

CONFIG_PACKAGE_kmod-usb-net-rndis=y
make

make V=s -j8

make -j8

make download V=s # download to dl folder

make V=s -j1 # for check build error

make package/juci/compile V=s -j1
Make clean
●
Don't call make clean
●
/build_dir/target-arm_cortex-a7_uClibc-
1.0.14_eabi/xxx-project
– rm -rf ipkg-i* #ipkg-install, ipkg-ipq806x
●
rm -rf ./build_dir/target-arm_cortex-a7_uClibc-
1.0.14_eabi/root-ipq806x/
●
Init Scripts

https://openwrt.org/docs/techref/initscripts

/etc/init.d/

/etc/rc.d/
Power 4G modem
● Qsdk/package/base-files/files/etc/rc.local
● Power up:gpio 39
● Power on:gpio 21
UCI is a data backend

https://openwrt.org/zh-cn/doc/techref/uci

https://openwrt.org/docs/guide-user/base-
system/uci
 Configuration Files Lists

UCI 配置文件位于目录 /etc/config/ 内

use init.d call to take effect

/etc/config/samba overwrite
/etc/samba/smb.conf when running
/etc/init.d/samba start
Not UCI

https://openwrt.org/docs/guide-user/base-
system/notuci.config

System configuration not handled by UCI
UBUS is a functional backend

ubus call network reload
SVC
● .repo/manifest.xml
● feeds.conf
.repo/manifest.xml
● name="quic/qsdk/oss/system/openwrt"
path="qsdk"
●
feeds.conf
● src-link juci ../vendor/feeds/juci
●Vendor-feeds-juci
● Fixed bug for build libblobpack
● Change src git
– juci
– orange-rpcd
–
configs
● qca/configs/qsdk/
– mr1200.config
issue
● perf build error
– ##CONFIG_PACKAGE_perf=y
● Diff ath9k_platform.h
– cmp $
(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $
(LINUX_DIR)/include/linux/ath9k_platform.h
blogs
● https://www.cnblogs.com/rohens-hbg/category/
728530.html
● https://blog.csdn.net/xushx_bigbear/article/det
ails/47746241
● https://blog.csdn.net/walker0411
● https://blog.csdn.net/u012819339/article/categ
ory/5803489
●
packages
● Source download from URL
● Source present in src
– Build/Prepare
● $(CP) ./src/* $(PKG_BUILD_DIR)/
●
Add a new module
● https://openwrt.org/docs/guide-
developer/helloworld/start
● Release path
– vendor/feeds/qos
● Link in feeds
–

More Related Content

What's hot

What's hot (20)

Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
AndroidとSELinux
AndroidとSELinuxAndroidとSELinux
AndroidとSELinux
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Embedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOSEmbedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOS
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARM
 
Developing MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack RoutersDeveloping MIPS Exploits to Hack Routers
Developing MIPS Exploits to Hack Routers
 
initramfsについて
initramfsについてinitramfsについて
initramfsについて
 
Linux administration
Linux administrationLinux administration
Linux administration
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくい
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
How ubuntu works???
How ubuntu works???How ubuntu works???
How ubuntu works???
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practice
 
Running Android on the Raspberry Pi: Android Pie meets Raspberry Pi
Running Android on the Raspberry Pi: Android Pie meets Raspberry PiRunning Android on the Raspberry Pi: Android Pie meets Raspberry Pi
Running Android on the Raspberry Pi: Android Pie meets Raspberry Pi
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
Review of QNX
Review of QNXReview of QNX
Review of QNX
 
A Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry PiA Journey to Boot Linux on Raspberry Pi
A Journey to Boot Linux on Raspberry Pi
 

Similar to Openwrt startup

Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
Marcus Sá
 

Similar to Openwrt startup (20)

Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zero
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
 
Installing nagios core_from_source
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_source
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
oSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdfoSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdf
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
SPDK benchmark memo
SPDK benchmark memoSPDK benchmark memo
SPDK benchmark memo
 
Basic Git Tutorial
Basic Git TutorialBasic Git Tutorial
Basic Git Tutorial
 
Install Nagios Core On CentOS 7
Install Nagios Core On CentOS 7Install Nagios Core On CentOS 7
Install Nagios Core On CentOS 7
 
Front-end tools
Front-end toolsFront-end tools
Front-end tools
 
Snort-IPS-Tutorial
Snort-IPS-TutorialSnort-IPS-Tutorial
Snort-IPS-Tutorial
 
Farshid tensorflow1.3 digits6.0caffe
Farshid tensorflow1.3 digits6.0caffeFarshid tensorflow1.3 digits6.0caffe
Farshid tensorflow1.3 digits6.0caffe
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
NetBSDworkshop
NetBSDworkshopNetBSDworkshop
NetBSDworkshop
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Path to Surfdroid
Path to SurfdroidPath to Surfdroid
Path to Surfdroid
 
CloudOpen North America 2013: Vagrant & CFEngine
CloudOpen North America 2013: Vagrant & CFEngineCloudOpen North America 2013: Vagrant & CFEngine
CloudOpen North America 2013: Vagrant & CFEngine
 

More from 晓东 杜 (7)

Stability issues of user space
Stability issues of user spaceStability issues of user space
Stability issues of user space
 
performance optimization: UI
performance optimization: UIperformance optimization: UI
performance optimization: UI
 
performance optimization: Memory
performance optimization: Memoryperformance optimization: Memory
performance optimization: Memory
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
Openwrt wireless
Openwrt wirelessOpenwrt wireless
Openwrt wireless
 
Openwrt frontend backend
Openwrt frontend backendOpenwrt frontend backend
Openwrt frontend backend
 
DevOps at DUDU
DevOps at DUDUDevOps at DUDU
DevOps at DUDU
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Openwrt startup