run-init.c 1.0 KB

1234567891011121314151617181920212223242526
  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 (7.7 kb)"
  10. //config: default y
  11. //config: help
  12. //config: The run-init utility is used from initramfs to select a new
  13. //config: root device. Under initramfs, you have to use this instead of
  14. //config: pivot_root.
  15. //config:
  16. //config: Booting with initramfs extracts a gzipped cpio archive into rootfs
  17. //config: (which is a variant of ramfs/tmpfs). Because rootfs can't be moved
  18. //config: or unmounted, pivot_root will not work from initramfs. Instead,
  19. //config: run-init deletes everything out of rootfs (including itself),
  20. //config: does a mount --move that overmounts rootfs with the new root, and
  21. //config: then execs the specified init program.
  22. //config:
  23. //config: util-linux has a similar tool, switch-root.
  24. //config: run-init differs by also having a "-d CAPS_TO_DROP" option.
  25. /* applet and kbuild hooks are in switch_root.c */