[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMXgnP4nfgJ+gEvXLummspjRegsZsQ=e5Q8GFAONb2yCxVZLnA@mail.gmail.com>
Date: Wed, 4 Jun 2025 16:50:15 +0200
From: Alban Crequy <alban.crequy@...il.com>
To: linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Cc: Yucong Sun <fallentree@...com>, mauriciovasquezbernal@...il.com,
albancrequy@...rosoft.com
Subject: Loading custom BPF programs at early boot (initrd)
Hello,
I’m looking to load and attach a BPF program at early boot, that is
before the rootfs is mounted in read-write mode. This is for tracing
I/O operations on disk.
Without BPF, this can be done with a kernel module and then use Dracut
+ dkms to update the initrd. But I am looking to avoid custom kernel
modules and I would like to have a solution with BPF working on most
Linux distros without too much maintenance work for each distro.
I’ve noticed the bpf_preload module, but from the discussion below, I
gather that it does not allow to load custom bpf modules:
https://github.com/torvalds/linux/tree/master/kernel/bpf/preload
https://lwn.net/Articles/889466/
Do you know of prior-art or recommendation how to do this correctly,
and hopefully without a custom kernel module?
Best regards,
Alban
Powered by blists - more mailing lists