openwrt编译配置教程以及CPU降频设置

config文件位置:

openwrt config文件:.config
kernel config:build_dir/target-xxxxxxx/linux-x86_generic/linux-x.xx.xx/.config

内核版本更改:

支持内核版本列表: include/kernel-version.mk
更改内核版本位置: target/linux/XXX/Makefile.

3.你要编译的内容 命令 make menuconfig

这里给出一个基本配置,不过其中Busybox配置,正常使用默认配置即可,不需要Customize busybox options,我为了在日后的initramfs中加入一些overlayfs的功能自己加进去了配置,另外的配置基本是x86必须的。

Target System (x86) #目标平台选择
Target Images —>
ext4 #生成.EXT4.IMG文件
Base system —>
<*> block-mount
<*> busybox —> #用于今后`initramfs`支持,可以将所有lib编译到busybox
Customize busybox options
Busybox Settings —>
General Configuration —>
Support –install [-s] to install applet links at runtime
[ ] Don’t use /usr ( [ ] Don’t use /usr 该项不选!,否则无法生成 /usr/sbin/ntpd-hotplug及其他文件,导致busybox-*.ipk生成失败!)
Linux Module Utilities —>
modinfo
Simplified modutils
Accept module options on modprobe command line
Skip loading of already loaded modules
(/lib/modules) Default directory containing modules
Linux System Utilities —>
mdev
Support /etc/mdev.conf
Support subdirs/symlinks
Support regular expressions substitutions when renaming
Support command execution at device addition/removal
Support loading of firmwares
findfs
blkid
Print filesystem type
losetup
lspci
lsusb
mount
Support specifying devices by label or UUID
Filesystem/Volume identification —>
Ext filesystem
fat filesystem
Networking Utilities —>
ftpd
Enable upload commands
Enable workaround for RFC-violating clients
inetd
telnetd
Support standalone telnetd (not inetd only)
tcpsvd
udpsvd
`kernel` modules —>
Block Devices —>
<*> kmod-ata-core
<*> kmod-ata-ahci
<*> kmod-loop
-*- kmod-scsi-core
<*> kmod-scsi-generic
Filesystems —>
<*> kmod-fs-ext4
<*> kmod-fs-ntfs
<*> kmod-fs-vfat
Input modules —>#键盘
-*- kmod-hid
<*> kmod-hid-generic
-*- kmod-input-core
-*- kmod-input-evdev
Native Language Support —>
<*> kmod-nls-cp437 #vfat需要这个
<*> kmod-nls-iso8859-1
<*> kmod-nls-utf8
Network Devices —> #网卡驱动
<*> kmod-macvlan
USB Support —>
-*- kmod-usb-core
<*> kmod-usb-hid #usb键盘
<*> kmod-usb-ohci
<*> kmod-usb-storage
<*> kmod-usb2
<*> kmod-usb3
Wireless Drivers —>#wifi卡驱动
Network —>
<*> hostapd #wifi ap模式
<*> hostapd-common
<*> hostapd-utils
<*> wpa-supplicant
Utilities —>#自选 fdisk等

4.x64固件内核支持等各种特性,命令 make kernel_menuconfig
目的是为了加入x86的多核心以及大内存支持

Processor type and features —>
Symmetric multi-processing support
Processor family (Core 2/newer Xeon) —>#自行选择处理器平台
Supported processor vendors —>#自行选择处理器平台
(2) Maximum number of CPUs #自行编辑
SMT (Hyperthreading) scheduler support#超线程支持
Multi-core scheduler support
High Memory Support (4GB) —>

Device Drivers
< >ATA/ATAPI/MFM/RLL support(DEPRECATED)—>
SCSI device support—>
<*>SCSI generic support (kernel module –> Block Devices –> <*> kmod-scsi-core)
<*>Serial ATA and Parallel ATA drivers—>
<*>AHCI SATA support (kernel module –> Block Devices –> <*> kmod-ata-ahci)
<*>Intel ESB,ICH,PIIX3,PIIX4 PATA/SATA support(默认选中)
<*>VIA SATA support
<*>VIA PATA support
„„(根据你的硬件情况选择)
Multiple devices driver support (RAID and LVM) —>
Network device support —> (网卡驱动支持,根据你的硬件情况选择)
Ethernet driver support —>
Marvell devices
<*> Marvell MDIO interface support
<*> Marvell Yukon Gigabit Ethernet support
<*> Marvell Yukon 2 support
Realtek devices
<*> Realtek RTL-8139 C+ PCI Fast Ethernet Adapter support()
<*> Realtek RTL-8129/8130/8139 PCI Fast Ethernet Adapter support()
<*> Realtek 8169 gigabit ethernet support

设置了Powermanagement and ACPI options->
ACPI(Advanced Configuration and Power Interface)Support后,需要在CPU Frequency scaling –>x86 CPU frequency scaling drivers—> 中选择一个驱动,否则会全速运行!

如果没有设置,在编译时Inter Enhanced SpeedStep (deprecated)一项需要手动确认,其他都默认为“n”。

发表评论

邮箱地址不会被公开。 必填项已用*标注