Skip to main content

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:

[ccache]

  • ccache
    • Descripción: Establece a True para usar ccache durante la compilación. Establece a False para deshabilitarlo. Por defecto es False. Si es False, se ignora la lógica de ccache y se elimina el directorio /var/cache/ccache_mykernel.

[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"

Metadata

Release files for mykernel 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mykernel 1.2.0
File Size Uploaded Provenance Actions
mykernel-1.2.0.tar.gz 23.7 kB Without provenance Details for mykernel-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mykernel 1.2.0
File Interpreter ABI Platform Actions
mykernel-1.2.0-py3-none-any.whl Python 3 none any Details for mykernel-1.2.0-py3-none-any.whl

Total release size: 53.1 kB

Release files / mykernel-1.2.0.tar.gz

Download URL mykernel-1.2.0.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8d678c87b0b5642b02ae4c7ca0b61fea2891b6d0b4cab52ced84866535cc2a66
BLAKE2b-256 checksum
How to use checksums
bba82281cbbdbfdcd85564ca2e241fdbe6a2b281f83e70ce58a0a60ff0a6418d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.14.10 Linux/7.3.0-gentoo

Release files / mykernel-1.2.0-py3-none-any.whl

Download URL mykernel-1.2.0-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06002fbdb40697474d5306dd9002970c0b358e8b76a11a1bfe6871e1c5162e04
BLAKE2b-256 checksum
How to use checksums
abaa807fef969aa969a55e2cfa7647d12506047de8d84ab7679b124b063a9818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.14.10 Linux/7.3.0-gentoo

Security for mykernel 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page