Greetings,

I want to trim down my Linux kernel to only support a tty and ethernet card, I don’t need any other features, has anyone done something similar of trimming down the linux kernel. I know that “make tinyconfig” exist but it’s not what I want.

can anyone suggest me something? or provide me some documentation to do it?

Thanks in advance!

  • frankenswine@lemmy.world
    link
    fedilink
    English
    arrow-up
    15
    ·
    1 day ago

    make menuconfig should guide you through all possible options and enable you to browse and navigate all the dependencies. maybe deselect all first and then select only the ones you want?

    • whoareu@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      yes that could work but I don’t know where is the option to only enabled tty and the internet ( Ethernet card ). all options I see seems cryptic and doesn’t make any sense, it’s maybe because I am new to Linux Kernel tinkering…

      • tal@lemmy.today
        link
        fedilink
        English
        arrow-up
        23
        ·
        edit-2
        1 day ago

        all options I see seems cryptic and doesn’t make any sense, it’s maybe because I am new to Linux Kernel tinkering…

        So, just as a heads-up, building a truly minimal custom kernel is going to probably involve learning about what a bunch of kernel systems do. Like, this isn’t going to be a five minute task skimming a menu with twenty choices on the lines of “Ethernet”, “3D graphics”, etc.

        I don’t know what you’re aiming to accomplish, but it may be that a regular kernel build already does what you want. Like, say you want to reduce memory usage. Most of the current-day Linux kernel on typical distros is built to be modular. That is, features are built into modules, and never actually loaded unless that functionality is called for. It’s not all that common for a typical user to need to build a custom kernel in 2025.

        You can reduce build time, but that’s not usually a huge issue for most people if they’re using prebuilt kernels.

        You can maybe shave down disk space, but the kernel isn’t usually the first candidate that I’d go after for that.

        If you’re doing this as a learning experience, then knock yourself out. Just want to moderate expectations, if you’re going into this thinking that this is a common task and is going to involve a minimal amount of learning and effort. You’re probably going to discover that your kernel requires a lot more than you’re listing here to usefully function.

        If you do decide to go down this route, you’re going to want to dig up one of the many guides to building and installing a new kernel. If you haven’t already done so, I’d get to the point that you can build a normal kernel for your distro, with the options that it sets, and get it working and boot off it. That’ll give you a working starting place before you start trying to figure out what you can rip out, and you’ll be familiar with the bootloader, initrd, and some other stuff that you’ll want to know. You’re probably going to need to understand what a lot of the systems you’re stripping out of your kernel do; Google is going to be your friend.

      • frankenswine@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 day ago

        you might have to read what all those options are about. also, what you are referring to as ethernet may or may not be a specific driver, and tty itself is a somewhat abstract concept, maybe you mean serial - which is often addressed by or attached to TTYs?

  • 9point6@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    1 day ago

    I think it’s worth understanding that tinyconfig is the result of a lot of effort into finding how much you can strip back the kernel and have it still (kinda) work. It’s realistically as stripped back as you can get—you don’t even get access to storage devices by default.

    I’m curious about where your requirements have come from, as if the kernel was literally just tty and ethernet, you basically wouldn’t be able to do anything with it.

  • pelya@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    If you want to run Linux on a toaster with 16 MB flash, your best option is probably OpenWRT.
    If you are running it on a regular PC, just turn off the monitor and plug out the speakers I guess. Recompiling Linux kernel looks too much like a hassle, you’ll need to disable specific device drivers to deactivate videocard and soundcard but keep the keyboard running. Or boot into a recovery mode, the OS will disable everything except for the terminal, and you’ll need to enable networking using shell commands.