Skip to main content

My kernel scripts to compile it in Gentoo systems

Project description

mykernel - Linux Kernel Compilation Tool for Gentoo

Descripción

mykernel is a Python-based tool designed to simplify and automate the Linux kernel compilation process, specifically tailored for Gentoo Linux systems. It handles various compilation aspects, including ccache configuration, CPU frequency scaling, initramfs generation (both custom and with Dracut), kernel compilation, module installation, and GRUB configuration for both EFI and MBR systems.

Usage

To run mykernel, use the following command:

mykernel [OPCIONES]

Opciones

  • --version: Muestra el número de versión del programa y sale.
  • --config: Escribe un archivo de configuración por defecto en /etc/mykernel/mykernel.ini.
    • Nota: Después de ejecutar con --config, debes editar /etc/mykernel/mykernel.ini para establecer tus configuraciones deseadas. Usa man mykernel para obtener ayuda detallada sobre las opciones de configuración.
  • --ccache_stats: Muestra las estadísticas de ccache.

Ayuda de Configuración de mykernel.ini

La herramienta mykernel utiliza un archivo de configuración ubicado en /etc/mykernel/mykernel.ini. A continuación se detallan las secciones y parámetros disponibles:

[cpupower]

  • cpu_hz
    • Descripción: Número de la frecuencia de escalado de la CPU. El valor por defecto es la frecuencia de escalado máxima detectada. Déjalo como está si no sabes lo que estás haciendo, ya que una configuración incorrecta puede afectar el rendimiento.

[mykernel_initramfs]

  • encrypted_root_partition
    • Descripción: El nombre del dispositivo de la partición raíz cifrada (por ejemplo, /dev/sda2). Déjalo vacío si no hay cifrado en tu sistema.
  • generate
    • Descripción: Establece a True para generar un initramfs personalizado utilizando la lógica interna de mykernel. Establece a False para deshabilitar. No puede ser True si dracut_initramfs's generate también es True.

[dracut_initramfs]

  • generate
    • Descripción: Establece a True para generar un initramfs utilizando Dracut. Establece a False para deshabilitar. No puede ser True si mykernel_initramfs's generate también es True.

[grub]

  • efi
    • Descripción: Establece a True si tu sistema utiliza un sistema EFI con una tabla de particiones GPT. Establece a False si tu sistema utiliza una tabla de particiones DOS con un bloque MBR.
  • boot_directory
    • Descripción: La ruta al directorio de arranque. Por defecto, es /boot.
  • efi_target
    • Descripción: Especifica el objetivo de GRUB para sistemas EFI. Ejemplos incluyen x86_64-efi, i386-pc.
  • efi_partition
    • Descripción: El nombre de la partición donde se encuentra el directorio EFI (por ejemplo, /dev/sda1).
  • mbr_device
    • Descripción: El nombre del dispositivo donde se instalará el MBR (por ejemplo, /dev/sda). Este parámetro solo es aplicable para sistemas no EFI.

Gentoo kernel with root luks example

We create luks partition with cryptsetup

With blkid we can see created partitions UUID

/dev/nvme0n1p1: UUID="51F2-B573" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="3bb72034-0028-4b4b-a022-86dcf77991bf"
/dev/nvme0n1p2: UUID="e3905174-0bfc-406c-8958-8004cfec6528" TYPE="crypto_LUKS" PARTUUID="01037e81-d022-c041-a85e-6e872cbcb791"
/dev/mapper/root: UUID="ebc859bc-a777-4953-9c92-178c89b52222" BLOCK_SIZE="4096" TYPE="ext4"

Gentoo package install-kernel must have dracut USE

We edit /etc/dracut.conf

add_dracutmodules+=" crypt dm rootfs-block "
kernel_cmdline+=" root=UUID=ebc859bc-a777-4953-9c92-178c89b52222 rd.luks.uuid=e3905174-0bfc-406c-8958-8004cfec6528 "

We edit /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="crypt_root=nvme0n1p2"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mykernel-1.1.0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mykernel-1.1.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file mykernel-1.1.0.tar.gz.

File metadata

  • Download URL: mykernel-1.1.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.18.8-gentoo

File hashes

Hashes for mykernel-1.1.0.tar.gz
Algorithm Hash digest
SHA256 938b5084584e1a72c0461240077218204179d922bc5236eb264d74e528f452bd
MD5 e56fb75424586ce6d1c9d224416e876f
BLAKE2b-256 43e0965f9b83024f05e25356d9421c0565ad3505bb6d5ff74d32203e221d8a72

See more details on using hashes here.

File details

Details for the file mykernel-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mykernel-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Linux/6.18.8-gentoo

File hashes

Hashes for mykernel-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d5344b3c3a00637a95272335aa2e11267d06facda77ae7b8d9ea9a6bf55bbd
MD5 124ef071c7ddc64231aa75b0ec200013
BLAKE2b-256 addb84a168db03f6b8b9027c3cacb183c64f8f5c1746cadcf4ccf625577e3c81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page