• scripts/kconfig/merge_config.sh


    在scripts/kconfig路径下有一个merge_config.sh,可以用于将将两个defconfig merge成一个.
    使用用法如下:
    ./scripts/kconfig/merge_config.sh -m arch/arm64/configs/defconfig arch/arm64/configs/usb-config
    mv -f .config .merged.config
    make KCONFIG_ALLCONFIG=.merged.config alldefconfig
    其中merge_config.sh 可以带一个option,这里主要用-m。
    usage() {
        echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
        echo "  -h    display this help text"
        echo "  -m    only merge the fragments, do not execute the make command"
        echo "  -n    use allnoconfig instead of alldefconfig"
        echo "  -r    list redundant entries when merging fragments"
        echo "  -O    dir to put generated output files.  Consider setting $KCONFIG_CONFIG instead."
    }

    这里一定要用KCONFIG_ALLCONFIG 来制定用的是.merged.config alldefconfig,负责默认用的defconfig

    /scripts/kconfig/merge_config.sh -m 1.txt 
    Using 1.txt as base
    #
    # merged configuration written to .config (needs make)
    linux-5.4.60-89# cat 1.txt 
    CONFIG_SYNC=y
    CONFIG_SW_SYNC=y
    CONFIG_SYNC_FILE=y
    linux-5.4.60-89# 
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# ./scripts/kconfig/merge_config.sh -m 1.txt 
    Using 1.txt as base
    #
    # merged configuration written to .config (needs make)
    #
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# cat  .config
    CONFIG_SYNC=y
    CONFIG_SW_SYNC=y
    CONFIG_SYNC_FILE=y
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# 
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# ./scripts/kconfig/merge_config.sh -m 1.txt  .config
    Using 1.txt as base
    Merging .config
    Value of CONFIG_SYNC_FILE is redefined by fragment .config:
    Previous value: CONFIG_SYNC_FILE=y
    New value: # CONFIG_SYNC_FILE is not set
    
    #
    # merged configuration written to .config (needs make)
    #
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89#
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# cat 1.txt 
    CONFIG_SYNC=y
    CONFIG_SW_SYNC=y
    CONFIG_SYNC_FILE=y
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# 

    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# ./scripts/kconfig/merge_config.sh kernel/configs/android-base.config
    Using kernel/configs/android-base.config as base
    scripts/kconfig/conf --alldefconfig Kconfig
    #
    # configuration written to .config
    #
    Value requested for CONFIG_DEVKMEM not in final .config
    Requested value: # CONFIG_DEVKMEM is not set
    Actual value:

    Value requested for CONFIG_INET_LRO not in final .config
    Requested value: # CONFIG_INET_LRO is not set
    Actual value:

    Value requested for CONFIG_OABI_COMPAT not in final .config
    Requested value: # CONFIG_OABI_COMPAT is not set
    Actual value:

    Value requested for CONFIG_ANDROID_BINDER_DEVICES not in final .config
    Requested value: CONFIG_ANDROID_BINDER_DEVICES=binder,hwbinder,vndbinder
    Actual value: CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

    Value requested for CONFIG_ANDROID_LOW_MEMORY_KILLER not in final .config
    Requested value: CONFIG_ANDROID_LOW_MEMORY_KILLER=y
    Actual value:

    Value requested for CONFIG_ARMV8_DEPRECATED not in final .config
    Requested value: CONFIG_ARMV8_DEPRECATED=y
    Actual value:

    Value requested for CONFIG_CGROUP_BPF not in final .config
    Requested value: CONFIG_CGROUP_BPF=y
    Actual value:

    Value requested for CONFIG_CP15_BARRIER_EMULATION not in final .config
    Requested value: CONFIG_CP15_BARRIER_EMULATION=y
    Actual value:

    Value requested for CONFIG_INET_XFRM_MODE_TUNNEL not in final .config
    Requested value: CONFIG_INET_XFRM_MODE_TUNNEL=y
    Actual value:

    Value requested for CONFIG_NETFILTER_TPROXY not in final .config
    Requested value: CONFIG_NETFILTER_TPROXY=y
    Actual value:

    Value requested for CONFIG_NF_CONNTRACK_IPV4 not in final .config
    Requested value: CONFIG_NF_CONNTRACK_IPV4=y
    Actual value:

    Value requested for CONFIG_NF_CONNTRACK_IPV6 not in final .config
    Requested value: CONFIG_NF_CONNTRACK_IPV6=y
    Actual value:

    Value requested for CONFIG_SETEND_EMULATION not in final .config
    Requested value: CONFIG_SETEND_EMULATION=y
    Actual value:

    Value requested for CONFIG_SWP_EMULATION not in final .config
    Requested value: CONFIG_SWP_EMULATION=y
    Actual value:

    Value requested for CONFIG_SYNC not in final .config
    Requested value: CONFIG_SYNC=y
    Actual value:

    Value requested for CONFIG_USB_CONFIGFS_F_MIDI not in final .config
    Requested value: CONFIG_USB_CONFIGFS_F_MIDI=y
    Actual value:

    Value requested for CONFIG_USB_OTG_WAKELOCK not in final .config
    Requested value: CONFIG_USB_OTG_WAKELOCK=y
    Actual value:

    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# grep CONFIG_SYNC .config
    # CONFIG_SYNC_FILE is not set
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89#  ./scripts/kconfig/merge_config.sh  kernel/configs/android-base.config  -m
    Using kernel/configs/android-base.config as base
    Merging -m
    The merge file '-m' does not exist.  Exit.
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# ./scripts/kconfig/merge_config.sh -m  kernel/configs/android-base.config  
    Using kernel/configs/android-base.config as base
    #
    # merged configuration written to .config (needs make)
    #
     
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# grep CONFIG_SYNC .config
    CONFIG_SYNC=y
    root@ubuntu:/home/ubuntu/kata-linux-5.4.60-89# 
  • 相关阅读:
    linux cfs调度器
    运算符重载
    linux cfs调度器_模型实现
    linux cfs调度器_理论模型
    jiffies存放
    在C++中实现不可继承的类
    装饰模式(Decorator Pattern)--------结构型模式
    How to use base class's assignment operator in C++
    组合模式(Composite Pattern) ------------结构型模式
    what's the help of "unnecessary" pointer comparison
  • 原文地址:https://www.cnblogs.com/dream397/p/13962712.html
Copyright © 2020-2023  润新知