SlideShare a Scribd company logo
1 of 28
Download to read offline
Openwrt
And some embedded FW building
About me
● Anton Lerner
● Architect at Sitaro
Agenda
● Introduction to OpenWRT
● FW & cross compiling basics
● OpenWRT FW Memory layout
● Building an Openwrt Package
What is Openwrt
● Embedded Firmware
● Open source
● Linux based
● Run mainly on routers
● Many apps and tweaks!
Openwrt for the WIN!
$ $$$ !!
Basic image for openwrt
● Busybox
● Luci
● Command line configuration
● Firewall
● Opkg - package manager
Short feature presentation
OpenWRTs origins
● Linksys WRT54G
Other versions
DD-WRT
Gargoyle
LEDE
Deb-WRT
Tomato Roofnet
Under the hood
Customized Linux kernel for embedded devices
Drivers - Wifi, Lan, chipset specific, generic
Applications - DHCP, DNS, BusyBox, LuCi
Conventional firmware key concepts
● Reliable firmware
○ Checksum, custom headers
○ Read only filesystem - avoid corruption of data
● Small size
○ Flash size is small, we want to get the most of it!
● Filesystem is read only - cannot tweak after the image is built
○ NVRAM is used for persistent configuration modifications
FW Header
LZMA
decompressor Zipped kernel NvramSquash fs chk
Firmware and boot
Boot loader
Unzipped kernel
Drivers Applications
Boot Decompressor
Filesystem
OpenWRT vs conventional FW
● Static image
● Squashfs + Ram FS
SquashFS - read only FS Temp-fs runtime cfg.
NVRAM -
persistent config
FW Header
LZMA
decompressor Zipped kernel NvramSquash fs chk
Kernel
Openwrt FW and flash layout
● Applications can be installed and uninstalled in run time
● Fully Writable Filesystem!
○ Copy on write using JFFS2
SquashFS - read only FS - ROM JFFS2 - Writable
Overlay - FS
Kernel
FW
Header
LZMA
decompressor Zipped kernel NvramSquash fs chk JFFS2
Copy on write
● FS Have /rom for squashFS and /overlay for JFFS2 mounts
● / mounted with overlay_fs
● Great success!
SquashFS - read only FS - ROM JFFS2 - Writable
Overlay - FS
Kernel
Write to /etc/anton
Copy on write
A lot of vendors, Different Chipsets
OpenWRT 4 all
● Openwrt is available on different chipsets
○ Table of hardware
● Each Openwrt version for a specific router contains*
○ OpenWRT pre built image
○ SDK and cross compiling tools
● Porting packages into router is (relatively) quick and easy
A bit about chipsets
● SoC - system on chip
● NICs
● Hardware switch
Packages
● Over 3500 apps
○ In OPKG repository
○ Torrent client
○ Adblock
○ OpenVPN
○ Different network monitoring tools
● We can make our own packages
Building our own package
● Build SDK
○ Toolchain + cross-compiler
○ OpenWRT makefile framework
○ Buildroot
Cross compiling toolchains
● A set of compilers and compiling tools
● Custom made for a specific Chipset / Processor
● Released with hardware by vendor
● Usually supports c/c++
● Contains custom libs for libc / libc++ and other utilities
○ Smaller size
OpenWRT build infra
● On top of buildroot
● Custom makefile structure
● Part of openwrt package build process
● Custom keywords for package creation and install
A word about buildroot
● Framework containing scripts and makefiles
● Enables to build a linux image from scratch
● Used when compiling embedded FW
○ Cross compiling friendly!
● In openwrt, used with scripts that connect to OpenWRT
app feeds
Buildroot + OpenWRT makefile infra
● Download open source code of included packages
● Compile downloaded packages with cross compiler tools
● Download and compile dependencies
● Compile any custom packages
● Build the kernel according to our specifications
● Create a rootFS filesystem
● Copy package content into rootFS
● Zip FS and create loadable image
Demo - Building Package
Build Package- Tutorial Checklist
● Check for OpenWRT support!
● Choose correct SDK / OpenWRT code branch
○ Download SDK from site or compile one using buildroot
● Create custom makefile
● Compile using buildroot + correct cross compiler
● Locate Package
● Copy to router
● Opkg install
● Have fun!
OpenWRT platform
● Runs on multiple platforms and architectures
● Upgrade your router's capabilities
● Excellent research tool
● Many flavors, Active communities
Questions

More Related Content

What's hot

Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
艾鍗科技
 
Porting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectPorting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt project
Macpaul Lin
 

What's hot (20)

Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0Linux Internals - Interview essentials - 1.0
Linux Internals - Interview essentials - 1.0
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
 
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
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
Embedded Recipes 2017 - Introduction to Yocto Project/OpenEmbedded - Mylène J...
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Porting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectPorting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt project
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux Systems: Getting started with setting up an Embedded platform
Linux Systems: Getting started with setting up an Embedded platformLinux Systems: Getting started with setting up an Embedded platform
Linux Systems: Getting started with setting up an Embedded platform
 
Alla scoperta di gRPC
Alla scoperta di gRPCAlla scoperta di gRPC
Alla scoperta di gRPC
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 

Similar to OpenWrt From Top to Bottom

Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
a3sec
 
Open stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloudOpen stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloud
Kamesh Pemmaraju
 

Similar to OpenWrt From Top to Bottom (20)

Strategies for developing and deploying your embedded applications and images
Strategies for developing and deploying your embedded applications and imagesStrategies for developing and deploying your embedded applications and images
Strategies for developing and deploying your embedded applications and images
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Intro to linux
Intro to linux Intro to linux
Intro to linux
 
Embedded platform choices
Embedded platform choicesEmbedded platform choices
Embedded platform choices
 
Composer
ComposerComposer
Composer
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
Open stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloudOpen stack meetup_boston_ubuntu_cloud
Open stack meetup_boston_ubuntu_cloud
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Introduction and course Details of Embedded Linux Platform Developer Training
Introduction and course Details of Embedded Linux Platform Developer TrainingIntroduction and course Details of Embedded Linux Platform Developer Training
Introduction and course Details of Embedded Linux Platform Developer Training
 
OpenStack Cinder Best Practices - Meet Up
OpenStack Cinder Best Practices - Meet UpOpenStack Cinder Best Practices - Meet Up
OpenStack Cinder Best Practices - Meet Up
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
Polstra 44con2012
Polstra 44con2012Polstra 44con2012
Polstra 44con2012
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012
 
Build and deploy scientific Python Applications
Build and deploy scientific Python Applications  Build and deploy scientific Python Applications
Build and deploy scientific Python Applications
 
MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206MOVED: RDK/WPE Port on DB410C - SFO17-206
MOVED: RDK/WPE Port on DB410C - SFO17-206
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!
 

More from Kernel TLV

Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
Kernel TLV
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
Kernel TLV
 

More from Kernel TLV (20)

DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
SGX Trusted Execution Environment
SGX Trusted Execution EnvironmentSGX Trusted Execution Environment
SGX Trusted Execution Environment
 
Fun with FUSE
Fun with FUSEFun with FUSE
Fun with FUSE
 
Kernel Proc Connector and Containers
Kernel Proc Connector and ContainersKernel Proc Connector and Containers
Kernel Proc Connector and Containers
 
Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545
 
Present Absence of Linux Filesystem Security
Present Absence of Linux Filesystem SecurityPresent Absence of Linux Filesystem Security
Present Absence of Linux Filesystem Security
 
Make Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsMake Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance Tools
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
 
File Systems: Why, How and Where
File Systems: Why, How and WhereFile Systems: Why, How and Where
File Systems: Why, How and Where
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
KernelTLV Speaker Guidelines
KernelTLV Speaker GuidelinesKernelTLV Speaker Guidelines
KernelTLV Speaker Guidelines
 
Userfaultfd: Current Features, Limitations and Future Development
Userfaultfd: Current Features, Limitations and Future DevelopmentUserfaultfd: Current Features, Limitations and Future Development
Userfaultfd: Current Features, Limitations and Future Development
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Linux Kernel Cryptographic API and Use Cases
Linux Kernel Cryptographic API and Use CasesLinux Kernel Cryptographic API and Use Cases
Linux Kernel Cryptographic API and Use Cases
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival Guide
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 
WiFi and the Beast
WiFi and the BeastWiFi and the Beast
WiFi and the Beast
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 

OpenWrt From Top to Bottom

  • 2. About me ● Anton Lerner ● Architect at Sitaro
  • 3. Agenda ● Introduction to OpenWRT ● FW & cross compiling basics ● OpenWRT FW Memory layout ● Building an Openwrt Package
  • 4. What is Openwrt ● Embedded Firmware ● Open source ● Linux based ● Run mainly on routers ● Many apps and tweaks!
  • 5. Openwrt for the WIN! $ $$$ !!
  • 6. Basic image for openwrt ● Busybox ● Luci ● Command line configuration ● Firewall ● Opkg - package manager
  • 10. Under the hood Customized Linux kernel for embedded devices Drivers - Wifi, Lan, chipset specific, generic Applications - DHCP, DNS, BusyBox, LuCi
  • 11. Conventional firmware key concepts ● Reliable firmware ○ Checksum, custom headers ○ Read only filesystem - avoid corruption of data ● Small size ○ Flash size is small, we want to get the most of it! ● Filesystem is read only - cannot tweak after the image is built ○ NVRAM is used for persistent configuration modifications FW Header LZMA decompressor Zipped kernel NvramSquash fs chk
  • 12. Firmware and boot Boot loader Unzipped kernel Drivers Applications Boot Decompressor Filesystem
  • 13. OpenWRT vs conventional FW ● Static image ● Squashfs + Ram FS SquashFS - read only FS Temp-fs runtime cfg. NVRAM - persistent config FW Header LZMA decompressor Zipped kernel NvramSquash fs chk Kernel
  • 14. Openwrt FW and flash layout ● Applications can be installed and uninstalled in run time ● Fully Writable Filesystem! ○ Copy on write using JFFS2 SquashFS - read only FS - ROM JFFS2 - Writable Overlay - FS Kernel FW Header LZMA decompressor Zipped kernel NvramSquash fs chk JFFS2
  • 15. Copy on write ● FS Have /rom for squashFS and /overlay for JFFS2 mounts ● / mounted with overlay_fs ● Great success! SquashFS - read only FS - ROM JFFS2 - Writable Overlay - FS Kernel Write to /etc/anton Copy on write
  • 16. A lot of vendors, Different Chipsets
  • 17. OpenWRT 4 all ● Openwrt is available on different chipsets ○ Table of hardware ● Each Openwrt version for a specific router contains* ○ OpenWRT pre built image ○ SDK and cross compiling tools ● Porting packages into router is (relatively) quick and easy
  • 18. A bit about chipsets ● SoC - system on chip ● NICs ● Hardware switch
  • 19. Packages ● Over 3500 apps ○ In OPKG repository ○ Torrent client ○ Adblock ○ OpenVPN ○ Different network monitoring tools ● We can make our own packages
  • 20. Building our own package ● Build SDK ○ Toolchain + cross-compiler ○ OpenWRT makefile framework ○ Buildroot
  • 21. Cross compiling toolchains ● A set of compilers and compiling tools ● Custom made for a specific Chipset / Processor ● Released with hardware by vendor ● Usually supports c/c++ ● Contains custom libs for libc / libc++ and other utilities ○ Smaller size
  • 22. OpenWRT build infra ● On top of buildroot ● Custom makefile structure ● Part of openwrt package build process ● Custom keywords for package creation and install
  • 23. A word about buildroot ● Framework containing scripts and makefiles ● Enables to build a linux image from scratch ● Used when compiling embedded FW ○ Cross compiling friendly! ● In openwrt, used with scripts that connect to OpenWRT app feeds
  • 24. Buildroot + OpenWRT makefile infra ● Download open source code of included packages ● Compile downloaded packages with cross compiler tools ● Download and compile dependencies ● Compile any custom packages ● Build the kernel according to our specifications ● Create a rootFS filesystem ● Copy package content into rootFS ● Zip FS and create loadable image
  • 25. Demo - Building Package
  • 26. Build Package- Tutorial Checklist ● Check for OpenWRT support! ● Choose correct SDK / OpenWRT code branch ○ Download SDK from site or compile one using buildroot ● Create custom makefile ● Compile using buildroot + correct cross compiler ● Locate Package ● Copy to router ● Opkg install ● Have fun!
  • 27. OpenWRT platform ● Runs on multiple platforms and architectures ● Upgrade your router's capabilities ● Excellent research tool ● Many flavors, Active communities