NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Printing conf tree for kernel confs



Is there any way to see the inclusion tree of a kernel configuration?

I wrote something quick, but may be some way exists already.

Anyway sharing what I wrote below:

Sample usage:

    conftree.sh evbarm RPI2


conftree.sh
===========
#!/usr/bin/env bash

indent() {
    LEVEL=$1
    for((i=0;i<$LEVEL;i++))
    do
        printf "\t"
    done
    }

incltree() {
    CONF=$1
    LEVEL=$2
    grep -w include $CONF |
    while read IGN CONFPATH
    do
        INCLCONF=`eval basename $CONFPATH`
        indent $LEVEL
        echo $INCLCONF
        NEXTLEVEL=`expr $LEVEL + 1`
        incltree $INCLCONF $NEXTLEVEL
    done
    }

ARCH=$1
ROOTCONF=$2

cd /usr/src/sys/arch/$ARCH/conf
incltree $ROOTCONF 0

Mayuresh


Home | Main Index | Thread Index | Old Index