Diferencias entre las revisiones 2 y 29 (abarca 27 versiones)
Versión 2 con fecha 2019-09-03 15:14:43
Tamaño: 719
Comentario:
Versión 29 con fecha 2020-10-08 12:51:51
Tamaño: 3631
Comentario:
Los textos eliminados se marcan así. Los textos añadidos se marcan así.
Línea 1: Línea 1:
 1. Descargar kernel (https://www.kernel.org/).
 1. descomprimir en /usr/src/ * ingresar al directorio * limpiar directorio:
= Generando un nuevo kernel en Debian. =
 * Instalar alguna herramientas.
Línea 4: Línea 4:
 . make distclean make clean {{{
apt install build-essential
}}}
 * Descargar kernel (https://www.kernel.org/).
Línea 6: Línea 9:
* copiar configuación vieja: cp /boot/config-xxx /usr/src/linux-yyy/.config * configurar opciones (mostrando las nuevas): make oldconfig * deshabilitar debug kernel info en .config (evitará generar una imagen linux-dbg): CONFIG_DEBUG_INFO=n * borrar referencia a keys: CONFIG_SYSTEM_TRUSTED_KEYS="" * compilar y generar paquete .deb: make deb-pkg * instalar nuevo kernel (actualiza el grub): dpkg -i linux-yyy.deb * reinicier con el nuevo kernel {{{
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.2.11.tar.xz
}}}
 * Descomprimir en /usr/src/
Línea 8: Línea 14:
* referencia: https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-building {{{
tar axvf linux-5.2.11.tar.xz
}}}
 * '''Ingresar al directorio'''.

{{{
cd /usr/src/linux-5.2.11
}}}
 * Limpiar el directorio de configuraciones anteriores.

{{{
make distclean
make clean
}}}
 * Copiar configuracion de kernel activo anterior.

{{{
cp /boot/config-4.19.0-5-amd64 .config
}}}
 * Configurar opciones del kernel (consultará por la terminal sobre las nuevas características del nuevo kernel).

{{{
make oldconfig
}}}
 * También se puede configurar manualmente, activando/desactivando '''módulos''' e indicando características '''built-in'''. (ver https://wiki.gentoo.org/wiki/Kernel/Configuration). Podemos utilizar una de las siguientes opciones:

{{{
# por la terminal.
make config

# por la terminal mediante ventanas ncurses.
make menuconfig

# mediante interfaz gráfica.
make xconfig
}}}
{{attachment:opciones_kernel.png|attachment:opciones_kernel.png}}

 * Deshabilitar debug kernel info en .config (evitará generar una imagen linux-dbg, probablemente mucho mas grande)

{{{
vim .config
CONFIG_DEBUG_INFO=n
}}}
 * Borrar referencia a certificado antiguo ([[https://www.kernel.org/doc/html/v4.14/admin-guide/module-signing.html|https://www.kernel.org/doc/html/v5.2/admin-guide/module-signing.html?highlight=config_system_trusted_keys]]).

{{{
vim .config
CONFIG_SYSTEM_TRUSTED_KEYS=""
}}}
 * Compilar y generar paquete .deb

{{{
make deb-pkg
}}}
 * Se generarán los siguientes archivos:

{{{
root@avaldes:/usr/src# ll
total 225792
drwxrwxr-x 26 root root 4096 Sep 3 14:12 linux-5.2.11
-rw-r--r-- 1 root root 4708 Sep 3 14:14 linux-5.2.11_5.2.11-1_amd64.buildinfo
-rw-r--r-- 1 root root 2580 Sep 3 14:14 linux-5.2.11_5.2.11-1_amd64.changes
-rw-r--r-- 1 root root 232631 Sep 3 11:13 linux-5.2.11_5.2.11-1.diff.gz
-rw-r--r-- 1 root root 1093 Sep 3 11:13 linux-5.2.11_5.2.11-1.dsc
-rw-r--r-- 1 root root 170851763 Sep 3 11:12 linux-5.2.11_5.2.11.orig.tar.gz
drwxr-xr-x 2 root root 4096 Sep 2 12:43 linux-config-4.19
-rw-r--r-- 1 root root 11353104 Sep 3 14:13 linux-headers-5.2.11_5.2.11-1_amd64.deb
-rw-r--r-- 1 root root 47533392 Sep 3 14:14 linux-image-5.2.11_5.2.11-1_amd64.deb
-rw-r--r-- 1 root root 1059764 Sep 3 14:13 linux-libc-dev_5.2.11-1_amd64.deb
-rw-r--r-- 1 root root 148764 Aug 7 22:02 linux-patch-4.19-rt.patch.xz
}}}
 * Instalar nuevo kernel (actualiza grub)

{{{
dpkg -i linux-image-5.2.11_5.2.11-1_amd64.deb

Selecting previously unselected package linux-image-5.2.11.
(Reading database ... 60694 files and directories currently installed.)
Preparing to unpack linux-image-5.2.11_5.2.11-1_amd64.deb ...
Unpacking linux-image-5.2.11 (5.2.11-1) ...
Setting up linux-image-5.2.11 (5.2.11-1) ...
update-initramfs: Generating /boot/initrd.img-5.2.11
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.2.11
Found initrd image: /boot/initrd.img-5.2.11
Found linux image: /boot/vmlinuz-4.19.0-5-amd64
Found initrd image: /boot/initrd.img-4.19.0-5-amd64
done
}}}
 * Reiniciar.

{{{
shutdown -r now
}}}
 * Verificamos la versión del kernel.

{{{
uname -a
Linux avaldes 5.2.11 #1 SMP Tue Sep 3 10:54:40 -04 2019 x86_64 GNU/Linux
}}}
Referencia: https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-building

Generando un nuevo kernel en Debian.

  • Instalar alguna herramientas.

apt install build-essential

wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.2.11.tar.xz
  • Descomprimir en /usr/src/

tar axvf linux-5.2.11.tar.xz
  • Ingresar al directorio.

cd /usr/src/linux-5.2.11
  • Limpiar el directorio de configuraciones anteriores.

make distclean
make clean
  • Copiar configuracion de kernel activo anterior.

cp /boot/config-4.19.0-5-amd64 .config
  • Configurar opciones del kernel (consultará por la terminal sobre las nuevas características del nuevo kernel).

make oldconfig

# por la terminal.
make config

# por la terminal mediante ventanas ncurses.
make menuconfig

# mediante interfaz gráfica.
make xconfig

attachment:opciones_kernel.png

  • Deshabilitar debug kernel info en .config (evitará generar una imagen linux-dbg, probablemente mucho mas grande)

vim .config
CONFIG_DEBUG_INFO=n

vim .config
CONFIG_SYSTEM_TRUSTED_KEYS=""
  • Compilar y generar paquete .deb

make deb-pkg
  • Se generarán los siguientes archivos:

root@avaldes:/usr/src# ll
total 225792
drwxrwxr-x 26 root root      4096 Sep  3 14:12 linux-5.2.11
-rw-r--r--  1 root root      4708 Sep  3 14:14 linux-5.2.11_5.2.11-1_amd64.buildinfo
-rw-r--r--  1 root root      2580 Sep  3 14:14 linux-5.2.11_5.2.11-1_amd64.changes
-rw-r--r--  1 root root    232631 Sep  3 11:13 linux-5.2.11_5.2.11-1.diff.gz
-rw-r--r--  1 root root      1093 Sep  3 11:13 linux-5.2.11_5.2.11-1.dsc
-rw-r--r--  1 root root 170851763 Sep  3 11:12 linux-5.2.11_5.2.11.orig.tar.gz
drwxr-xr-x  2 root root      4096 Sep  2 12:43 linux-config-4.19
-rw-r--r--  1 root root  11353104 Sep  3 14:13 linux-headers-5.2.11_5.2.11-1_amd64.deb
-rw-r--r--  1 root root  47533392 Sep  3 14:14 linux-image-5.2.11_5.2.11-1_amd64.deb
-rw-r--r--  1 root root   1059764 Sep  3 14:13 linux-libc-dev_5.2.11-1_amd64.deb
-rw-r--r--  1 root root    148764 Aug  7 22:02 linux-patch-4.19-rt.patch.xz
  • Instalar nuevo kernel (actualiza grub)

dpkg -i linux-image-5.2.11_5.2.11-1_amd64.deb

Selecting previously unselected package linux-image-5.2.11.
(Reading database ... 60694 files and directories currently installed.)
Preparing to unpack linux-image-5.2.11_5.2.11-1_amd64.deb ...
Unpacking linux-image-5.2.11 (5.2.11-1) ...
Setting up linux-image-5.2.11 (5.2.11-1) ...
update-initramfs: Generating /boot/initrd.img-5.2.11
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.2.11
Found initrd image: /boot/initrd.img-5.2.11
Found linux image: /boot/vmlinuz-4.19.0-5-amd64
Found initrd image: /boot/initrd.img-4.19.0-5-amd64
done
  • Reiniciar.

shutdown -r now
  • Verificamos la versión del kernel.

uname -a
Linux avaldes 5.2.11 #1 SMP Tue Sep 3 10:54:40 -04 2019 x86_64 GNU/Linux

Referencia: https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-building

kernel (última edición 2020-10-08 12:51:51 efectuada por AlejandroValdes)