Skip to content

Commit 60c1f0f

Browse files
author
Felix Fietkau
committed
finally move buildroot-ng to trunk
2 parents d58a091 + b3ce218 commit 60c1f0f

File tree

907 files changed

+495477
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

907 files changed

+495477
-0
lines changed

BSDmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
world ${.TARGETS}:
2+
@gmake $@

Config.in

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#
2+
3+
mainmenu "OpenWrt Configuration"
4+
5+
config HAVE_DOT_CONFIG
6+
bool
7+
default y
8+
9+
source "target/Config.in"
10+
11+
config ALL
12+
bool "Select all packages by default"
13+
default n
14+
15+
menuconfig DEVEL
16+
bool "Advanced configuration options (for developers)"
17+
default n
18+
select BUILDOPTS
19+
select TOOLCHAINOPTS if !NATIVE_TOOLCHAIN
20+
21+
config BROKEN
22+
bool "Show broken platforms / packages" if DEVEL
23+
default n
24+
25+
menuconfig BUILDOPTS
26+
bool "Build Options" if DEVEL
27+
28+
config AUTOREBUILD
29+
bool
30+
prompt "Automatic rebuild of packages" if BUILDOPTS
31+
default y
32+
help
33+
Automatically rebuild packages when their files change
34+
35+
config TAR_VERBOSITY
36+
bool
37+
prompt "Tar verbose" if BUILDOPTS
38+
default n
39+
40+
config JLEVEL
41+
int
42+
prompt "Number of jobs to run simultaneously" if BUILDOPTS
43+
default "1"
44+
help
45+
Number of jobs to run simultanesouly
46+
47+
config CCACHE
48+
bool
49+
prompt "Use ccache" if BUILDOPTS
50+
default n
51+
help
52+
Compiler cache; see http://ccache.samba.org/
53+
54+
source "toolchain/Config.in"
55+
source "target/sdk/Config.in"
56+
57+
menu "Target Images"
58+
config TARGET_ROOTFS_INITRAMFS
59+
bool "ramdisk"
60+
default n
61+
depends LINUX_2_6
62+
help
63+
Embed the rootfs into the kernel (initramfs)
64+
65+
config TARGET_ROOTFS_JFFS2
66+
bool "jffs2"
67+
default y if USES_JFFS2
68+
depends !TARGET_ROOTFS_INITRAMFS
69+
help
70+
Build a jffs2 root filesystem
71+
72+
config TARGET_ROOTFS_SQUASHFS
73+
bool "squashfs"
74+
default y if USES_SQUASHFS
75+
depends !TARGET_ROOTFS_INITRAMFS
76+
help
77+
Build a squashfs-lzma root filesystem
78+
79+
config TARGET_ROOTFS_TGZ
80+
bool "tgz"
81+
default y if !USES_SQUASHFS && !USES_JFFS2
82+
depends !TARGET_ROOTFS_INITRAMFS
83+
help
84+
Build a compressed tar archive of the the root filesystem
85+
86+
config TARGET_ROOTFS_EXT2FS
87+
bool "ext2"
88+
default y if !USES_SQUASHFS && !USES_JFFS2
89+
depends !TARGET_ROOTFS_INITRAMFS
90+
help
91+
Ext2 file system with some free space for uml images
92+
93+
comment "Image Options"
94+
95+
source "target/image/*/Config.in"
96+
97+
endmenu
98+
99+
source "target/linux/Config.in"
100+
source ".config.in"
101+

LICENSE

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Makefile for OpenWrt
2+
#
3+
# Copyright (C) 2006 OpenWrt.org
4+
# Copyright (C) 2006 by Felix Fietkau <[email protected]>
5+
#
6+
# This is free software, licensed under the GNU General Public License v2.
7+
# See /LICENSE for more information.
8+
#
9+
10+
RELEASE:=Kamikaze
11+
#VERSION:=2.0 # uncomment for final release
12+
13+
#--------------------------------------------------------------
14+
# Just run 'make menuconfig', configure stuff, then run 'make'.
15+
# You shouldn't need to mess with anything beyond this point...
16+
#--------------------------------------------------------------
17+
18+
all: world
19+
20+
SHELL:=/usr/bin/env bash
21+
export TOPDIR=${shell pwd}
22+
include $(TOPDIR)/include/verbose.mk
23+
24+
OPENWRTVERSION:=$(RELEASE)
25+
ifneq ($(VERSION),)
26+
OPENWRTVERSION:=$(VERSION) ($(OPENWRTVERSION))
27+
else
28+
REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
29+
ifneq ($(REV),)
30+
OPENWRTVERSION:=$(OPENWRTVERSION)/r$(REV)
31+
endif
32+
endif
33+
export OPENWRTVERSION
34+
35+
ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo)
36+
.pkginfo .config: FORCE
37+
endif
38+
39+
ifeq ($(FORCE),)
40+
.config scripts/config/conf scripts/config/mconf: .prereq-build
41+
world: .prereq-packages
42+
endif
43+
44+
.pkginfo:
45+
@echo Collecting package info...
46+
@-for dir in package/*/; do \
47+
echo Source-Makefile: $${dir}Makefile; \
48+
$(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $$dir || echo "ERROR: please fix $${dir}Makefile" >&2; \
49+
done > $@
50+
51+
pkginfo-clean: FORCE
52+
-rm -f .pkginfo .config.in
53+
54+
.config.in: .pkginfo
55+
@./scripts/gen_menuconfig.pl < $< > $@ || rm -f $@
56+
57+
.config: ./scripts/config/conf .config.in
58+
@[ -f .config ] || $(NO_TRACE_MAKE) menuconfig
59+
@$< -D .config Config.in &> /dev/null
60+
61+
scripts/config/mconf:
62+
@$(MAKE) -C scripts/config all
63+
64+
scripts/config/conf:
65+
@$(MAKE) -C scripts/config conf
66+
67+
config: scripts/config/conf .config.in FORCE
68+
$< Config.in
69+
70+
config-clean: FORCE
71+
$(NO_TRACE_MAKE) -C scripts/config clean
72+
73+
defconfig: scripts/config/conf .config.in FORCE
74+
touch .config
75+
$< -D .config Config.in
76+
77+
oldconfig: scripts/config/conf .config.in FORCE
78+
$< -o Config.in
79+
80+
menuconfig: scripts/config/mconf .config.in FORCE
81+
$< Config.in
82+
83+
package/%: .pkginfo FORCE
84+
$(MAKE) -C package $(patsubst package/%,%,$@)
85+
86+
target/%: .pkginfo FORCE
87+
$(MAKE) -C target $(patsubst target/%,%,$@)
88+
89+
tools/%: FORCE
90+
$(MAKE) -C tools $(patsubst tools/%,%,$@)
91+
92+
toolchain/%: FORCE
93+
$(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
94+
95+
.prereq-build: include/prereq-build.mk
96+
@$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
97+
echo "Prerequisite check failed. Use FORCE=1 to override."; \
98+
rm -rf $(TOPDIR)/tmp; \
99+
false; \
100+
}
101+
@rm -rf $(TOPDIR)/tmp
102+
@touch $@
103+
104+
.prereq-packages: include/prereq.mk .pkginfo .config
105+
@$(NO_TRACE_MAKE) -s -C package prereq 2>/dev/null || { \
106+
echo "Prerequisite check failed. Use FORCE=1 to override."; \
107+
false; \
108+
}
109+
@rm -rf "$(TOPDIR)/tmp"
110+
@touch $@
111+
112+
prereq: .prereq-build .prereq-packages FORCE
113+
114+
download: .config FORCE
115+
$(MAKE) tools/download
116+
$(MAKE) toolchain/download
117+
$(MAKE) package/download
118+
$(MAKE) target/download
119+
120+
world: .config FORCE
121+
$(MAKE) tools/install
122+
$(MAKE) toolchain/install
123+
$(MAKE) target/compile
124+
$(MAKE) package/compile
125+
$(MAKE) package/install
126+
$(MAKE) target/install
127+
$(MAKE) package/index
128+
129+
clean: FORCE
130+
rm -rf build_* bin
131+
132+
dirclean: clean
133+
rm -rf staging_dir_* toolchain_build_* tool_build
134+
135+
distclean: dirclean config-clean
136+
rm -rf dl .*config* .pkg* .prereq
137+
138+
.SILENT: clean dirclean distclean config-clean download world
139+
FORCE: ;
140+
.PHONY: FORCE
141+
%: ;

README

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is the buildsystem for the OpenWrt Linux distribution
2+
3+
Please use "make menuconfig" to configure your appreciated
4+
configuration for the toolchain and firmware.
5+
6+
You need to have installed gcc, binutils, patch, bzip2, flex, bison,
7+
make, gettext, pkg-config, unzip, libz-dev and libc headers.
8+
9+
Simply running 'make' will build your firmware.
10+
It will download all sources, build the cross-compile toolchain,
11+
the kernel and all choosen applications.
12+
13+
You can use scripts/flash.sh for remotely updating your embedded system
14+
via tftp.
15+
16+
The buildroot system is documented in docs/buildroot-documentation.html.
17+
18+
Building your own firmware you need to have access to a Linux system.
19+
20+
Sunshine!
21+
Your OpenWrt Project
22+
http://openwrt.org
23+
24+

docs/config.txt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
== Structure of the configuration files ==
2+
3+
The config files are divided into sections and options/values.
4+
5+
Every section has a type, but does not necessarily have a name.
6+
Every option has a name and a value and is assigned to the section
7+
it was written under.
8+
9+
Syntax:
10+
11+
config <type> [<name>] # Section
12+
option <name> <value> # Option
13+
14+
15+
Every parameter needs to be a single string and is formatted exactly
16+
like a parameter for a shell function. The same rules for Quoting and
17+
special characters also apply, as it is parsed by the shell.
18+
19+
20+
21+
== Parsing configuration files in custom scripts ==
22+
23+
To be able to load configuration files, you need to include the common
24+
functions with:
25+
26+
. /etc/functions.sh
27+
28+
Then you can use config_load <name> to load config files. The function
29+
first checks for <name> as absolute filename and falls back to loading
30+
it from /etc/config (which is the most common way of using it).
31+
32+
If you want to use special callbacks for sections and/or options, you
33+
need to define the following shell functions before running config_load
34+
(after including /etc/functions.sh):
35+
36+
config_cb() {
37+
local type="$1"
38+
local name="$2"
39+
# commands to be run for every section
40+
}
41+
42+
option_cb() {
43+
# commands to be run for every option
44+
}
45+
46+
You can also alter option_cb from config_cb based on the section type.
47+
This allows you to process every single config section based on its type
48+
individually.
49+
50+
config_cb is run every time a new section starts (before options are being
51+
processed). You can access the last section through the CONFIG_SECTION
52+
variable. Also an extra call to config_cb (without a new section) is generated
53+
after config_load is done.
54+
That allows you to process sections both before and after all options were
55+
processed.
56+
57+
You can access already processed options with the config_get command
58+
Syntax:
59+
60+
config_get <section> <option> # prints the value of the option
61+
config_get <variable> <section> <option> # stores the value inside the variable
62+
63+
In busybox ash the three-option config_get is faster, because it does not
64+
result in an extra fork, so it is the preferred way.
65+
66+
Additionally you can also modify or add options to sections by using the
67+
config_set command.
68+
69+
Syntax:
70+
71+
config_set <section> <option> <value>
72+

docs/network-scripts.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Structure of the network scripts in buildroot-ng
2+
3+
4+
1) Usage
5+
6+
To be able to access the network functions, you need to include
7+
the necessary shell scripts by running:
8+
9+
. /etc/functions.sh # common functions
10+
include /lib/network # include /lib/network/*.sh
11+
scan_interfaces # read and parse the network config
12+
13+
Some protocols, such as PPP might change the configured interface names
14+
at run time (e.g. eth0 => ppp0 for PPPoE). That's why you have to run
15+
scan_interfaces instead of reading the values from the config directly.
16+
After running scan_interfaces, the 'ifname' option will always contain
17+
the effective interface name (which is used for IP traffic) and if the
18+
physical device name differs from it, it will be stored in the 'device'
19+
option.
20+
That means that running 'config_get lan ifname' after scan_interfaces
21+
might not return the same result as running it before.
22+
23+
After running scan_interfaces, the following functions are available:
24+
25+
- find_config <interface> looks for a network configuration that includes
26+
the specified network interface.
27+
28+
- setup_interface <interface> [<config>] [<protocol>] will set up the
29+
specified interface, optionally overriding the network configuration
30+
name or the protocol that it uses.
31+
32+
33+
34+
2) Writing protocol handlers
35+
36+
You can add custom protocol handlers by adding shell scripts to
37+
/lib/network. They provide the following two shell functions:
38+
39+
scan_<protocolname>() {
40+
local config="$1"
41+
# change the interface names if necessary
42+
}
43+
44+
setup_interface_<protocolname>() {
45+
local interface="$1"
46+
local config="$2"
47+
# set up the interface
48+
}
49+
50+
scan_<protocolname> is optional and only necessary if your protocol
51+
uses a custom device, e.g. a tunnel or a PPP device.
52+

0 commit comments

Comments
 (0)