linux内核现在是越来越大,以前kernel+rootfs一张软盘都能放下,现在光放内核都不行了,

要减小linux内核的大小,可以通过Linux-tiny patches 补丁来实现,当然还有一些其他的配置选项,

 

CONFIG option Description Default Small
CONFIG_CORE_SMALL tune some kernel data sizes N Y
CONFIG_NET_SMALL tune some net-related data sizes N Y
CONFIG_KMALLOC_ACCOUNTINGturn on kmalloc accounting N Y *
CONFIG_AUDIT_BOOTMEM print out all bootmem allocations N Y *
CONFIG_DEPRECATE_INLINEScause compiler to emit info about inlines N Y *
CONFIG_PRINTK allow disable of printk code and message data Y N
CONFIG_BUG allow elimination of BUG (and BUG_ON??) code Y N
CONFIG_ELF_CORE allow disabling of ELF core dumps Y N
CONFIG_PROC_KCORE allow disabling of /proc/kcore Y N
CONFIG_AIO allow disabling of async IO syscalls Y N
CONFIG_XATTR allow disabling of xattr syscalls Y N
CONFIG_FILE_LOCKING allow disabling of file locking syscalls Y N
CONFIG_DIRECTIO allow disabling of direct IO support Y N
CONFIG_MAX_SWAPFILES_SHIFTnumber of swapfiles 5 0
CONFIG_NR_LDISCS number of tty line disciplines 16 2
CONFIG_MAX_USER_RT_PRIOnumber of RT priority levels (schedule slots)100 5
Other config options These are not in Linux-tiny, but help with sizedefaultsmall
CONFIG_KALLSYMS load all symbols for debugging/kksymoops Y N
CONFIG_SHMEM allow disabling of shmem filesystem Y N +
CONFIG_SWAP allow disabling of support for a swap segment (virtual memory)Y N
CONFIG_SYSV_IPC allow disabling of support for System V IPC Y N +
CONFIG_POSIX_MQUEUE allow disabling of POSIX message queue supportY N +
CONFIG_SYSCTL allow disabling of sysctl support Y N +
CONFIG_LOG_BUF_SHIFT control size of kernel printk buffer 14 11
CONFIG_UID16 allow support for 16-bit uids Y ??
CONFIG_CC_OPTIMIZE_FOR_SIZEUse gcc -os to optimize for size Y Y
CONFIG_MODULES allow support for kernel loadable modules Y N +
CONFIG_KMOD allow support for automatic kernel module loadingY N
CONFIG_PCI allow support for PCI bus and devices Y Y -
CONFIG_XIP_KERNEL allow support for kernel Execute-in-Place N N
CONFIG_MAX_RESERVE_AREA?? ?? ??
CONFIG_BLK_DEV_LOOP support for loopback block device Y Y -
CONFIG_BLK_DEV_RAM support for block devices for RAM filesystems Y Y -
CONFIG_BLK_DEV_RAM_COUNTNumber of block devices for RAM filesystems 16 2?
CONFIG_BLK_DEV_RAM_SIZESize of block device struct for RAM filesystems4096??
CONFIG_IOSCHED_AS Include Anticipatory IO scheduler Y Y
CONFIG_IOSCHED_DEADLINEInclude Deadline IO scheduler Y N +
CONFIG_IOSCHED_CFQ Include CFQ IO scheduler Y N +
CONFIG_IP_PNP support for IP autoconfiguration Y N +
CONFIG_IP_PNP_DHCP support for IP autoconfiguration via DHCP Y N +
CONFIG_IDE support for IDE devices Y N +
CONFIG_SCSI support for SCSI devices Y N +


Legend:

  • "Y *" - Set to 'Y' for measurement during development, and set to 'N' for deployment.
  • "N +" - Whether you can set this to 'N' depends on whether this feaure is needed by your applications.
  • "Y -" - You probably need this, but it might we worth checking to see if you don't.
Logo

更多推荐