diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-23 11:46:32 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-23 11:46:32 +0100 |
commit | dd898c9f3388fca1d7339a45150fbb7406de0971 (patch) | |
tree | f9f498c9d86c26bd208acc687c5f29b451927ce3 /util-linux/switch_root.c | |
parent | e5dd71f94f8691c41382b89de35088695cca34b9 (diff) | |
download | busybox-w32-dd898c9f3388fca1d7339a45150fbb7406de0971.tar.gz busybox-w32-dd898c9f3388fca1d7339a45150fbb7406de0971.tar.bz2 busybox-w32-dd898c9f3388fca1d7339a45150fbb7406de0971.zip |
Convert all util-linux/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/switch_root.c')
-rw-r--r-- | util-linux/switch_root.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c index 7960b672c..6034485d7 100644 --- a/util-linux/switch_root.c +++ b/util-linux/switch_root.c | |||
@@ -5,6 +5,29 @@ | |||
5 | * | 5 | * |
6 | * Licensed under GPLv2, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2, see file LICENSE in this source tree. |
7 | */ | 7 | */ |
8 | //config:config SWITCH_ROOT | ||
9 | //config: bool "switch_root" | ||
10 | //config: default y | ||
11 | //config: select PLATFORM_LINUX | ||
12 | //config: help | ||
13 | //config: The switch_root 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. (Stop reading here if you don't care why.) | ||
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: switch_root 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: * Because the Linux kernel uses rootfs internally as the starting | ||
25 | //config: and ending point for searching through the kernel's doubly linked | ||
26 | //config: list of active mount points. That's why. | ||
27 | |||
28 | //applet:IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) | ||
29 | |||
30 | //kbuild:lib-$(CONFIG_SWITCH_ROOT) += switch_root.o | ||
8 | 31 | ||
9 | //usage:#define switch_root_trivial_usage | 32 | //usage:#define switch_root_trivial_usage |
10 | //usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]" | 33 | //usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]" |