From 200bcc851acbe1ba30fe90b5cf918f88370a5d15 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 21 Aug 2017 19:30:01 +0200 Subject: 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 --- klibc-utils/run-init.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 klibc-utils/run-init.c (limited to 'klibc-utils') diff --git a/klibc-utils/run-init.c b/klibc-utils/run-init.c new file mode 100644 index 0000000..a70d1bf --- /dev/null +++ b/klibc-utils/run-init.c @@ -0,0 +1,27 @@ +/* + * run-init implementation for busybox + * + * Copyright (c) 2017 Denys Vlasenko + * + * Licensed under GPLv2, see file LICENSE in this source tree. + */ +//config:config RUN_INIT +//config: bool "run-init" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The run-init utility is used from initramfs to select a new +//config: root device. Under initramfs, you have to use this instead of +//config: pivot_root. +//config: +//config: Booting with initramfs extracts a gzipped cpio archive into rootfs +//config: (which is a variant of ramfs/tmpfs). Because rootfs can't be moved +//config: or unmounted, pivot_root will not work from initramfs. Instead, +//config: run-init deletes everything out of rootfs (including itself), +//config: does a mount --move that overmounts rootfs with the new root, and +//config: then execs the specified init program. +//config: +//config: util-linux has a similar tool, switch-root. +//config: run-init differs by also having a "-d CAPS_TO_DROP" option. + +/* applet and kbuild hooks are in switch_root.c */ -- cgit v1.1