Is there any specific relationship between initramfs production and bzImage production?

My initial problem was that the system was blocked to the initramfs shell. Later, telcoM and Tom Yandiscovered that my problem was due to a lack of drivers and mismatched versions of the subsequent drivers. Therefore, I followed their advice and resolved my problem.

However, later on, I modified the compilation options of the kernel, possibly due to excessive modifications. Instead of making clean, I directly make bzImage, only to find that when the system started, I got stuck in initramfs again. I tried to modify the rootdealy and check if the driver was compiled into the kernel to solve my problem.

By this answer, I only recompiled and installed the kernel according to its operation. However, I haven’t changed the hard drive or kernel version on my end, just modified the kernel configuration options. So I guess there seems to be a relationship between the production of initramfs and bzImage?

My question::

enter image description here

Answer:

enter image description here

Asked By: ABeginner

||

Theoretically the answer is "it depends".

In practice, I’ve never knowingly seen cases where initramfs can be kernel independent. Most systems generate one initramfs per kernel (as far as I know).

One practical use case for initramfs is loading kernel module before mounting the root file system. This solves the chicken and egg problem caused when the root file system requires special drivers which are not statically compiled into the kernel. To do this initramfs must contain copies of kernel modules to be loaded.

Since compiled kernel modules may have binary differences with different kernel configuration, changing the configuration can require new kernel modules to be compiled and then packaged into initramfs.

Likewise, where some modules could be statically compiled in or dynamically loaded, changing configuration to require dynamically loading modules may need those modules to be added into initramfs.

Hypothetically you could have a kernel which contains the right modules statically compiled in. Initramfs may then not be required to change with every kernel re-compile. Like I say above: I’ve never actually seen this done.

Answered By: Philip Couling
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.