Corrupt Image when using legacy PXE

Trying to deploy Rocky 8.5 via PXE to a legacy bios machine, i.e. not EFI, and keep running into the same issue. It correctly gets the pxelinux.cfg/ks file, but throws an error saying “invalid or corrupt kernel image” as soon as it gets the ks. The target machine is configured for legacy boot, disable secure.

I’ve obfuscated a few path names and hostnames deliberately, but

the pxelinux.cfg/ks file:

DEFAULT linux auto
LABEL linux
KERNEL vmlinuz-rocky8.5
APPEND initrd=initrd.img-rocky8.5 ks=nfs:<LOCAL REPO HOST>:/Path/to/config.cfg repo=nfs:<LOCAL REPO HOST>:/path/to/repo/here/x86_64 

I mounted and copied the vmlinuz and initrd from the installation media, and I checked the media was fine by making a USB and testing an installation, which was successful.

mount installation-media /tmp/mnt
rsync -azvH /tmp/mount/images/pxeboot/{initrd.img,vmlinuz} <PXEHOST>:/tftboot/location/bios/

note: there’s a link pointing to the location of the initrd/vmlinuz. This was done to save space on the tftpboot host, and only have one copy of the initrd/vmlinuz files for both legacy bios and efi machines.


ls -l /tftpboot/pxelinux/bios/

vmlinuz-rocky8.5 -> ../vmlinuz-rocky8.5

I checked our tftpboot and PXE environment and it works with a Centos7.9 image, same ks file, just %s/rocky8.5/rh7.9/g as the changes.

In the log on the pxe host on a failed rocky build:

RRQ from <IP ADDRESS> filename pxelinux/bios/pxelinux.0
Error code 0: TFTP Aborted
RRQ from <IP ADDRESS> filename pxelinux/bios/pxelinux.0
Client <IP ADDRESS> finished pxelinux/bios/pxelinux.0
RRQ from <IP ADDRESS> filename pxelinux/bios/pxelinux.cfg/<machine ID>
Client <IP ADDRESS> finished pxelinux/bios/pxelinux.cfg/<machine ID>
RRQ from <IP ADDRESS> filename pxelinux/bios/vmlinuz-rocky8.5
Error code 0: TFTP Aborted
Client <IP ADDRESS> timed out

Am I missing something obvious or is this a niche-case bug?

After beating on this specific error for a long time, I tried the syslinux 6.04pre1 build of pxelinux.0, and copied it along with ldlinux.c32 from the rocky isolinx folder to my pxelinux/bios/ folder, and it loaded the kernel.

still seeing some other quirks but that enormous hurdle has been identified. It was a bad pxelinux.0 version for trying to deploy rocky

Run into the next roadblock, it’s not finding the AppStream repo, but I can’t for the life of me figure out what’s wrong with the syntax.

From the anaconda.log

ERR payload.manager: PayloadError: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

the pxelinux.cfg/MACHINEID

LABEL linux
KERNEL vmlinuz-rocky8.5
APPEND initrd=initrd.img-rocky8.5 inst.repo=nfs:<LOCAL REPO HOST>:/patches/os/repos/rocky/mirror/8.5/BaseOS/x86_64/os inst.addrepo=AppStream,nfs://<LOCAL REPO HOST>/patches/os/repos/rocky/mirror/8.5/AppStream/x86_64/os/repodata inst.ks=nfs:<LOCAL REPO HOST>:/patches/os/Rocky-8.5/ks.cfg

in the BaseOS installation folder, .treeinfo points to the correct location for the AppStream folder, i.e. …/…/…/Appstream/x86_64/os

any ideas?