Post Reply 
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can not boot RHEL 7.3 by using iPXE
2016-12-21, 03:50 (This post was last modified: 2016-12-21 04:22 by mathp.)
Post: #13
RE: Can not boot RHEL 7.3 by using iPXE
If the hackish solution I posted earlier is for you, and like me, you don't like "force loading" some kernel modules because the ones in the squashfs.img images are an older version, you can completely skip creating and populating the "etc/modules-load.d" directory by also updating the modules inside the squashfs.img images:

"Unsquash" the image:

yum install squashfs-tools

cd ~mathp/POC
mkdir squashfs-tmp
cd squashfs-tmp
unsquashfs ../squashfs.img

Mount the live O/S filesystem contained within the squashfs image:

cd ~mathp/POC
mkdir LiveOS-tmp
mount -o loop squashfs-tmp/squashfs-root/LiveOS/rootfs.img LiveOS-tmp/

Replace the kernel modules and unmount the live O/S filesystem:

rm -rf LiveOS-tmp/usr/lib/modules/3.10.0-514.el7.x86_64/
rsync -avz kernel/lib/modules/3.10.0-514.2.2.el7.x86_64 LiveOS-tmp/usr/lib/modules
depmod -ae -F kernel/boot/ -b /home/mathp/POC/LiveOS-tmp/
umount LiveOS-tmp/

Re-create the squashfs image:

cd squashfs-tmp/
mksquashfs squashfs-root/ ../squashfs.img-3.10.0-514.2.2.el7.x86_64 -noappend -always-use-fragments

A this point, you need to copy the new squashfs image to a directory accessible by your iPXE client. The simplest form is to create a LiveOS directory and put the new squashfs.img file into it, then reference the parent directory in your iPXE config / kernel parameters (via inst.stage2=).

For example, with the files accessible in the following structure:

    |-- initrd.img-3.10.0-514.2.2.el7.x86_64
    |-- LiveOS/
    |   |-- squashfs.img -> squashfs.img-3.10.0-514.2.2.el7.x86_64
    |   `-- squashfs.img-3.10.0-514.2.2.el7.x86_64
    `-- vmlinuz-3.10.0-514.2.2.el7.x86_64

you can use something like:

set my-initrd initrd.img-3.10.0-514.2.2.el7.x86_64
set my-vmlinuz vmlinuz-3.10.0-514.2.2.el7.x86_64

initrd --name initramfs http://install-services/boot-images/centos/7.3.1611/${my-initrd}
kernel http://install-services/boot-images/centos/7.3.1611/${my-vmlinuz} initrd=initramfs inst.stage2=http://install-services/boot-images/centos/7.3.1611 ${params}

where ${params} is set to all your other installation parameters (inst.ks, console, inst.text BOOTIF=, etc.)

Have fun ;-)
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Can not boot RHEL 7.3 by using iPXE - mathp - 2016-12-21 03:50

User(s) browsing this thread: 1 Guest(s)