Securing and Optimizing Linux:RedHat Edition | All about OS

Configuring and Building a secure, optimized Kernels

Категория: Securing and Optimizing

Optimize the kernel
To optimize the Linux kernel to fit your specific CPU architecture and optimization flags you may need to edit the “/usr/src/linux/Makefile” file and change the following parameters.
• Edit the Makefile file (vi +18 /usr/src/linux/Makefile) and change the line:
HOSTCC =gcc
To read: HOSTCC =egcs
• Edit the Makefile file (vi +25 /usr/src/linux/Makefile) and change the line:
CC =$(CROSS_COMPILE)gcc -D_KERNEL_ -I$(HPATH)
To read:
CC =$(CROSS_COMPILE)egcs -D_KERNEL_ -I$(HPATH)
• Edit the Makefile file (vi +90 /usr/src/linux/Makefile) and change the line:
CFLAGS = -Wall -Wstrict-prototypes -02 -fomit-frame-pointer
To read:
CFLAGS = -Wall -Wstrict-prototypes -09 -funroll-loops -ffast-math -malign-double -
mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions
• Edit the Makefile file (vi +19 /usr/src/linux/Makefile) and change the line:
HOSTCFLAGS —Wall -Wstrict-prototypes -02 -fomit-frame-pointer
To read:
HOSTCFLAGS —Wall -Wstrict-prototypes -09 -funroll-loops -ffast-math -malign-double -
mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions
These changes turn on aggressive optimization tricks that may or may not work with all kernels. Please, if the optimization flags above, or the ones you have chosen for your CPU architecture do not work for you, don’t try to absolutely force it to work. I wouldn’t want to make your system unstable like Microsoft Windows.

Страниц: 1 2 3 4 5

« Tuning IDE Hard Disk Performance
Securing the kernel »