Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: provide a method for installing custom kernels #397

Open
flukejones opened this issue Jan 7, 2025 · 1 comment
Open

Request: provide a method for installing custom kernels #397

flukejones opened this issue Jan 7, 2025 · 1 comment

Comments

@flukejones
Copy link

Per discussion on matrix:

To ease kernel development on serpent a method for installing a custom kernel such that the kernel binary, modules, and efi entry are not overwritten whenever a FS blit is done.

My current method for installing a kernel I build from git is as follow:

sudo mkdir /efi/EFI/serpentos/6.12.8
sudo mkdir /lib/kernel/6.12.8

make LLVM=1 INSTALL_MOD_STRIP=1 all -j$(nproc)

sudo mount /dev/nvme0n1p1 /efi
sudo mkdir /efi/EFI/serpentos/6.12.8
sudo mkdir /lib/kernel/6.12.8

make LLVM=1 INSTALL_MOD_STRIP=1 all -j$(nproc)
sudo cp ~/Projects/asus-linux/linux/arch/x86_64/boot/bzImage /efi/EFI/serpentos/6.12.8/vmlinuz
sudo make LLVM=1 INSTALL_MOD_STRIP=1 modules_install -j$(nproc)

sudo dracut --strip --tmpdir /tmp -N -f \
--kmoddir /lib/modules/6.12.8-00028-g982f084df5f5 --kver 6.12.8-00028-g982f084df5f5 --add "bash rescue systemd virtiofs lvm dm" \
--strip --hardlink --nomdadmconf --nolvmconf --add-drivers "qxl virtio-gpu" --zstd --early-microcode --fwdir /lib/firmware \
--include /home/gamer/Projects/serpentos/recipes/l/linux-desktop/pkg/depmod.conf /lib/depmod.d/depmod.conf \
/lib/kernel/6.12.8/50-default.initrd

sudo cp -f /lib/kernel/6.12.8/50-default.initrd /efi/EFI/serpentos/6.12.8/

with an extra entry at /efi/loader/entries/serpentos-6.12.8-72.desktop-17.conf with required setup. This gets me to where I need to be with a booted kernel, and able to reload the current driver I'm working on with sudo insmod drivers/hid/hid-asus-ally.ko (at git source)

@ermo
Copy link
Member

ermo commented Jan 10, 2025

󰌽 ermo@virgil:~/repos/serpent-os/recipes/l/linux-desktop/pkg [  main ? ]                                                04:00
❯ cat boot.json 
{
  "name": "linux-desktop",
  "version": "@VERSION@",
  "variant": "desktop"
}

Based on the above, I think it might be as simple as you copying to a new directory like, say, linux-asus-ally and then modifying the boot.json to contain

{
  "name": "linux-asus-ally",
  "version": "@VERSION@",
  "variant": "desktop"
}

(and editing the stone.yaml name to match) maybe...?

@ikeycode Guidance welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants