Normally when installing CentOS 7, you download the ISO, write it to a thumb drive and boot it. However, I have a unique scenario where I'd like to be able to place the CentOS 7 installation files on a system's /boot/
partition and create a custom GRUB2
entry that can boot into that environment. This can then be used to install CentOS 7 on the same system.
I know this sounds silly, but I have my reasons..
After doing some research, I'm trying to piece together how this works. Here is what I'm seeing in my head currently:
GRUB2
would load the CentOS 7 kernelvmlinuz
andinitrd.img
.- After initializing the kernel and loading the
initrd.img
into memory, thedracut-initqueue
service starts. - The
dracut-initqueue
processes will then try to load thestage2
image, which holds the installation runtime (Anaconda in this case). - Finally, the CentOS installation process kicks off.
So to start I..
- Downloaded the ISO, mounted it and copied the
/images/pxeboot/vmlinuz
,/images/pxeboot/initrd.img
and/LiveOS/squashfs.img
(which I believe contains thestage2
image) files to my/boot/
partition. - Added the below entry to
/etc/grub.d/40_custom
.
menuentry "CentOS 7 Installation" {
set root=(hd0,msdos1)
linux /centos7-install/vmlinuz initrd=initrd.img stage2=/centos7-install/squashfs.img
initrd /centos7-install/initrd.img
}
After doing the above, I would hope that I would at least get up to loading Anaconda, however instead it simply loads up to "dracut-initqueue timeout" messages. Sadly, I haven't had any luck finding any logs that hint towards exactly what went wrong.
Would anyone happen to have any ideas on how to go about this?