aboutsummaryrefslogtreecommitdiff
path: root/klibc-utils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-21 19:30:01 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-21 19:30:01 +0200
commit200bcc851acbe1ba30fe90b5cf918f88370a5d15 (patch)
tree50f4d5ac42869548b78b00470d7b80b50a28157a /klibc-utils
parent44b3f2ffbc01c0a9fcfb5d60af3e292f505ac67c (diff)
downloadbusybox-w32-200bcc851acbe1ba30fe90b5cf918f88370a5d15.tar.gz
busybox-w32-200bcc851acbe1ba30fe90b5cf918f88370a5d15.tar.bz2
busybox-w32-200bcc851acbe1ba30fe90b5cf918f88370a5d15.zip
run-init: new applet
function old new delta switch_root_main 354 637 +283 drop_usermodehelper - 157 +157 cap_name_to_number - 77 +77 packed_usage 31707 31743 +36 applet_names 2665 2674 +9 applet_main 1544 1548 +4 applet_install_loc 193 194 +1 setpriv_main 933 928 -5 getcaps 131 122 -9 parse_cap 117 29 -88 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 5/3 up/down: 567/-102) Total: 465 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'klibc-utils')
-rw-r--r--klibc-utils/run-init.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/klibc-utils/run-init.c b/klibc-utils/run-init.c
new file mode 100644
index 000000000..a70d1bfbf
--- /dev/null
+++ b/klibc-utils/run-init.c
@@ -0,0 +1,27 @@
1/*
2 * run-init implementation for busybox
3 *
4 * Copyright (c) 2017 Denys Vlasenko <vda.linux@gmail.com>
5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */
8//config:config RUN_INIT
9//config: bool "run-init"
10//config: default y
11//config: select PLATFORM_LINUX
12//config: help
13//config: The run-init utility is used from initramfs to select a new
14//config: root device. Under initramfs, you have to use this instead of
15//config: pivot_root.
16//config:
17//config: Booting with initramfs extracts a gzipped cpio archive into rootfs
18//config: (which is a variant of ramfs/tmpfs). Because rootfs can't be moved
19//config: or unmounted, pivot_root will not work from initramfs. Instead,
20//config: run-init deletes everything out of rootfs (including itself),
21//config: does a mount --move that overmounts rootfs with the new root, and
22//config: then execs the specified init program.
23//config:
24//config: util-linux has a similar tool, switch-root.
25//config: run-init differs by also having a "-d CAPS_TO_DROP" option.
26
27/* applet and kbuild hooks are in switch_root.c */