Created attachment 297349 [details]
init script patch to load squashfs.image
I'm writing a bug because somebody in the forum told me to do so.
In short: i like the idea of booting / installing systems over PXE, no USB stick, no DVD is needed, just a simple network cable needs to be attached.
I know the only supported way of installing Gentoo is by using the live CD provided by the developers. So to install Gentoo via PXE i unpacked the initrd file, attached the squashfs.image (/mnt/cdrom/squashfs.image) patched the init file, and packed everything back together again.
The patch for the init script is attached to this bug.
If you guys think it would be a good idea to (kinda) support this. i can write a simple bash script which will do everything i did fully automatically just having this script and the official installation image. So everybody how needs a PXE installation without NFS mounts or something like that can easily "convert" the cd image to a bootable kernel + initrd image.
Subscribing to this bug. Patch exists long time ago. This patch is not production-quality, but it seems that some users really need such functionality(i am the such user also). Could we do something about this?
I have made similar implementations for SystemRescueCd,
The idea is simply to allow for squashfs image to be located in already existing/mounted filesystem, before search on different media is started.
I also made this work by injecting a /etc/initrd.splash (and squashfs) via additional cpios, .splash containing:
I also think that BUG #74628, and BUG #494300 would be solved by this
Created attachment 540984 [details, diff]
Patch Detection of squashfs in root
Added patch that should work, hopefully without breaking anything else.
Example usage at http://b800.org/gentoo/boot.ipxe
With backup at https://gateway.ipfs.io/ipfs/QmP1hw69dV7kSUBEBTBpGtudxwcH5Apu1ngUzRtr5jEBCR/boot.ipxe
With attached patch applied however, the "/etc/initrd.splash" in boot.ipxe should not be needed.
What the patch does is "simply" to detect if the LOOP filename already exists in the existing filesystem (exact path match) and if it does it skips all CD detection and mounting.
the CDROOT_PATH modification is needed to avoid check_loop() in initrd.scripts to error out, didn't find a better way to handle that.
Created attachment 540986 [details, diff]
Updated patch with initialization of variables added, and some comments
ignore "init script patch to load squashfs.image", the other patch is good to go I think.
The bug has been closed via the following commit(s):
Author: Christian Nilsson <email@example.com>
AuthorDate: 2018-07-24 23:08:23 +0000
Commit: Rick Farina (Zero_Chaos) <firstname.lastname@example.org>
CommitDate: 2018-07-25 15:10:19 +0000
linuxrc: Add detection of squashfs in initrd root
Allows for the squashfs to be found in the initrd root without mounting CD
This allows iPXE boot by adding the squashfs in a extra cpio initrd
Signed-off-by: Christian Nilsson <email@example.com>
defaults/initrd.defaults | 5 +++++
defaults/linuxrc | 21 +++++++++++++++------
2 files changed, 20 insertions(+), 6 deletions(-)