Skip to content

/proc/kcore 文件 ​

/proc/kcore 文件的组件名称为 proc_kcore, 相关内核选项为

ini
# File systems
# -> Pseudo filesystems
# -> /proc file system support
CONFIG_PROC_FS=y

# System Type
# -> MMU-based Paged Memory Management Support
CONFIG_MMU=y

# File systems
# -> Pseudo filesystems
# -> /proc file system support
# -> /proc/kcore support
CONFIG_PROC_KCORE=y

检查工具为

bash
#!/bin/bash

source ./kernel_config_utils.sh

proc_kcore_check() {
    is_error=false
    if ! kernel_config_check CONFIG_PROC_FS; then
        is_error=true
    fi
    if ! kernel_config_check CONFIG_MMU; then
        is_error=true
    fi
    if ! kernel_config_check CONFIG_PROC_KCORE; then
        is_error=true
    fi
    if [ "$is_error" == "true" ]; then
        return 1
    fi

    if ! [ -d /proc ]; then
        echo "missing dir /proc"
        return 1
    fi
    if ! [ -e /proc/kcore ]; then
        echo "missing file /proc/kcore"
        return 1
    fi

    return 0
}