* Documentation/initrd.txt update
@ 2006-07-03 16:50 Guilherme Destefani
2006-07-03 20:24 ` H. Peter Anvin
0 siblings, 1 reply; 2+ messages in thread
From: Guilherme Destefani @ 2006-07-03 16:50 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 257 bytes --]
The cpio initrd isn't documented in
linux-2.6.17/Documentation/initrd.txt.
(but it is in
linux-2.6.17/Documentation/filesystems/ramfs-rootfs-initramfs.txt)
initrd.txt shouldn't be updated?
Two possible updates follow, use patch -p1 inside the kernel tree.
[-- Attachment #2: Type: text/x-patch, Size: 854 bytes --]
--- linux-2.6.17.old/Documentation/initrd.txt 2006-06-17 22:49:35.000000000 -0300
+++ linux-2.6.17/Documentation/initrd.txt 2006-07-03 13:29:00.000000000 -0300
@@ -104,11 +104,13 @@
Third, you have to create the RAM disk image. This is done by creating a
file system on a block device, copying files to it as needed, and then
copying the content of the block device to the initrd file. With recent
-kernels, at least three types of devices are suitable for that:
+kernels, at least four types of devices are suitable for that:
- a floppy disk (works everywhere but it's painfully slow)
- a RAM disk (fast, but allocates physical memory)
- a loopback device (the most elegant solution)
+ - a cpio containing the initrd files, described in
+ Documentation/filesystems/ramfs-rootfs-initramfs.txt
We'll describe the loopback device method:
[-- Attachment #3: Type: text/x-patch, Size: 1146 bytes --]
--- linux-2.6.17.old/Documentation/initrd.txt 2006-07-03 13:25:35.000000000 -0300
+++ linux-2.6.17/Documentation/initrd.txt 2006-07-03 13:39:54.000000000 -0300
@@ -140,6 +140,25 @@
compressed
# gzip -9 initrd
+It is also possible to use a cpio archive (instead of a file system),
+and pack all the files inside it.
+The kernel will create a ramdisk, unpack the contents of the initrd
+ and execute /init.
+
+To create such a file:
+
+ 1) Enter the directory containig the unpacked initrd files:
+ # cd /path/to/initrd
+ 2) Create the cpio file (whithout any leading path).
+ 3) Create a cpio file.
+ 4) Compress it with gzip to save space.
+ steps 2,3 and 4 can be archieved with:
+ find -printf "%P\n" |cpio -oc | gzip -9 > /full_path_to/initrd.img
+ |-------step 2------|-step 3--|------------step 4-----------------|
+
+Or use usr/gen_init_cpio
+(see Documentation/filesystems/ramfs-rootfs-initramfs.txt)
+
For experimenting with initrd, you may want to take a rescue floppy and
only add a symbolic link from /linuxrc to /bin/sh. Alternatively, you
can try the experimental newlib environment [2] to create a small
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Documentation/initrd.txt update
2006-07-03 16:50 Documentation/initrd.txt update Guilherme Destefani
@ 2006-07-03 20:24 ` H. Peter Anvin
0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2006-07-03 20:24 UTC (permalink / raw)
To: linux-kernel, guilhermedestefani
Guilherme Destefani wrote:
> The cpio initrd isn't documented in
> linux-2.6.17/Documentation/initrd.txt.
> (but it is in
> linux-2.6.17/Documentation/filesystems/ramfs-rootfs-initramfs.txt)
> initrd.txt shouldn't be updated?
>
> Two possible updates follow, use patch -p1 inside the kernel tree.
... and both are wrong.
initramfs != initrd, plus you specified -c to cpio, which is wrong (-H
newc is correct).
You have to account for the differences between initramfs and initrd,
e.g. no pivot_root in initramfs.
-hpa
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-07-03 20:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-03 16:50 Documentation/initrd.txt update Guilherme Destefani
2006-07-03 20:24 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox