Mailing List Archive

Linux kernel + initrd in one file
Hello,

I know this might be slightly off-topic, but I know at least hpa has an
intimate knowledge of the linux boot process - and I would want to use
it with syslinux/pxelinux, so I figure it might not hurt too much to
ask:

Is it possible to embedd the initrd with the linux kernel in a way
similiar to how it works on some embedded systems? There, you provide an
object file with the filesystem, and it's linked directly into the
kernel.

My usecase involves the systems being booted via PXE in all cases, and
the initrd holds the final root system. It would be good to be able to
have just this one file as firmware release binary (sort of).

What I figure which might be possible would be appending the initrd
binary directly to the kernel binary and patching the kernel header
during boot to point to it ... syslinux/pxelinux would need to be able
to detect the appendage and act accordingly - the kernel itself doesn't
appear to have to be modified, and this would solve my problem nicely.

Any ideas about this?

Thanks,

Andreas

--
"At the end of knowledge, wisdom begins, and at the end of wisdom, there is no
grief ... but hope."
-- Lloyd Alexander, 30.1.1924-17.5.2007

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: Linux kernel + initrd in one file [ In reply to ]
Andreas Kotes <count-linux@flatline.de> writes:

> Is it possible to embedd the initrd with the linux kernel in a way
> similiar to how it works on some embedded systems? There, you provide an
> object file with the filesystem, and it's linked directly into the
> kernel.

See Documentation/filesystems/ramfs-rootfs-initramfs.txt, especially
the 'Populating initramfs' section, which should answer you question.
--
Feri.

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: Linux kernel + initrd in one file [ In reply to ]
Hello Feri,

* Ferenc Wagner <wferi@niif.hu> [20070720 14:56]:
> Andreas Kotes <count-linux@flatline.de> writes:
>
> > Is it possible to embedd the initrd with the linux kernel in a way
> > similiar to how it works on some embedded systems? There, you provide an
> > object file with the filesystem, and it's linked directly into the
> > kernel.
>
> See Documentation/filesystems/ramfs-rootfs-initramfs.txt, especially
> the 'Populating initramfs' section, which should answer you question.

cool, thanks, good to know! :)

this is definitely an improvement - BUT forces me to rebuild (or at
least link) the kernel every time I change the cpio archive, right?

so, I'd still be interested in a possiblity to use an appended initrd
(which for me has the additional advantage of having the root filesystem
read only without the need to give extra parameters or change something
inside the kernel) .. plus, it would possibly work with stock
distribution kernels.

Thanks for the pointer and any other information! :)

Andreas

--
"At the end of knowledge, wisdom begins, and at the end of wisdom, there is no
grief ... but hope."
-- Lloyd Alexander, 30.1.1924-17.5.2007

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.