• lmr0x61@lemmy.ml
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    1 day ago

    Those modules, man… they’re the biggest cause of—dare I say it?—bloat in the kernel.

    For the few people here who may not know about it: there’s a utility called modprobe-db that watches what kernel modules get loaded at runtime, and can generate a kernel build config file accordingly. There’s even an ArchWiki article about it. You need to keep it around for a while (e.g. several weeks or months) so it can get a proper sample of the modules you use; that way, your kernel can have all the modules you need (ask me how I know). If you do it right, however, you can slim down your compile time significantly.

    • tux7350@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      9 hours ago

      I’ll ask! How do you know? Lol

      All jokes aside, I think this might really help me with a side project I’ve been working on. Ive been trying to get full disk encryption working on a NanoPi R6S running NixOS. The issue that im having is that im not sure exactly what modules I need in the initrd. When I boot, there is no output on the display after systemd-boot shows.

      The manufacturer puts out a version of Ubuntu thats works flawlessly so I know its possible. But I’ll pass on the snaps and id rather not use uboot. System is working with edk2 and nixos.

      Long story short, will this software allow me to figure out what is running in the manufacturer’s kernel and port it over?

      • lmr0x61@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        4 hours ago

        How do you know?

        Zoom not having working audio—discovered right before a job interview 💀

        But yeah, I bet it would work! Just make sure you run modprobe-db with the manufacturer’s kernel long enough to run all the software you’ll actually use, so it can record the modules you need.

        Of course, make sure you read up on it with that ArchWiki article and take a look at the source code to be sure (it’s basically a simple shell script), but from what I understand it should do what you need.

        • tux7350@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          5 hours ago

          Well if it was for a tech job im sure you could’ve shown off some troubleshooting skills haha

          And the ArchWiki link is perfect. Ill read up on that and ensure I’m using it correctly. Thank you very much for the pointer kind stranger! :)

    • Samskara@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      8 hours ago

      Does that mean you need to fiddle with modules, because you plug in a new USB-device you haven’t used before?

      • lmr0x61@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        6 hours ago

        Yeah, if you use a kernel you built off modprobe-db’s config output, but the build config was generated before you ever used that USB device, then yeah, your kernel wouldn’t have the right modules for it (if the device required some unique kernel modules). modprobe-db will only tell you what it’s seen you use.