1

Please let me know if this question needs to be reworded; I've been reading about the lowest levels of loading for Linux and Systemd.

I'm currently dealing with a limitation in grubx64.efi - It cannot allocate an initial ram disk of 1.2 gigabytes, the size of my company's LiveCD.

My thought for a solution is to load a smaller LiveCD ramdisk first, a custom initrd of ~300 megs or so, and inside that custom initrd have it set up to load the "real" LiveCD of 1.2 gigs, mount IT as the root file system, and then remove the old one.

I've been educating myself on how Systemd and the Linux boot process works in an attempt to figure out exactly how I might execute on this transition in CentOS 7, but the exact commands to invoke and places to put edits aren't obvious to me.

Is this something that can even be done manually?

Locane
  • 401

1 Answers1

1

After some back and forth with the Grub mailing list, I discovered that you can mount a squashfs image from a remote server using kernel parameters.

I set up legacy and EFI PXE to use the kernel and initrd in the PXEBOOT directory of the CentOS 7.4 ISO (kernel 3.10.0-693). Combined, they are like 60 megs or something.

Then, I put the squashfs.img file from the root file system I wanted to actually use in an http accessible directory on the same server.

Then, I used 2 kernel parameters (shown to me by the mailing list) to have the CentOS kernel mount the squashfs image as the root file system; the kernel is smart enough to know that live: means and creates a temporary (and very fragile - haven't figured that part out yet; 1 gig of writes causes it to go read-only) file system in RAM with which to do basic read/writing. I added these parameters to the PXE menu entry:

rootfstype=auto root=live:http://path/to/squashfs.img

That was it. That was the magic I was missing.

Locane
  • 401