在linux系統運行後,如何查看內核的配置情況

剛開始的時候也不知道怎麼查看,後來聽說查看/proc/config.gz文件即可。然後查看資料,果然如此,這麼好用的東西,我竟然不知道,孤陋寡聞了,呵呵!!

/proc/config.gz

This file shows you the compile-time configuration settings for the kernel (gzip compressed, use zcat or zless to see its contents). It is available only if you enable it using CONFIG_IKCONFIG_PROC when you compile.

Say you want to upgrade to the next available kernel. Your current kernel works fine, so you'd like to use the same parameters, but you accidentally lost your original .config configuration file. Simplyzcat /proc/config.gz > /usr/src/linux/.config and you're ready to go.

Example output:

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17
# Sat Jul 15 17:01:24 2006
#
CONFIG_X86_32=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_X86=y
CONFIG_MMU=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_DMI=y


發佈了17 篇原創文章 · 獲贊 8 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章