Merge a squashFS and a initrd into one single file (PXE booting)

0

I have a initrd and a cloop (squashFS). Which is the simplest way, to merge those 2 files into one single initrd file, for the purpose of PXE-booting the whole image at once without any bootstrapping process?

Of course, it will be a live Linux system so it SHOULD be read-only. Size limitations does not matter since the target system does have plenty of ram and the network it will boot over is fast.

sebastian nielsen

Posted 2014-10-22T11:49:22.723

Reputation: 961

Answers

0

What you are trying to do is not a good approach; it will force a surely too big TFTP transfer.

It is better if you mod the initrd in order to turn on the SAMBA/NFS client or even using wget for an HTTP transfer that will bring at boot time your squashfs file.

You can see how this approach is used by Serva (I'm related to Serva development) when PXE booting/installing most of the live distros available today.

http://vercot.com/~serva/an/NonWindowsPXE3.html

you do not need to assembly a completely new initrd just create a complementary one adding the missing components (if any) and the correspondingly updated init script.

Pat

Posted 2014-10-22T11:49:22.723

Reputation: 2 593

I understand that it will do a big TFTP transfer, but I would rather have that instead of a 2 step process. The reason is that there is a authentication process in the loop Before the PXE goes off. Its possible to auhenticate the TFTP image so only authorized computers or users can get it, but its not possible to pass the authentication details to the HTTP get without heavly modifying the TFTP server or uploading one image per user and computer. Thus I want to do Everything in single step. – sebastian nielsen – 2014-10-22T16:27:35.343

If the TFTP transfer gets big (>~800Mb ) depending on your net conditions you are going to have problems. It doesn't matter that you can do everything in a single authentication step if the TFTP transfers frequently abort. Trust me; your design from a PXE point of view is not good. – Pat – 2014-10-22T19:15:04.083

Its not 800mb. Its a smaller image, like 200-300mb. – sebastian nielsen – 2014-10-22T21:35:46.197

then you'll do "OK", just create a complementary initrd containing the squashfs file and consecutively load it after the main initrd, in the "append" line (see how Serva does it). – Pat – 2014-10-22T21:42:26.230

Then the PXE client wont pass authentication on the second step either. If you look on DSL, they have a initrd that contains EVERYTHING needed to start the whole system including desktop, in one single file. (dsl-4.4.10-initrd.iso), where the whole filesystem is inside a initrd called minirt24. – sebastian nielsen – 2014-10-22T21:59:51.397

there's not second step; just only 2 TFTP transfers 2 initrd. if you do not like the 2 initrd approach go for 1 initrd. Have fun altering the init script. Your authentication system is a mess; what you are trying to do it is a mess. – Pat – 2014-10-23T07:11:27.467

iPXE (http://ipxe.org) is an NPB with http support, no more need for slow tftp transfers, other then the initial load of ipxe.

– NiKiZe – 2015-05-30T21:47:26.417

iPXE is not standard, it is highly buggy and it has only partial UEFI support; not really a good option. – Pat – 2015-05-30T21:54:34.170