Using config diffs in buildroot without needing to manually track depedencies

My problem: I want my buildroot (18.05) to always build and include "important-package" and any dependencies it requires.

Current solution:

  • set up the buildroot
  • run make menuconfig
  • select "important-package"
  • save config
  • run scripts/diffconfig.sh > config_seed
  • commit config_seed to version control and do cp config_seed .config for future builds

My problem with this solution is this: say that the last time I built an image, "important-package" depended on "big-lib". That will have been captured in config_seed too. But the package maintainer has now removed that dependency, and so this week I'm building and installing "big-lib" and all its dependencies for no reason.

I have quite a few such packages like this, and it's becoming tedious to redo the make menuconfig step every time something changes (which is what the diffconfig method is supposed to help with). I'd rather just have a file like config_seed that contains only the direct packages I'm interested in, ie. "important-package", and not its dependencies.

Is there a way to do this? I suppose I can create a pseudo-package that only has a DEPENDS line and drop it in the private repository I already use, but is there a simpler way?

Usually I just edit config_seed directly and enable only "direct packages" in there.

Then

cp config_seed .config
make defconfig

It should bring in all current dependencies of those "direct packages"

I was not aware it would resolve them! That makes things much simpler.

No automatic way.
You need to manually edit the saved config_seed. Just leave the router selection plus those packages that you actually have selected, and delete all automatically pulled dependencies.

I have done that for years, and use a nice small recipe for my community builds.

Example of my R7800 master recipe (slightly old version, from April 2020, but it was copyable in a previous post here):

# Use "make defconfig" to expand this to a full .config
CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_ipq806x_generic=y
CONFIG_TARGET_ipq806x_generic_DEVICE_netgear_r7800=y

# Per-package build logs in <buildroot>/logs
CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y

# Debugging options (build gdbserver, include package debug)
CONFIG_PACKAGE_gdbserver=m
CONFIG_DEBUG=y

# Include package list in build
CONFIG_INCLUDE_CONFIG=y

# exfat is patented
CONFIG_BUILD_PATENTED=y

# Longer waiting for failsafe button push
CONFIG_IMAGEOPT=y
CONFIG_PREINITOPT=y
CONFIG_TARGET_PREINIT_TIMEOUT=5

# Busybox tweaks
CONFIG_BUSYBOX_CUSTOM=y
#CONFIG_BUSYBOX_CONFIG_DIFF=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_FLAGS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_WINCH=y

# Add-on programs
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_ccrypt=y
CONFIG_PACKAGE_curl=y
CONFIG_LIBCURL_OPENSSL=y
#CONFIG_PACKAGE_vsftpd-tls=y
CONFIG_PACKAGE_wget=y
CONFIG_PACKAGE_patch=y
CONFIG_PACKAGE_diffutils=y
CONFIG_PACKAGE_tree=y
CONFIG_PACKAGE_irqbalance=y
CONFIG_DROPBEAR_ECC=y

# USB device mount & file systems support
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-fs-cifs=y
CONFIG_PACKAGE_kmod-fs-exfat=y
CONFIG_PACKAGE_libblkid=y
CONFIG_PACKAGE_kmod-fs-ext4=y
CONFIG_PACKAGE_kmod-fs-hfsplus=y
CONFIG_PACKAGE_kmod-fs-msdos=y
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_kmod-nls-cp1250=y
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-cp850=y
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-nls-iso8859-15=y
CONFIG_PACKAGE_kmod-nls-utf8=y

# IPv6 support
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_6to4=y
CONFIG_PACKAGE_6rd=y

# IPv6 NAT support (ip6tables NAT extensions, ipt-nat6 and nf-nat6 kmods)
###CONFIG_PACKAGE_ip6tables-mod-nat=y

# WLAN/WPS support
CONFIG_PACKAGE_hostapd-utils=y
#CONFIG_WPA_MSG_MIN_PRIORITY=2
CONFIG_WPA_MSG_MIN_PRIORITY=4
CONFIG_PACKAGE_wpad-openssl=y
# CONFIG_PACKAGE_wpad-basic is not set

# SSL certificates
CONFIG_PACKAGE_ca-certificates=y

# Luci (SSL from OpenSSL)
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-app-commands=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-app-wol=y

# Luci statistics
CONFIG_PACKAGE_luci-app-statistics=y
CONFIG_PACKAGE_collectd-mod-conntrack=y
CONFIG_PACKAGE_collectd-mod-cpufreq=y
CONFIG_PACKAGE_collectd-mod-entropy=y
CONFIG_PACKAGE_collectd-mod-ping=y
CONFIG_PACKAGE_collectd-mod-thermal=y
CONFIG_PACKAGE_collectd-mod-uptime=y

# QoS selection - currently SQM
CONFIG_PACKAGE_luci-app-sqm=y

# Build material and openwrt-2020 themes, default is still bootstrap
CONFIG_PACKAGE_luci-theme-material=y
CONFIG_PACKAGE_luci-theme-openwrt-2020=y

# kernel support for tunnels, VPNs
CONFIG_PACKAGE_kmod-tun=y

# wireguard
CONFIG_PACKAGE_luci-app-wireguard=y

# PPTP support
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_ppp-mod-pptp=y

# iptables add-on ipsec
CONFIG_PACKAGE_iptables-mod-ipsec=y

# Support for IETF BCP38
CONFIG_PACKAGE_luci-app-bcp38=y

# Adblock package with Luci support, initially disabled
CONFIG_PACKAGE_luci-app-adblock=y

# BanIP package with Luci support, initially disabled
CONFIG_PACKAGE_luci-app-banip=y

# nlbwmon app
CONFIG_PACKAGE_luci-app-nlbwmon=y

# chaoskey TRNG USB dongle
CONFIG_PACKAGE_kmod-chaoskey=y
1 Like

Note that you can use "/" in menuconfig to search for packages, and the package help will show you dependencies.

Typically you only need the "top-level" LuCI app for a feature, and it pulls in the actual package.