Lines Matching +full:use +full:- +full:ram +full:- +full:code
1 .. SPDX-License-Identifier: GPL-2.0
12 --------------
16 RAM-based filesystem.
32 The amount of code required to implement ramfs is tiny, because all the
39 ------------------
41 The older "ram disk" mechanism created a synthetic block device out of
42 an area of RAM and used it as backing store for a filesystem. This block
44 size. Using a ram disk also required unnecessarily copying memory from the
54 since all file access goes through the page and dentry caches. The RAM
57 Another reason ramdisks are semi-obsolete is that the introduction of
63 ----------------
76 ---------------
80 same reason you can't kill the init process; rather than having special code
87 If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by
92 ------------------
100 archive is extracted into it, the kernel will fall through to the older code
106 - The old initrd was always a separate file, while the initramfs archive is
107 linked into the linux kernel image. (The directory ``linux-*/usr`` is
110 - The old initrd file was a gzipped filesystem image (in some file format,
113 see cpio(1) and Documentation/driver-api/early-userspace/buffer-format.rst).
114 The kernel's cpio extraction code is not only extremely small, it's also
117 - The program run by the old initrd (which was called /initrd, not /init) did
123 - When switching another root device, initrd would pivot_root and then
126 free up the space (find -xdev / -exec rm '{}' ';'), overmount rootfs
127 with the new root (cd /newmount; mount --move . /; chroot .), attach
136 ---------------------
166 a directory called "initramfs", under the linux-2.6.* directory. See
167 Documentation/driver-api/early-userspace/early_userspace_support.rst for more details.)
174 from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is
175 entirely self-contained, and the kernel's boot-time extractor is also
176 (obviously) self-contained.
185 cpio -i -d -H newc -F initramfs_data.cpio --no-absolute-filenames
188 use in place of the above config file::
195 if [ $# -ne 2 ]
201 if [ -d "$1" ]
204 (cd "$1"; find . | cpio -o -H newc | gzip) > "$2"
214 of filenames is with the find command; you should give find the -depth
223 --------------------------
232 non-GPL code you'd like to run from initramfs, without conflating it with
235 It can also be used to supplement the kernel's built-in initramfs image. The
237 the built-in initramfs archive. Some distributors also prefer to customize
238 a single kernel image with task-specific initramfs images, without recompiling.
241 ----------------------
243 An initramfs archive is a complete self-contained root filesystem for Linux.
248 - https://www.tldp.org/HOWTO/Bootdisk-HOWTO/
249 - https://www.tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html
250 - http://www.linuxfromscratch.org/lfs/view/stable/
254 code against, along with some related utilities. It is BSD licensed.
256 I use uClibc (https://www.uclibc.org) and busybox (https://www.busybox.net)
257 myself. These are LGPL and GPL, respectively. (A self-contained initramfs
260 In theory you could use glibc, but that's not well suited for small embedded
279 gcc -static hello.c -o init
280 echo init | cpio -o -H newc | gzip > test.cpio.gz
282 qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero
289 -------------------------
318 explained in buffer-format.txt, created in usr/gen_init_cpio.c, and
320 total of human-readable text.
338 - http://www.uwsg.iu.edu/hypermail/linux/kernel/0112.2/1550.html
339 - http://www.uwsg.iu.edu/hypermail/linux/kernel/0112.2/1638.html
341 and, most importantly, designed and implemented the initramfs code.
344 ------------------
347 kernel falls back to legacy boot code that is reached only if initramfs does
348 not contain an /init program. The fallback is legacy code, there to ensure a
358 compressed, encrypted, copy-on-write, loopback mounted, strangely partitioned,
365 The klibc package has now been accepted into Andrew Morton's 2.6.17-mm tree.
366 The kernel's current early boot code (partition detection, etc) will probably