0

I am trying to PXE boot a Rocky Linux (same as RHEL 8) installation. Unlike Fedora, there are no mirrors so url and repo options like this don't work:

url --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-34&arch=x86_64
repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f34&arch=x86_64

So when PXE launches the grub.cfg it has no media to pull the installation files from. The kickstart file works perfectly if I boot the VM with the Rocky installation ISO mounted - so I know the issue is about the bootstrap finding the iSO. I would like the kickstart file to have a reference to the public NFS share that has the ISO instead of configuring the VM to mount the ISO as a drive... What is the kickstart repo syntax to do that?

This is the entry in grub.cfg:

menuentry 'Teichos' {
  linuxefi Rocky8/vmlinuz ip=dhcp inst.ks=nfs:192.168.0.100:/pve/kickstart/rocky-minimal.ks
  initrdefi Rocky8/initrd.img
}

and this is my kickstart file:

#version=RHEL8
# Use graphical install
# graphical
text

repo --name="AppStream" --baseurl=file:///run/install/sources/mount-0000-cdrom/AppStream


%packages
@^minimal-environment
@network-server
kexec-tools

%end

# Keyboard layouts
keyboard --xlayouts='au'
# System language
lang en_AU.UTF-8

# Network information
network  --bootproto=dhcp --device=ens18 --ipv6=auto --activate
network  --hostname=teichos.mydomain.net

# Use CDROM installation media
cdrom

# Run the Setup Agent on first boot
firstboot --enable

# Accept the eula
eula --agreed

ignoredisk --only-use=sda
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part /boot/efi --fstype="efi" --ondisk=sda --size=600 --fsoptions="umask=0077,shortname=winnt"
part /boot --fstype="xfs" --ondisk=sda --size=1024
part pv.111 --fstype="lvmpv" --ondisk=sda --size=31142
volgroup rl --pesize=4096 pv.111
logvol swap --fstype="swap" --size=3276 --name=swap --vgname=rl
logvol / --fstype="xfs" --grow --size=1024 --name=root --vgname=rl

# System timezone
timezone Australia/Melbourne --isUtc

#Root password
rootpw --lock
user --groups=wheel --name=admin --password=$6$t23FE4wlPddt68ys$1GfPaRk42VVC4HYFPe9VQAhMjzgA1IYmkTBkMzSdubdBQuCkZp0PAuyzNmABF0n16kiMd7YCD2TNEgr5o/QAX/ --iscrypted --gecos="admin"

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end

The installation CD is located at:

nfs:192.168.0.100:/ISOs/Rocky-8.4-x86_64-dvd1.iso

1 Answer 1

1

I haven't tested Rocky yet, so this answer is based on RHEL/CentOS, but I'd expect it to be essentially the same.

The network boot process will need the squashfs installer image: it should be available on the installation CD at images/install.img.

If you don't want to image mount the ISO, then you should extract that image from the ISO and make it available over HTTP. A custom location can be specified with the inst.stage2= boot parameter. You might also need the hidden .treeinfo file from the root directory of the ISO.

In my setup, I have network boot parameters like this:

ip=dhcp inst.stage2=http://boot.server/rhel8 inst.lang=en_US inst.keymap=us inst.ks=http://boot.server/rhel8/rhel8config.ks

When the RHEL 8 installer initramfs is given that inst.stage=http://boot.server/rhel8 option, it first checks for the existence of http://boot.server/rhel8/.treeinfo. So it basically expects to find the complete contents of a RHEL 8 ISO image. If the .treeinfo file is not there, it will try and find the squashfs file at http://boot.server/rhel8/images/install.img. So it will basically append /images/install.img to whatever you'll specify.

The .treeinfo file will specify a sha256 hash for the install.img file, and the installer might actually use it for an integrity check if it's available, so you might want to provide the .treeinfo file too.

Once the stage2 image is loaded, the installer will have enough functionality for everything it's going to do, so it will be able to parse the kickstart file, mount NFS shares, etc. Before loading the stage2, it can only access HTTP, HTTPS and FTP servers. So once you've made sure the installer can load the stage2 image, you can then add the boot option inst.repo=nfs:192.168.0.100:/ISOs/Rocky-8.4-x86_64-dvd1.iso to have it use your ISO image.

1
  • Thanks. I got it working just fine. There were three changes I made: I extracted the ISO contents to an nfs share (didn't need to make it http), changed the kickstart to use "nfs --server=<nfs-ip-address> --dir=/pve/install-trees/rocky", and grub.fg I used inst.repo and inst.ks. It works a charm now.
    – Bryon
    Commented Nov 21, 2021 at 22:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .