89

OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

  • Upload
    others

  • View
    22

  • Download
    2

Embed Size (px)

Citation preview

Page 1: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OpenWrt Hacking

Felix Fietkau

December 27, 2005

Felix Fietkau OpenWrt Hacking

Page 2: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Overview

1 Introduction

Overview

What is OpenWrt?

New features

2 Building packages and images

Software Development Kit

Image Builder

Package directories

The package Make�le

3 Structure of the Buildroot

Buildroot directories

The toolchain/ directory

The package/ directory

The target/ directory

Felix Fietkau OpenWrt Hacking

Page 3: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Overview

1 Introduction

Overview

What is OpenWrt?

New features

2 Building packages and images

Software Development Kit

Image Builder

Package directories

The package Make�le

3 Structure of the Buildroot

Buildroot directories

The toolchain/ directory

The package/ directory

The target/ directory

Felix Fietkau OpenWrt Hacking

Page 4: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Overview

1 Introduction

Overview

What is OpenWrt?

New features

2 Building packages and images

Software Development Kit

Image Builder

Package directories

The package Make�le

3 Structure of the Buildroot

Buildroot directories

The toolchain/ directory

The package/ directory

The target/ directory

Felix Fietkau OpenWrt Hacking

Page 5: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 6: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 7: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 8: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 9: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4

Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 10: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 11: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 12: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)

Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 13: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7

Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 14: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)

Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 15: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)

RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 16: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

Introduction to OpenWrt

Linux distribution for embedded wireless routers

Runs on inexpensive hardware

Free Software under the GNU GPL

Stable version:

Linux 2.4Single platform: BCM947xx (or BCM953xx)

Development version:

Linux 2.4 and Linux 2.6 (depending on target platform)Texas Instruments AR7Embedded X86 (Soekris, WRAP, etc.)Atheros AR531x/231x (planned)RouterBoard 5xx (planned)

Felix Fietkau OpenWrt Hacking

Page 17: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 18: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xes

A web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 19: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interface

Scripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 20: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system events

Better performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 21: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 22: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 23: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platforms

Network scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 24: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewrite

Multiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 25: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

OverviewWhat is OpenWrt?New features

New Features

Version 1.0, codename: 'White Russian'

Lots of bug �xesA web interfaceScripts for handling system eventsBetter performance and faster boot time

Version 2.0, codename: 'Kamikaze'

New platformsNetwork scripts rewriteMultiple SSIDs for the Broadcom platform

Felix Fietkau OpenWrt Hacking

Page 26: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Building packages and images

Felix Fietkau OpenWrt Hacking

Page 27: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 28: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 29: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 30: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 31: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 32: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/

(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 33: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mk

run make

Felix Fietkau OpenWrt Hacking

Page 34: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Software Development Kit

Generated from the Buildroot

Compiles packages

Uses buildroot-compatible package directories

Contains precompiled versions of the toolchain and all libraries

Using the SDK:

Copy the package directory in package/(optional) add dependencies in package/depend.mkrun make

Felix Fietkau OpenWrt Hacking

Page 35: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 36: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 37: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 38: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 39: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 40: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 41: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/

run make

Felix Fietkau OpenWrt Hacking

Page 42: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Image Builder

Generated from the Buildroot

Builds images from package lists

Contains all binary packages and image building software

Using the Image Builder:

(optional) Add extra packages to packages/

(optional) Add extra �les to files/

(optional) Modify/add package lists in lists/run make

Felix Fietkau OpenWrt Hacking

Page 43: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Anatomy of a package directory

./Config.in

Menucon�g con�guration items for the package

./Makefile

Main make�le containing all build instructions

./ipkg/

ipkg control �les and scripts

./patches/

Contains patches for the package

./files/

Extra �les for the package or the package build

Felix Fietkau OpenWrt Hacking

Page 44: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Anatomy of a package directory

./Config.in

Menucon�g con�guration items for the package

./Makefile

Main make�le containing all build instructions

./ipkg/

ipkg control �les and scripts

./patches/

Contains patches for the package

./files/

Extra �les for the package or the package build

Felix Fietkau OpenWrt Hacking

Page 45: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Anatomy of a package directory

./Config.in

Menucon�g con�guration items for the package

./Makefile

Main make�le containing all build instructions

./ipkg/

ipkg control �les and scripts

./patches/

Contains patches for the package

./files/

Extra �les for the package or the package build

Felix Fietkau OpenWrt Hacking

Page 46: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Anatomy of a package directory

./Config.in

Menucon�g con�guration items for the package

./Makefile

Main make�le containing all build instructions

./ipkg/

ipkg control �les and scripts

./patches/

Contains patches for the package

./files/

Extra �les for the package or the package build

Felix Fietkau OpenWrt Hacking

Page 47: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

Anatomy of a package directory

./Config.in

Menucon�g con�guration items for the package

./Makefile

Main make�le containing all build instructions

./ipkg/

ipkg control �les and scripts

./patches/

Contains patches for the package

./files/

Extra �les for the package or the package build

Felix Fietkau OpenWrt Hacking

Page 48: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package menucon�g �le

Syntax: Linux 2.6 menucon�g

Example:

config BR2_PACKAGE_WEBIF

select BR2_PACKAGE_HASERL

tristate "webif - OpenWrt Administrative Console"

default y

help

A web interface for configuring OpenWrt

Felix Fietkau OpenWrt Hacking

Page 49: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package menucon�g �le

Syntax: Linux 2.6 menucon�g

Example:

config BR2_PACKAGE_WEBIF

select BR2_PACKAGE_HASERL

tristate "webif - OpenWrt Administrative Console"

default y

help

A web interface for configuring OpenWrt

Felix Fietkau OpenWrt Hacking

Page 50: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

1. Header:

include $(TOPDIR)/rules.mk

PKG_NAME:=strace

PKG_VERSION:=4.5.11

PKG_RELEASE:=1

PKG_MD5SUM:=28335e15c83456a3db055a0a0efcb4fe

PKG_SOURCE_URL:=@SF/strace

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2

PKG_CAT:=bzcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(TOPDIR)/package/rules.mk

Felix Fietkau OpenWrt Hacking

Page 51: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

1. Header:

include $(TOPDIR)/rules.mk

PKG_NAME:=strace

PKG_VERSION:=4.5.11

PKG_RELEASE:=1

PKG_MD5SUM:=28335e15c83456a3db055a0a0efcb4fe

PKG_SOURCE_URL:=@SF/strace

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2

PKG_CAT:=bzcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(TOPDIR)/package/rules.mk

Felix Fietkau OpenWrt Hacking

Page 52: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

2. Package declaration:

$(eval $(call PKG_template,STRACE,strace,\

$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

3. Important build targets:

$(PKG_BUILD_DIR)/.configured:

# run the package ./configure script

touch $@

$(PKG_BUILD_DIR)/.built:

# run the package makefile

touch $@

Felix Fietkau OpenWrt Hacking

Page 53: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

2. Package declaration:

$(eval $(call PKG_template,STRACE,strace,\

$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

3. Important build targets:

$(PKG_BUILD_DIR)/.configured:

# run the package ./configure script

touch $@

$(PKG_BUILD_DIR)/.built:

# run the package makefile

touch $@

Felix Fietkau OpenWrt Hacking

Page 54: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

2. Package declaration:

$(eval $(call PKG_template,STRACE,strace,\

$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

3. Important build targets:

$(PKG_BUILD_DIR)/.configured:

# run the package ./configure script

touch $@

$(PKG_BUILD_DIR)/.built:

# run the package makefile

touch $@

Felix Fietkau OpenWrt Hacking

Page 55: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

2. Package declaration:

$(eval $(call PKG_template,STRACE,strace,\

$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

3. Important build targets:

$(PKG_BUILD_DIR)/.configured:

# run the package ./configure script

touch $@

$(PKG_BUILD_DIR)/.built:

# run the package makefile

touch $@

Felix Fietkau OpenWrt Hacking

Page 56: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

2. Package declaration:

$(eval $(call PKG_template,STRACE,strace,\

$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

3. Important build targets:

$(PKG_BUILD_DIR)/.configured:

# run the package ./configure script

touch $@

$(PKG_BUILD_DIR)/.built:

# run the package makefile

touch $@

Felix Fietkau OpenWrt Hacking

Page 57: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

4. Package targets:

$(IPKG_STRACE):

# copy all files into $(IDIR_STRACE)

$(IPKG_BUILD) $(IDIR_STRACE) $(PACKAGE_DIR)

5. Extra targets:

mostlyclean:

# run make clean in the package directory

Felix Fietkau OpenWrt Hacking

Page 58: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

4. Package targets:

$(IPKG_STRACE):

# copy all files into $(IDIR_STRACE)

$(IPKG_BUILD) $(IDIR_STRACE) $(PACKAGE_DIR)

5. Extra targets:

mostlyclean:

# run make clean in the package directory

Felix Fietkau OpenWrt Hacking

Page 59: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

4. Package targets:

$(IPKG_STRACE):

# copy all files into $(IDIR_STRACE)

$(IPKG_BUILD) $(IDIR_STRACE) $(PACKAGE_DIR)

5. Extra targets:

mostlyclean:

# run make clean in the package directory

Felix Fietkau OpenWrt Hacking

Page 60: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

4. Package targets:

$(IPKG_STRACE):

# copy all files into $(IDIR_STRACE)

$(IPKG_BUILD) $(IDIR_STRACE) $(PACKAGE_DIR)

5. Extra targets:

mostlyclean:

# run make clean in the package directory

Felix Fietkau OpenWrt Hacking

Page 61: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Software Development KitImage BuilderPackage directoriesThe package Make�le

The package Make�le

5. Extra targets:

compile-targets: install-dev

clean-targets: uninstall-dev

install-dev:

# run make install and install development

# headers/libraries into $(STAGING_DIR)

uninstall-dev:

# remove all development files of this

# package from $(STAGING_DIR)

Felix Fietkau OpenWrt Hacking

Page 62: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 63: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 64: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 65: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 66: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 67: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 68: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 69: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 70: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

Buildroot directories

Source directories

toolchain/

package/

target/

scripts/

Build directories

toolchain_build_<arch> /

staging_dir_<arch> /

build_<arch> /

Felix Fietkau OpenWrt Hacking

Page 71: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The toolchain/ directory

unpacks kernel headers

builds binutils

builds initial gcc

uses initial gcc to build uClibc

builds �nal gcc

(optional) builds binutils

Felix Fietkau OpenWrt Hacking

Page 72: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The toolchain/ directory

unpacks kernel headers

builds binutils

builds initial gcc

uses initial gcc to build uClibc

builds �nal gcc

(optional) builds binutils

Felix Fietkau OpenWrt Hacking

Page 73: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The toolchain/ directory

unpacks kernel headers

builds binutils

builds initial gcc

uses initial gcc to build uClibc

builds �nal gcc

(optional) builds binutils

Felix Fietkau OpenWrt Hacking

Page 74: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The toolchain/ directory

unpacks kernel headers

builds binutils

builds initial gcc

uses initial gcc to build uClibc

builds �nal gcc

(optional) builds binutils

Felix Fietkau OpenWrt Hacking

Page 75: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The toolchain/ directory

unpacks kernel headers

builds binutils

builds initial gcc

uses initial gcc to build uClibc

builds �nal gcc

(optional) builds binutils

Felix Fietkau OpenWrt Hacking

Page 76: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The toolchain/ directory

unpacks kernel headers

builds binutils

builds initial gcc

uses initial gcc to build uClibc

builds �nal gcc

(optional) builds binutils

Felix Fietkau OpenWrt Hacking

Page 77: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The package/ directory

Build directories for all packages

Exception: kernel-modules and kernel-speci�c packages

Makefile

handles package dependencies

Config.in

includes all package menucon�g �les

Felix Fietkau OpenWrt Hacking

Page 78: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The package/ directory

Build directories for all packages

Exception: kernel-modules and kernel-speci�c packages

Makefile

handles package dependencies

Config.in

includes all package menucon�g �les

Felix Fietkau OpenWrt Hacking

Page 79: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The package/ directory

Build directories for all packages

Exception: kernel-modules and kernel-speci�c packages

Makefile

handles package dependencies

Config.in

includes all package menucon�g �les

Felix Fietkau OpenWrt Hacking

Page 80: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The package/ directory

Build directories for all packages

Exception: kernel-modules and kernel-speci�c packages

Makefile

handles package dependencies

Config.in

includes all package menucon�g �les

Felix Fietkau OpenWrt Hacking

Page 81: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 82: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernel

Calls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 83: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 84: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 85: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directory

Builds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 86: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 87: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 88: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware images

Subdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking

Page 89: OpenWrt Hacking - Chaos Computer ClubOpenWrt Hacking Felix Fietkau December 27, 2005 elixF Fietkau OpenWrt Hacking. Introduction Building packages and images Structure of the Buildroot

IntroductionBuilding packages and images

Structure of the Buildroot

Buildroot directoriesThe toolchain/ directoryThe package/ directoryThe target/ directory

The target/ directory

linux/linux-<2.4|2.6>

Compiles/installs the kernelCalls target/linux/package/

linux/package/

Similar to the main package/ directoryBuilds kernel-speci�c packages (e.g. modules)

linux/image/

Builds �rmware imagesSubdirectories for �lesystems and system types

Felix Fietkau OpenWrt Hacking