ponyatov
Posts: 9
Joined: Fri Jun 17, 2016 6:00 am
Location: Samara, Russia
Contact: Website

config file management for custom embedded Linux builds

Fri Jun 17, 2016 6:19 am

I'm working on some build system for emLinux (for [em]bedded systems): https://github.com/ponyatov/L

Porting this to RPi in goal of make home Linux-powered dumb wallclock with weather banner (https://github.com/ponyatov/L/tree/clock branch) I found that default kernel .config shipped off-the-shelf from master github branch have huge amount of unneeded modules.

I'm feeling sick disabling all this pile of modules for all occasions
and can't make kernel boot with some of them suddenly disabled :shock:

Does anybody works on some tools or hint to make .config building modular ?

I use some approach in my mk/kernel.mk (for building vanilla kernel) :

Code: Select all

.PHONY: kernel-generic
kernel-generic: $(PACK)/kernel-generic
$(PACK)/kernel-generic: $(SRC)/$(KERNEL)/README
	# 1
	cd $(SRC)/$(KERNEL) && make $(CFG_KERNEL) distclean
	cd $(SRC)/$(KERNEL) && make $(CFG_KERNEL) allnoconfig
	# 2
	cat kernel/all >> $(SRC)/$(KERNEL)/.config
	cat arch/$(ARCH).kcfg >> $(SRC)/$(KERNEL)/.config
	cat cpu/$(CPU).kcfg >> $(SRC)/$(KERNEL)/.config
	cat hw/$(HW).kcfg >> $(SRC)/$(KERNEL)/.config
	cat app/$(APP).kcfg >> $(SRC)/$(KERNEL)/.config
	# 3
	make kernel-all
	touch $@
  • kernel/all consist all options I always use for any kernel -- some widely used modules like FTDI USB and CP21xx i/o modules, some embedded console fonts for FB console and so on
  • kernel/armhf.kcfg options for all bunch of ARMhf boards
  • kernel/rpiB.kcfg options required only to run kernel on specific board
  • kernel/clock.kcfg options carefully selected for for a specific application -- in wall clock I don't need v4l, huge IP/WiFi stack, and all types for filesystems (ramdisk only)

ponyatov
Posts: 9
Joined: Fri Jun 17, 2016 6:00 am
Location: Samara, Russia
Contact: Website

Re: config file management for custom embedded Linux builds

Fri Jun 17, 2016 7:43 am

Is it possible to find some minimal .config garantees bootable kernel build ?

Return to “Linux Kernel”