diff options
| author | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
| commit | bb8d79eadbba1942dbdb9f9cee5c47833afe269f (patch) | |
| tree | b8c517e9ca895d60d7227aef7177b6291df5e2cd /util-linux/switch_root.c | |
| parent | 9fa1e4990e655a85025c9d270a1606983e375e47 (diff) | |
| parent | 7d877fc9312a742b06125927bb1d34bd35398c6c (diff) | |
| download | busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.gz busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.bz2 busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.zip | |
Merge branch 'busybox' into merge
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]" |
