Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Officially support PXE installation (without nfs)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
W4RH4WK
n00b
n00b


Joined: 19 Jul 2011
Posts: 6

PostPosted: Fri Dec 23, 2011 11:26 am    Post subject: Officially support PXE installation (without nfs) Reply with quote

hello there,
i recently setup a PXE server from where i can install gentoo.

i do know the only officially supported way of installing gentoo is using the live cd installation image, but i think burning cdroms and stuff is kinda old.... ok, you can put the iso file on a usb drive using unetbootin, but it's much cooler to do a installation just over network. most of the hardware around nowadays support PXE, so why not using it, it's quite simple to setup and esay to handle.

to accomplish this, i unpacked the initrd from the iso file, added the squashfs image to it, and patched the init script inside initrd. this is very less work to do. i can provide a script to do all that in a split second, so what do you think about this.

will gentoo pxe installation be officially support soon, or should i just provide a script and added this "tutorial" to the handbook of alternative installation?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Fri Dec 23, 2011 1:14 pm    Post subject: Reply with quote

W4RH4WK,

Make an account at bugs.gentoo.org and post a bug describing what you did.
Others, including the developers, will find it there.
Attach a patch to your bug if you can too, that makes it easy to add to the liveCD.


There is no harm in posting top level details and a link to your bug to Documentation, Tips and Tricks either.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NiXZe
Tux's lil' helper
Tux's lil' helper


Joined: 22 May 2003
Posts: 75
Location: Uppsala Sweden

PostPosted: Sun Jul 18, 2021 9:51 am    Post subject: Reply with quote

Not trying to play necromancer here, but Bug https://bugs.gentoo.org/396467 was created, and later resolved.

You can add squashfs as an additional initrd (as long as it has cpio header), so no need to repac initrd.

Update:
https://github.com/NiKiZe/Gentoo-iPXE
Trying to get this officially supported, but minimal current way to do this is:
Code:

#!ipxe
initrd combined.igz
# create with
#(cat gentoo.igz; (echo image.squashfs | cpio -H newc -o)) > combined.igz
# simplest and fastest boot, but 390M file
# or
#(cat gentoo.igz; (echo image.squashfs | cpio -H newc -o | xz --check=crc32 -vT0)) > combined.igz
# only compress squashfs, but black screen while decompressing, 360M file
# or
#(xz -d gentoo.igz -c; (echo image.squashfs | cpio -H newc -o)) | xz --check=crc32 -vT0 > combined.igz
# recompress everything, black screen while decompressing, 359M file

# cmdline initrd= is needed in efi mode
kernel gentoo root=/dev/ram0 init=/linuxrc  keymap=se looptype=squashfs loop=/image.squashfs  cdroot vga=791 initrd=combined.igz panic=5

boot


Script to help download minimal ISO and create the needed files: https://github.com/NiKiZe/Gentoo-iPXE/blob/main/gentoocd_unpack.sh
_________________
What? Where? Oh! this one, it's Gentoo.
If you don't have anything constructive to say, you might want to consider staying quiet instead.
To many destructive comments, which in no way will help making the Gentoo community better.
Back to top
View user's profile Send private message
chrisyu
Apprentice
Apprentice


Joined: 10 Apr 2003
Posts: 207
Location: China

PostPosted: Mon Jul 26, 2021 6:43 am    Post subject: Reply with quote

NiXZe wrote:
Not trying to play necromancer here, but Bug https://bugs.gentoo.org/396467 was created, and later resolved.

You can add squashfs as an additional initrd (as long as it has cpio header), so no need to repac initrd.



Thank you, NiXZe.

Just a report, combined.igz works well with my grub ipxe.efi setup.

grub
Code:

menuentry 'iPXE Netboot' {
        search --no-floppy --fs-uuid --set=root UUID_HERE
        chainloader /boot/ipxe/ipxe.efi
}


ipxe menu
Code:

:gentoo
    set base ${http-root}/gentoo-livecd-20210722
    initrd ${base}/combined.igz
    kernel ${base}/gentoo root=/dev/ram0 init=/linuxrc keymap=us looptype=squashfs loop=/image.squashfs  cdroot vga=791 initrd=combined.igz panic=5
    boot


Chris
Back to top
View user's profile Send private message
NiXZe
Tux's lil' helper
Tux's lil' helper


Joined: 22 May 2003
Posts: 75
Location: Uppsala Sweden

PostPosted: Mon Jul 26, 2021 6:56 am    Post subject: Reply with quote

chrisyu wrote:

ipxe menu
Code:

:gentoo
    set base ${http-root}/gentoo-livecd-20210722
    initrd ${base}/combined.igz
    kernel ${base}/gentoo root=/dev/ram0 init=/linuxrc keymap=us looptype=squashfs loop=/image.squashfs  cdroot vga=791 initrd=combined.igz panic=5
    boot


Chris


Nice to hear about your success, iPXE have (for me) been known working for quite some time.
if your iPXE script is loaded from the same folder as combined.igz and gentoo then the set base and ${base} use is not needed.

I have tested combined as working with pxelinux and grub directly as well, but using tftp makes that horribly slow, while local gigabit with iPXE and http takes just a few seconds at most.
_________________
What? Where? Oh! this one, it's Gentoo.
If you don't have anything constructive to say, you might want to consider staying quiet instead.
To many destructive comments, which in no way will help making the Gentoo community better.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3150

PostPosted: Mon Jul 26, 2021 7:09 pm    Post subject: Reply with quote

Does it mean that this squashfs initramfs will be downloaded by bootloader and then loop mounted rather than immediately decompressed (which is what happens with compressed cpio initramfs)?
Also, AFAIR TFTP has a hard filesize limit somewhere around 100MB. Can I use another protocol to load a bigger squash? Natively, without using yet another initramfs to wget it done. What is the limiting factor here actually? BIOS?
Back to top
View user's profile Send private message
NiXZe
Tux's lil' helper
Tux's lil' helper


Joined: 22 May 2003
Posts: 75
Location: Uppsala Sweden

PostPosted: Mon Jul 26, 2021 8:00 pm    Post subject: Reply with quote

szatox wrote:
Does it mean that this squashfs initramfs will be downloaded by bootloader and then loop mounted rather than immediately decompressed (which is what happens with compressed cpio initramfs)?

Not sure I understand what you are asking here. But I think the answer is that squashfs is in ram, but it is still squashfs in ram, not raw cpio. (if you use docache on boot the squashfs is copied from cd to RAM and then used from there, this is the same thing, just that it is kept in initramfs)

szatox wrote:

Also, AFAIR TFTP has a hard filesize limit somewhere around 100MB. Can I use another protocol to load a bigger squash? Natively, without using yet another initramfs to wget it done. What is the limiting factor here actually? BIOS?

Had to do a quick search
Quote:
The original protocol has a transfer file size limit of 512 bytes/block x 65535 blocks = 32 MB. In 1998 this limit was extended to 65535 bytes/block x 65535 blocks = 4 GB by TFTP Blocksize Option RFC 2348.

iPXE has no real limit for TFTP, nor pxelinux, there might be limitations in pxe roms or TFTP servers, but this is not a real issue.
(in legacy pcbios the limit of initial NBP is 640Kb, but iPXE, pxelinux, and grub can fit in that, and is then less limited)

I personally always use iPXE and http, so the only transfer in TFTP is undionly.kpxe, or snponly.efi depending on pcbios/efi mode.
After that everything is over http. The only limiting factor here is RAM size.

TFTP transfer of combined.igz in iPXE takes around 20 seconds, while http takes max 5. (Note to self: Test and document this properly)
Also tested with pxelinux and grub, first grub test gave some timeouts, but upgraded grub works fine. Here everything is horribly slow and no feedback, so it is a wait at black screen. But it works as long as you don't run out of patience.

In https://github.com/NiKiZe/Gentoo-iPXE you can find test_w_qemu.sh to test this out in a VM
Quick start:
Code:

git clone https://github.com/NiKiZe/Gentoo-iPXE.git
cd Gentoo-iPXE
# test starting over http from online server (in the future hopefully gentoo mirrors)
sh test_w_qemu.sh useonline
# test local iPXE TFTP boot, first prepare local files..
sh gentoocd_unpack.sh
# now run test
sh test_w_qemu.sh


Testing grub or pxelinux takes a bit more setting up. Details can be found in git commits (until I get the time to write more documentation for it)
_________________
What? Where? Oh! this one, it's Gentoo.
If you don't have anything constructive to say, you might want to consider staying quiet instead.
To many destructive comments, which in no way will help making the Gentoo community better.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3150

PostPosted: Mon Jul 26, 2021 10:13 pm    Post subject: Reply with quote

Yeah, you got my question right. I have done something similar a few years ago (pxe boot into sqfs stored in RAM), but it required a handmade initramfs to work.
Eliminating this stage is great, good job there!

I wonder what was the exact obstacle I've ran into when playing with this stuff though; I am sure I had to change compression from gzip to bz2 just to save a few MBs close to 100MB mark (never bothered to figure out what the exact limit was, but it was way higher than 32MB and nothing near 4GB when the whole thing flipped from booting reliably to failing reliably). Maybe it was something implementation-specific... I had pxelinux on one end and I thnik atftpd on the other. Anyway, it's not important right now, I just mention it as a somewhat interesting detail.
Good to know that common bootloaders can use http too. Might actually make future deployments much easier.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum