El regalo de navidad de los chicos de kernel.org: un nuevo target para make

Aquellos que por gusto o necesidad aún compilan el núcleo a mano, se darán cuenta de que cada vez es más tedioso y longevo el proceso de configuración y posterior compilación. Son demasiados módulos y opciones sobre las que decidir, y hoy día el tiempo es algo que se paga a precio de oro.

Para todos ellos, los desarrolladores del núcleo linux han preparado una nueva «herramienta» que les facilitará esta ardua tarea y les permitirá optimizar al máximo el rendimiento de sus equipos. Se trata de localmodconfig, un target para make que se encarga de ver los módulos cargados en tu sistema y lee los makefile para ver que CONFIG activa cada módulo. Además examina los archivos Kconfig para determinar las dependencias que pudiera requerir cada CONFIG y por último lee el .config, eliminando cualquier módulo que no es necesario para cargar los módulos actualmente cargados en el sistema referencia. De esta forma, puedes eliminar todos aquellos módulos y drivers que tu máquina no requiera, adelgazando el núcleo considerablemente y consiguiendo unos tiempos de compilación menores.

Esta opción está disponible a partir del kernel 2.6.32 y se utiliza llamando a make de la siguiente manera:

make localmodconfig

Podéis encontrar más información en las notas de lanzamiento del kernel 2.6.32, más específicamente en el punto 1.8:

1.8. Easy local kernel configuration

Most people uses the kernel shipped by distros – and that’s good. But some people like to compile their own kernels from kernel.org, or maybe they like following the Linux development and want to try it. Configuring your own kernel, however, has become a very difficult and tedious task – there’re too many options, and some times userspace software will stop working if you don’t enable some key option. You can use a standard distro .config file, but it takes too much time to compile all the options it enables. To make the process of configuration easier, a new build target has been added: make localmodconfig. It runs «lsmod» to find all the modules loaded on the current running system. It will read all the Makefiles to map which CONFIG enables a module. It will read the Kconfig files to find the dependencies and selects that may be needed to support a CONFIG. Finally, it reads the .config file and removes any module «=m» that is not needed to enable the currently loaded modules. With this tool, you can strip a distro .config of all the unuseful drivers that are not needed in our machine, and it will take much less time to build the kernel. There’s an additional «make localyesconfig» target, in case you don’t want to use modules and/or initrds.

Ya me contaréis qué tal funciona la cosa.

¡Un saludo!

Sentimos molestarte con lo de las Cookies, pero es por imperativo legal. Puedes ver aquí la Política de Cookies, si continúas navegando te informo que la estás aceptando ;)    Ver
Privacidad