4

I'm exploring methods of tracking the changes that happen to the kernel defconfig for a particular board. The changes I'm referring to are either selecting a new option through the menuconfig and persisting that, or moving to a new kernel that introduces new options.

My idea is to remove comments and sort the defconfig before committing the changes:

make ARCH=arm board_defconfig
make ARCH=arm menuconfig       # Changes introduced here and saved to .config
make ARCH=arm savedefconfig    # This creates the defconfig file
grep -v '^#' defconfig > tmp
sort tmp > tmp_sorted
uniq tmp_sorted > defconfig
cp savedefconfig arch/arm/configs/board_defconfig

menuconfig however has a very consistent habit of adding comment line. For example:

# CONFIG_IOMMU_SUPPORT is not set
# CONFIG_RTC_INTF_PROC is not set
# CONFIG_IOMMU_SUPPORT is not set

which makes me have second thoughts if I'm actually allowed to remove them.

Is there a purpose to these comment lines making them unsafe to remove?

9
+50

The objective answer is:

The comment lines can safely be removed. Here is a reference for that claim.

You can double check the configuration using menuconfig (or nconfig in more recent kernels) to validate whether the commented sections in fact hold the default values as per your preference.

0

A workaround for the core issue would be to sort the files at compare time:

diff <(sort old-file) <(sort new-file)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.