Skip to content

Commit

Permalink
finally move buildroot-ng to trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Fietkau committed Mar 20, 2016
2 parents d58a091 + b3ce218 commit 60c1f0f
Show file tree
Hide file tree
Showing 907 changed files with 495,477 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BSDmakefile
@@ -0,0 +1,2 @@
world ${.TARGETS}:
@gmake $@
101 changes: 101 additions & 0 deletions Config.in
@@ -0,0 +1,101 @@
#

mainmenu "OpenWrt Configuration"

config HAVE_DOT_CONFIG
bool
default y

source "target/Config.in"

config ALL
bool "Select all packages by default"
default n

menuconfig DEVEL
bool "Advanced configuration options (for developers)"
default n
select BUILDOPTS
select TOOLCHAINOPTS if !NATIVE_TOOLCHAIN

config BROKEN
bool "Show broken platforms / packages" if DEVEL
default n

menuconfig BUILDOPTS
bool "Build Options" if DEVEL

config AUTOREBUILD
bool
prompt "Automatic rebuild of packages" if BUILDOPTS
default y
help
Automatically rebuild packages when their files change

config TAR_VERBOSITY
bool
prompt "Tar verbose" if BUILDOPTS
default n

config JLEVEL
int
prompt "Number of jobs to run simultaneously" if BUILDOPTS
default "1"
help
Number of jobs to run simultanesouly

config CCACHE
bool
prompt "Use ccache" if BUILDOPTS
default n
help
Compiler cache; see http://ccache.samba.org/

source "toolchain/Config.in"
source "target/sdk/Config.in"

menu "Target Images"
config TARGET_ROOTFS_INITRAMFS
bool "ramdisk"
default n
depends LINUX_2_6
help
Embed the rootfs into the kernel (initramfs)

config TARGET_ROOTFS_JFFS2
bool "jffs2"
default y if USES_JFFS2
depends !TARGET_ROOTFS_INITRAMFS
help
Build a jffs2 root filesystem

config TARGET_ROOTFS_SQUASHFS
bool "squashfs"
default y if USES_SQUASHFS
depends !TARGET_ROOTFS_INITRAMFS
help
Build a squashfs-lzma root filesystem

config TARGET_ROOTFS_TGZ
bool "tgz"
default y if !USES_SQUASHFS && !USES_JFFS2
depends !TARGET_ROOTFS_INITRAMFS
help
Build a compressed tar archive of the the root filesystem

config TARGET_ROOTFS_EXT2FS
bool "ext2"
default y if !USES_SQUASHFS && !USES_JFFS2
depends !TARGET_ROOTFS_INITRAMFS
help
Ext2 file system with some free space for uml images

comment "Image Options"

source "target/image/*/Config.in"

endmenu

source "target/linux/Config.in"
source ".config.in"

340 changes: 340 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

141 changes: 141 additions & 0 deletions Makefile
@@ -0,0 +1,141 @@
# Makefile for OpenWrt
#
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 by Felix Fietkau <openwrt@nbd.name>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

RELEASE:=Kamikaze
#VERSION:=2.0 # uncomment for final release

#--------------------------------------------------------------
# Just run 'make menuconfig', configure stuff, then run 'make'.
# You shouldn't need to mess with anything beyond this point...
#--------------------------------------------------------------

all: world

SHELL:=/usr/bin/env bash
export TOPDIR=${shell pwd}
include $(TOPDIR)/include/verbose.mk

OPENWRTVERSION:=$(RELEASE)
ifneq ($(VERSION),)
OPENWRTVERSION:=$(VERSION) ($(OPENWRTVERSION))
else
REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
ifneq ($(REV),)
OPENWRTVERSION:=$(OPENWRTVERSION)/r$(REV)
endif
endif
export OPENWRTVERSION

ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo)
.pkginfo .config: FORCE
endif

ifeq ($(FORCE),)
.config scripts/config/conf scripts/config/mconf: .prereq-build
world: .prereq-packages
endif

.pkginfo:
@echo Collecting package info...
@-for dir in package/*/; do \
echo Source-Makefile: $${dir}Makefile; \
$(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $$dir || echo "ERROR: please fix $${dir}Makefile" >&2; \
done > $@

pkginfo-clean: FORCE
-rm -f .pkginfo .config.in

.config.in: .pkginfo
@./scripts/gen_menuconfig.pl < $< > $@ || rm -f $@

.config: ./scripts/config/conf .config.in
@[ -f .config ] || $(NO_TRACE_MAKE) menuconfig
@$< -D .config Config.in &> /dev/null

scripts/config/mconf:
@$(MAKE) -C scripts/config all

scripts/config/conf:
@$(MAKE) -C scripts/config conf

config: scripts/config/conf .config.in FORCE
$< Config.in

config-clean: FORCE
$(NO_TRACE_MAKE) -C scripts/config clean

defconfig: scripts/config/conf .config.in FORCE
touch .config
$< -D .config Config.in

oldconfig: scripts/config/conf .config.in FORCE
$< -o Config.in

menuconfig: scripts/config/mconf .config.in FORCE
$< Config.in

package/%: .pkginfo FORCE
$(MAKE) -C package $(patsubst package/%,%,$@)

target/%: .pkginfo FORCE
$(MAKE) -C target $(patsubst target/%,%,$@)

tools/%: FORCE
$(MAKE) -C tools $(patsubst tools/%,%,$@)

toolchain/%: FORCE
$(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)

.prereq-build: include/prereq-build.mk
@$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
echo "Prerequisite check failed. Use FORCE=1 to override."; \
rm -rf $(TOPDIR)/tmp; \
false; \
}
@rm -rf $(TOPDIR)/tmp
@touch $@

.prereq-packages: include/prereq.mk .pkginfo .config
@$(NO_TRACE_MAKE) -s -C package prereq 2>/dev/null || { \
echo "Prerequisite check failed. Use FORCE=1 to override."; \
false; \
}
@rm -rf "$(TOPDIR)/tmp"
@touch $@

prereq: .prereq-build .prereq-packages FORCE

download: .config FORCE
$(MAKE) tools/download
$(MAKE) toolchain/download
$(MAKE) package/download
$(MAKE) target/download

world: .config FORCE
$(MAKE) tools/install
$(MAKE) toolchain/install
$(MAKE) target/compile
$(MAKE) package/compile
$(MAKE) package/install
$(MAKE) target/install
$(MAKE) package/index

clean: FORCE
rm -rf build_* bin

dirclean: clean
rm -rf staging_dir_* toolchain_build_* tool_build

distclean: dirclean config-clean
rm -rf dl .*config* .pkg* .prereq

.SILENT: clean dirclean distclean config-clean download world
FORCE: ;
.PHONY: FORCE
%: ;
24 changes: 24 additions & 0 deletions README
@@ -0,0 +1,24 @@
This is the buildsystem for the OpenWrt Linux distribution

Please use "make menuconfig" to configure your appreciated
configuration for the toolchain and firmware.

You need to have installed gcc, binutils, patch, bzip2, flex, bison,
make, gettext, pkg-config, unzip, libz-dev and libc headers.

Simply running 'make' will build your firmware.
It will download all sources, build the cross-compile toolchain,
the kernel and all choosen applications.

You can use scripts/flash.sh for remotely updating your embedded system
via tftp.

The buildroot system is documented in docs/buildroot-documentation.html.

Building your own firmware you need to have access to a Linux system.

Sunshine!
Your OpenWrt Project
http://openwrt.org


72 changes: 72 additions & 0 deletions docs/config.txt
@@ -0,0 +1,72 @@
== Structure of the configuration files ==

The config files are divided into sections and options/values.

Every section has a type, but does not necessarily have a name.
Every option has a name and a value and is assigned to the section
it was written under.

Syntax:

config <type> [<name>] # Section
option <name> <value> # Option


Every parameter needs to be a single string and is formatted exactly
like a parameter for a shell function. The same rules for Quoting and
special characters also apply, as it is parsed by the shell.



== Parsing configuration files in custom scripts ==

To be able to load configuration files, you need to include the common
functions with:

. /etc/functions.sh

Then you can use config_load <name> to load config files. The function
first checks for <name> as absolute filename and falls back to loading
it from /etc/config (which is the most common way of using it).

If you want to use special callbacks for sections and/or options, you
need to define the following shell functions before running config_load
(after including /etc/functions.sh):

config_cb() {
local type="$1"
local name="$2"
# commands to be run for every section
}

option_cb() {
# commands to be run for every option
}

You can also alter option_cb from config_cb based on the section type.
This allows you to process every single config section based on its type
individually.

config_cb is run every time a new section starts (before options are being
processed). You can access the last section through the CONFIG_SECTION
variable. Also an extra call to config_cb (without a new section) is generated
after config_load is done.
That allows you to process sections both before and after all options were
processed.

You can access already processed options with the config_get command
Syntax:

config_get <section> <option> # prints the value of the option
config_get <variable> <section> <option> # stores the value inside the variable

In busybox ash the three-option config_get is faster, because it does not
result in an extra fork, so it is the preferred way.

Additionally you can also modify or add options to sections by using the
config_set command.

Syntax:

config_set <section> <option> <value>

52 changes: 52 additions & 0 deletions docs/network-scripts.txt
@@ -0,0 +1,52 @@
Structure of the network scripts in buildroot-ng


1) Usage

To be able to access the network functions, you need to include
the necessary shell scripts by running:

. /etc/functions.sh # common functions
include /lib/network # include /lib/network/*.sh
scan_interfaces # read and parse the network config

Some protocols, such as PPP might change the configured interface names
at run time (e.g. eth0 => ppp0 for PPPoE). That's why you have to run
scan_interfaces instead of reading the values from the config directly.
After running scan_interfaces, the 'ifname' option will always contain
the effective interface name (which is used for IP traffic) and if the
physical device name differs from it, it will be stored in the 'device'
option.
That means that running 'config_get lan ifname' after scan_interfaces
might not return the same result as running it before.

After running scan_interfaces, the following functions are available:

- find_config <interface> looks for a network configuration that includes
the specified network interface.

- setup_interface <interface> [<config>] [<protocol>] will set up the
specified interface, optionally overriding the network configuration
name or the protocol that it uses.



2) Writing protocol handlers

You can add custom protocol handlers by adding shell scripts to
/lib/network. They provide the following two shell functions:

scan_<protocolname>() {
local config="$1"
# change the interface names if necessary
}

setup_interface_<protocolname>() {
local interface="$1"
local config="$2"
# set up the interface
}

scan_<protocolname> is optional and only necessary if your protocol
uses a custom device, e.g. a tunnel or a PPP device.

0 comments on commit 60c1f0f

Please sign in to comment.