Giter VIP home page Giter VIP logo

kernel-config-diff's Introduction

kernel-config-diff

Diff kernel configs, but keep the config tree structure for easier comparison

When kernel configs are diffed it's hard to view the tree structure of kenrel config. /scripts/diffconfig from kernel does not preserve tree structure as well.

This tool aims to alleviate that: 2 kernels configs are parsed and CONFIG_ vairables are stored in a tree (https://anytree.readthedocs.io/en/latest/) structure based on # comments that do not have CONFIG_.

Then CONFIG_ that have the same common value are removed from both trees.

Finally, pruned trees are saved in txt files for easier diff-ing with GUI tools like meld.

This will help you spot the differences and the position of CONFIG_ attribute within xconfig or menuconfig so that you can change them easily.

Screenshot

Usage: kernel-config-diff.py oldconfig newconfig oldtree.txt newtree.txt

Meld text filter to ingore leading spaces/tree characters: ^[ \t\r\f\v\|\-\+]*

Sample output of a txt tree:

./current_config
+- Automatically generated file; DO NOT EDIT.
  +- Linux/x86 6.1.27 Kernel Configuration
     |- CONFIG_CC_VERSION_TEXT:"gcc"
     |- CONFIG_GCC_VERSION:120201
     |- CONFIG_PAHOLE_VERSION:0
     |- General setup
     |  |- CONFIG_LOCALVERSION:"-x86_64"
     |  |- CONFIG_LOCALVERSION_AUTO:is not set
     |  |- CONFIG_KERNEL_LZ4:y
     |  |- CONFIG_KERNEL_ZSTD:is not set
     |  |- CONFIG_DEFAULT_HOSTNAME:"(none)"
     |  |- CONFIG_USELIB:y
     |  |- IRQ subsystem
     |  |- Timers subsystem
     |  |- BPF subsystem
     |  |- CPU/Task time and stats accounting
     |  |- RCU Subsystem
     |  |  +- CONFIG_FORCE_TASKS_TRACE_RCU:is not set
     |  |- CONFIG_PRINTK_INDEX:is not set
     |  |- Scheduler features
     |  |- CONFIG_GCC11_NO_ARRAY_BOUNDS:y
     |  |- CONFIG_SCHED_BORE:y
     |  |- CONFIG_SCHED_AUTOGROUP:is not set
     |  |- CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE:y
     |  |- CONFIG_EXPERT:y
     |  |- CONFIG_DEBUG_RSEQ:is not set
     |  |- CONFIG_PC104:y
     |  +- Kernel Performance Events And Counters
     |- Processor type and features
     |  |- CONFIG_X86_EXTENDED_PLATFORM:y
     |  |- CONFIG_X86_NUMACHIP:y
     |  |- CONFIG_X86_VSMP:is not set
     |  |- CONFIG_X86_UV:is not set
     |  |- CONFIG_X86_GOLDFISH:is not set
     |  |- CONFIG_X86_INTEL_MID:is not set
     |  |- CONFIG_IOSF_MBI_DEBUG:y
     |  |- CONFIG_PARAVIRT_TIME_ACCOUNTING:is not set
     |  |- CONFIG_GENERIC_CPU:is not set
     |  |- CONFIG_MNATIVE_INTEL:y
     |  |- CONFIG_X86_INTEL_USERCOPY:y
     |  |- CONFIG_X86_USE_PPRO_CHECKSUM:y
     |  |- CONFIG_X86_P6_NOP:y
     |  |- CONFIG_PROCESSOR_SELECT:y
     |  |- CONFIG_GART_IOMMU:y
     |  |- CONFIG_NR_CPUS:64
     |  |- CONFIG_X86_MCELOG_LEGACY:y
     |  |- Performance monitoring
     |  |  |- CONFIG_PERF_EVENTS_INTEL_UNCORE:y
     |  |  |- CONFIG_PERF_EVENTS_AMD_POWER:is not set
     |  |  +- CONFIG_PERF_EVENTS_AMD_BRS:is not set
     |  |- CONFIG_X86_PMEM_LEGACY:y
     |  |- CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT:1
     |  |- CONFIG_X86_INTEL_TSX_MODE_ON:y
     |  |- CONFIG_X86_INTEL_TSX_MODE_AUTO:is not set
     |  |- CONFIG_HZ_300:is not set
     |  |- CONFIG_HZ_500:y
     |  +- CONFIG_HZ:500
     |- Power management and ACPI options
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.