Variables for board.mk

Board definition

SOC_VENDOR

A valid value would be a directory name from ./socs (http://zrouter.org/projects/zrouter/repository/show/socs).

SOC_CHIP

A valid value would be a directory name from ./socs/${SOC_VENDOR}.

BOARD_FLASH_TYPE

Obsolete, don't use it.

BOARD_FLASH_SIZE

Physical capacity of the flash chip in bytes. Valid values are numbers, hex numbers, or numbers with trailing M or K.

e.g.:
BOARD_FLASH_SIZE=8388608
BOARD_FLASH_SIZE=0x00800000
BOARD_FLASH_SIZE=8M
BOARD_FLASH_SIZE=8192K

Customize kernel

KERNCONF_IDENT

Usually ${TARGET_VENDOR}_${TARGET_DEVICE}

WITH_USB

If defined (e.g. set to WITH_USB=yes), build with kernel modules like usb, ehci, umass, etc. (see ./socs/${SOC_VENDOR}/${SOC_CHIP}/soc.mk).

KERNCONF_MODULES_OVERRIDE

Use this to append additional kernel modules, e.g. for some common USB stuff:
KERNCONF_MODULES_OVERRIDE+=usb/uplcom usb/u3g usb/umodem usb/ucom cam zlib
or for WLAN:
KERNCONF_MODULES_OVERRIDE+=wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt

Customize world

WORLD_SUBDIRS_ZROUTER

?? Additional utilities, e.g. WORLD_SUBDIRS_ZROUTER+=target/sbin/upgrade

WORLD_BUILD_ENV_EXTRA

Allow to add extra flags for buildworld.

TARGET_PROFILES

TARGET_PROFILES+=SMALL_
#TARGET_PROFILES+=SMALL_ mpd ssh shttpd dlink.ua.web hostap dhcp nfs_client # mono # racoon

Firmware image options

FIRMWARE_IMAGE_SIZE_MAX

The Image must not be bigger than the geom_map 'upgrade' partition (see Partition_layout), but other limitations can apply. For example NQ-900 has 32M of RAM and 16M of flash, but it is hard to download 16M image when you have only 32M of RAM.

e.g. FIRMWARE_IMAGE_SIZE_MAX=0x007a0000

KERNEL_COMPRESSION

KERNEL_COMPRESSION=oldlzma
KERNEL_COMPRESSION_TYPE=oldlzma
UBOOT_KERNEL_COMPRESSION_TYPE=lzma
MKULZMA_BLOCKSIZE=65536

PACKING_KERNEL_IMAGE

A converter chain to use on the built FreeBSD kernel.

e.g. PACKING_KERNEL_IMAGE?=kernel.strip.oldlzma.uboot.sync

Available converters for kernel (also look at source:share/mk/converters):
  • bz2 to compress the kernel with bzip2 (depends on bootloader if he can decompress in the given format)
  • gz to compress the kernel with gzip (depends on bootloader if he can decompress in the given format)
  • kbin will do "objcopy -O binary ..." on the ELF-kernel, the result is a smaller binary kernel (without ELF header)
  • oldlzma to compress the kernel with old release of lzma (depends on bootloader if he can decompress in the given format)
  • strip will strip symbols from the kernel to save space
  • sync pad kernel with zeros to block size (like dd(1) conv=sync option do). Example: if kernel size is 127k and flash block size is 64k, it become 128k with 1k zeros in it.
  • uboot pack kernel with U-Boot mkimage (uboot_mkimage) tool
  • xz to compress the kernel with xz (depends on bootloader if he can decompress in the given format)

PACKING_ROOTFS_IMAGE

A converter chain to use on the built rootfs file system.

e.g. PACKING_ROOTFS_IMAGE?=rootfs_clean.iso.ulzma

Available converters for rootfs (also look at source:share/mk/converters):
  • iso pack rootfs as iso9660 file system
  • ffs pack rootfs as FFS/UFS file system
  • tar pack rootfs with regular tar(1) utility
  • bz2, gz, xz, sync can be also applied if required (see PACKING_KERNEL_IMAGE)

NEW_IMAGE_TYPE

Valid values:
  • zimage (for regular uboot images, see zimage)
  • ubntimage (for Ubiquty boards)
  • trximage
  • tplink_image (for some TP-Link boards with 'special' uboot)
  • split_kernel_rootfs

e.g. NEW_IMAGE_TYPE=zimage

Variables for profile.mk

WORLD_SUBDIRS

WORLD_SUBDIRS_BIN

A shortcut that add to WORLD_SUBDIRS each bin/${item}

WORLD_SUBDIRS_SBIN

A shortcut that add to WORLD_SUBDIRS each sbin/${item}

WORLD_SUBDIRS_USR_SBIN

A shortcut that add to WORLD_SUBDIRS each usr.sbin/${item}

WORLD_SUBDIRS_USR_BIN

A shortcut that add to WORLD_SUBDIRS each usr.bin/${item}

WORLD_SUBDIRS_LIB

A shortcut that add to WORLD_SUBDIRS each lib/${item}