Try   HackMD

Building guide


Update and install feeds


OpenWrt Feeds

In OpenWrt, a “feed” is a collection of packages which share a common location.

./scripts/feeds update -a
./scripts/feeds install -a

Configure target and options


make menuconfig

E.g. for target "armvirt32"

Target System (QEMU ARM Virtual Machine)  --->                                                       │ │   
Subtarget (QEMU ARM Virtual Machine (cortex-a15))  --->                                              │ │   

Build image


make -j1 V=sc

The parameter V=x specifies level of messages in the process of the build.

    V=99 and V=1 are now deprecated in favor of a new verbosity class system,
    though the old flags are still supported.
    You can set the V variable on the command line (or OPENWRT_VERBOSE in the
    environment) to one or more of the following characters:
    
    - s: stdout+stderr (equal to the old V=99)
    - c: commands (for build systems that suppress commands by default, e.g. kbuild, cmake)
    - w: warnings/errors only (equal to the old V=1)

Completion can take time. If successful, the images are in directory ./bin/targets/armvirt/32

~/openwrt/bin/targets/armvirt/32$ ls
config.buildinfo                          openwrt-armvirt-32-root.ext4         openwrt-armvirt-32-zImage            version.buildinfo
feeds.buildinfo                           openwrt-armvirt-32-root.ext4.gz      openwrt-armvirt-32-zImage-initramfs
openwrt-armvirt-32-default.manifest       openwrt-armvirt-32-rootfs.cpio.gz    packages
openwrt-armvirt-32-default-rootfs.tar.gz  openwrt-armvirt-32-root.squashfs.gz  sha256sums

Building single packages


~/openwrt$ make package/network/services/dnsmasq/compile V=s

For a rebuild

~/openwrt$ make package/network/services/dnsmasq/clean V=s
~/openwrt$ make package/network/services/dnsmasq/compile V=s

Cleaning up


Clean


make clean

deletes contents of the directories /bin and /build_dir.

Dirclean


make dirclean

deletes contents of the directories /bin and /build_dir and additionally /staging_dir and /toolchain (=the cross-compile tools), /tmp (e.g data about packages) and /logs.

Distclean


make distclean

nukes everything you have compiled or configured and also deletes all downloaded feeds contents and package sources.

In addition to all else, this will erase your build configuration (<buildroot_dir>/.config).

Clean less


Clean linux objects.

make target/linux/clean

Clean package base-files objects.

make package/base-files/clean