[CentOS] Compiling custom "vmlinuz" PXE kernel?

Tue Apr 4 14:01:49 UTC 2017
Denniston, Todd A CIV NAVSURFWARCENDIV Crane, JXVS <todd.denniston at navy.mil>

> From: Locane [locane at gmail.com]
> Sent: Monday, April 03, 2017 8:33 PM
> To: CentOS mailing list
> Subject: [CentOS] Compiling custom "vmlinuz" PXE kernel?
> 
> Hello CentOS list, I still need help.
> 
> Does anyone know how I would go about creating my own "vmlinuz" PXE
> kernel?  I'm still trying to get the NUC6CAYH to load to a LiveCD, and I'm
> getitng nowhere with Intel.
> 
> My company wants to do hundreds of these per month;  we're not above paying
> for professional help at this point.
> 
> My current line of reasoning is to get whatever specialized memory and CPU
> drivers the NUC6CAYH requires to recognize properly and bake them in to a
> custom vmlinuz PXE kernel that loads the initial ramdisk image.  This
> kernel is located in a regular CentOS 7.3 DVD at
> CentOS-7-x86_64-DVD-1611/images/pxeboot/vmlinuz.
> 
> Has anyone done this before?  Is there documentation online?

If I understand correctly you are wanting to build a kernel to boot the install process with, i.e., boot to run anaconda.
For some reason I never had any luck [with EL4] replacing the modules in the anaconda initrd.img with the ones for the kernel I built, so I took a more *brittle* path.
I built a kernel that included *_all_* the drivers I needed (and only those *_needed_*) built into the kernel itself, i.e., *not* as modules.  I then set the process up to boot from the vmlinuz I built.  It was not right to ignore the mods in the initrd, but it worked enough to get us going, IIRC it was because some USB driver we needed was not built in and we were installing from a USB hard drive.
Also note, you need to grab the kernel config for an EL kernel of your distro and start modifying from there because some of the later tools in the install chain expect most of the kernel to be configured as RH would do it.


*_all_* - using this method you can't depend on ANY modules, everything you need to activate all the hardware in the system has to be in the kernel image (vmlinuz).  If you can figure out how to correctly mod the initrd then you can use some modules again, and then only the modules you need to boot and read the initrd have to be in vmlinuz.  Also I don't recall what they are, but there are some size limits to how big vmlinuz can be, so don't just build every driver into the kernel.

Good luck.
--
Even when this disclaimer is not here:
I am not a contracting officer. I do not have authority to make or modify the terms of any contract.