What's Required In Linux?
Quoting Richard Stallman:
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.
Many users do not understand the difference between the kernel, which is Linux, and the whole system, which they also call “Linux.” The ambiguous use of the name doesn't help people understand. These users often think that Linus Torvalds developed the whole operating system in 1991, with a bit of help.
Let's boil this down a bit. There are only 3 things needed to run a Linux:
- Hardware, A.K.A. a computer.
- The GNU collection of software.
- The Linux Kernel.
Note that 1 and 2 existed way before 3. See GNU Hurd.
The Wrong Approach
As Marcus has stated in his answer, and as you have found out the ability to have multiple users is a core value in any distribution, because it was a core value in UNIX. See:
I chose the above 2 links to illustrate two things:
- UNIX was expensive, but because this was the early days of networked computing it was easier for users to share one main computer connected via a teletype, a.k.a. a TTY. This should look familiar.
- Linux was meant to be a "free" solution to UNIX, as described in the "takeover" article. Because of this, the multiuser concept was replicated.
As such, the OP shouldn't try to remove a core design principle of all distributions of Linux. I do agree that the kernel can be streamlined to remove bloat, but should not be done haphazardly.
Customizing A Kernel - Proper Tools
While there are a bunch of sites on how to build a kernel, I found these:
Customizing A Kernel - What To Take Out
These are pointers on what I would take out. As a Gentoo user for nearly 20 years, I've built plenty of kernels from source. There is only one main section in the menuconfig
that one should focus on to start, and that would be Device Drivers
. One can safely disable all drivers that aren't installed or present on the PC. Some common tools to find what hardware is on the PC are:
Compiling and Recompiling a kernel in this way is an iterative process, but in short, one should not remove core parts of the base support, i.e., multiple user access. One note here: It is possible to boot the system with the defaault kernel into Rescue Mode
, a.k.a. Emergency Mode
. See: Rescue mode (rescue.target) and Emergency mode (emergency.target) descriptions. The link in the accepted answer is valid even though the version is 18.04 because SystemD's behavior hasn't changed.