Generate a pxe compatible initrd.img

what is the difference between the kernel & initrd.img found in
/images/pxeboot on the DVD

and the kernel & initrd.img found in the /boot ?

I have created a kernel 5 rpm like elrepo it works without any problem on a existing installation
But want i want it is booting this kernel in pxe and perform the installation because some hardware fond on my compute must have drivers with kernel 5

there is a difference because if i boot with those in pxelinux directory it works but if i try to boot event a kernel & initrd from the boot it failed in switch root pivot.

I saw that the inird is not mounted

i have done a lsinitrd but saw nothing anormal

The kernel is same.

Bootloader loads/executes kernel and hands it uncompressed initrd to mount. Kernel loads/runs drivers, etc from the initrd so that it can mount the root, /. Initrd is not used / kept mounted after that.

The initrd on install media is fat. It has all the supported drivers and it starts the installer.
The initrds in /boot are thin. They are created for newly installed kernels and they contain only the drivers and steps that are needed for booting “on this machine”.

It is possible to use additional/updated drivers with “driver disk”. The inst.dd= kernel option.

I did use that to install AlmaLinux on old server with unsupported RAID controller; the location for inst.dd was URL to image at ELrepo site (and it was booted via PXE).

You, however, want to boot with kernel that is not provided by AlmaLinux.
Note that the kernel that you run the installation with does not have to be the same kernel
that is installed.

We can boot the installer with the kernel that Alma 8.5 was released with, but we don’t install that kernel, if we use online repo that already has newer kernel. Similarly, with CentOS Linux 7, if I did include the updates repo for installation, the older kernel from base was never installed.

Whether you can install kernel-ml and not install kernel at all … I don’t know. Perhaps.

But, to boot installer with “foreign” kernel – you need to create the initrd for that kernel, with that kernel version’s drivers (and your additions) and add the installer too. Frankly, I have no idea how that is done. Some people create “custom ISOs”, installation media. They must know?

Thx a lot to point me to elrepo they have examples of oemdrv iso The documentation provide by redhat was not very clear how to make this.
the file rhdd3 for example just with
Driver Update Disk version 3 in it and if you don’t have it it refuse to see as oem driver disk. I want to do unattended installation

and the inird was built with the good kernel
i make a rpm-pkg again the kernel 5 so it build 3 rpms
kernel kernel-header and kernel-doc
after installating this kernel and it boot’s fine.
The inird img was generated during the installation of the rpm
and i have get it from the /boot

But you solution with inst.dd is beter i had a problem with the network driver with this i can do the installation and the installation of the kernel 5 is delayed in the post of the kickstart
i fixed also the grub to boot on it en tadaammm i’m on kernel 5 completly unattend. And the mediatek wifi driver work like a charm on it

1 Like

I have deep read the documentation
what is important in pxe boot is the initrd for initial boot
but after that it use the inst.stage2 that perform the loading
of a squafs imageand that is this image that used by the pivot root as root filesytem and contains all the modules


The inst.stage2= boot option specifies the location of the installation program’s runtime image. This option expects the path to a directory that contains a valid .treeinfo file and reads the runtime image location from the .treeinfo file. If the .treeinfo file is not available, the installation program attempts to load the image from `images/install.img or images/efiboot.img.

this is the case for almalinux on the dvd 8.5 you find the install.img. So when you made a foreign kernel boot
you must have the kernel the initrd and you must also provide a install.img or efiboot.img with the correct module compiled for your foreign kernel when you perform a pxe installation.
I was not the size of the initrd but the lack of install.img in kernel 5