Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211976 - [patch] sys-kernel/genkernel-3.4.9: support for booting tarballs into a ramdisk
Summary: [patch] sys-kernel/genkernel-3.4.9: support for booting tarballs into a ramdisk
Status: IN_PROGRESS
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks: 245389
  Show dependency tree
 
Reported: 2008-03-01 14:08 UTC by Stefan Nickl
Modified: 2011-01-05 22:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Add tarball rootfs support (genkernel-image.patch,2.74 KB, patch)
2008-03-01 14:10 UTC, Stefan Nickl
Details | Diff
Updated patch for genkernel 3.4.10 (genkernel-image-3.4.10.patch,3.25 KB, patch)
2008-10-20 11:44 UTC, Stefan Nickl
Details | Diff
Bump to git version, untested (genkernel-image-3.4.11dev.patch,11.03 KB, patch)
2008-11-03 20:00 UTC, Stefan Nickl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Nickl 2008-03-01 14:08:41 UTC
The attached patch to generic/linuxrc adds another way to specify a root filesystem, for example "root=/dev/ram0 real_root=IMAGE=ftp://192.168.20.4/root_small.tgz".

This would fetch the given tarball by running wget (needs to be enabled in the busy-config files), and unpack it into a new tmpfs mounted on /newroot, which is then used as the root filesystem.

The advantage is that it allows for using rather big "ramdisks" in a very simple and quick fashion, and without touching the real initrd/initramfs. The big chunk is not downloaded by limited pxe code, but through the native linux drivers and TCP, so a 60MB image (130MB uncompressed) takes only 5 seconds or so.

My own use for it is mainly in hardware testing, but I can also imagine it being useful for diskless clusters.

Reproducible: Always
Comment 1 Stefan Nickl 2008-03-01 14:10:50 UTC
Created attachment 145003 [details, diff]
Add tarball rootfs support

The busybox wget applet should probably be enabled for all platforms if this is applied
Comment 2 Stefan Nickl 2008-10-20 11:44:08 UTC
Created attachment 169176 [details, diff]
Updated patch for genkernel 3.4.10

Update to latest genkernel, also adds tmprootsize option which is passed through to the size mount option of tmpfs.
Comment 3 Chris Gianelloni 2008-11-03 12:46:28 UTC
I apologize that this has taken so long, but genkernel development went on hiatus for a bit while we split off to our own development hosting.  Could you rebase the patch against the repository at git://git.wolf31o2.org/projs/genkernel.git instead?  We'll be using that to develop 3.4.11 and it's much easier to work with patches that apply cleanly into the repository.

Thanks
Comment 4 Stefan Nickl 2008-11-03 20:00:54 UTC
Created attachment 170648 [details, diff]
Bump to git version, untested
Comment 5 Andrew Gaffney (RETIRED) gentoo-dev 2008-11-04 02:28:31 UTC
I've committed the first half of this patch (the busy-config changes).

Is the tmprootsize=foo parameter really necessary? By default, a tmpfs's size is half of physical memory. I know that if you're dealing with a system with 32MB of RAM, that's not very much, but are you really using a genkernel-build kernel/initramfs on a system with 32MB RAM? :)

Also, what "formats" (123, 123k, 123m, etc.) does the 'size' parameter for a tmpfs take?
Comment 6 Stefan Nickl 2008-11-04 20:44:51 UTC
I actually added this parameter after trying to run my stuff on a board with just 1GB RAM instead of 8GB boards as before and needed a quick fix when the 512M had run out.

Stepping back I think I could do without it as there is a big chunk that is not part of the image itself, but loaded by the image later in the boot process, so the tmpfs could be resized before that chunk comes in.

In case you wonder, it's a diagnosis/upgrade image for the boards and the "big chunk" is mostly an FPGA update toolkit :)

The parameter didn't feel quite right to me either, and assuming that the above alternative works I won't miss it.

The size qualifiers are found in mount(8):

Mount options for tmpfs
       The following parameters accept a suffix k, m  or  g  for  Ki,  Mi,  Gi
       (binary kilo, mega and giga) and can be changed on remount.
Comment 7 Andrew Gaffney (RETIRED) gentoo-dev 2008-11-15 07:02:25 UTC
Before I commit this, have you boot-tested this with current git? Also, any reason that https can't be supported? The wget in busybox should work just fine with it.
Comment 8 Stefan Nickl 2008-11-19 17:46:30 UTC
Boot-test performed, worked nicely.

However I had some trouble since I usually use arguments like "console=tty0 console=ttyS0,115200n8" and output was dead after execution passed "# Redirect output to a specific tty"...

Seems like busybox wget doesn't support SSL. But OTOH I can hardly imagine a situation in which one would would like boot over a insecure network.
Comment 9 Sebastian Pipping gentoo-dev 2011-01-05 22:41:15 UTC
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bugs nature in searches...