initrd: Rework build and install stages
authorAaron LI <aly@aaronly.me>
Sat, 24 Nov 2018 10:52:03 +0000 (18:52 +0800)
committerAaron LI <aly@aaronly.me>
Sun, 25 Nov 2018 13:41:36 +0000 (21:41 +0800)
commitbc897c50d49f0df1bf5eea38a4a7d904c2e92795
tree386299916671e913b28c705f515937b1c7652b94
parentd8cf6a8bb651fa37ca9cf97613eaa9618043e3de
initrd: Rework build and install stages

* Rewrite the Makefile to provide only the 'all' and 'install' targets.
  Do not separate the handling of the rescue tools and initrd image.
  Thus greatly simplify the whole logic.

  The 'all' target will build the rescue tools and initrd contents, and
  does not require root priviledge, while the 'install' target will
  install the rescue tools to the system, create the initrd image and
  install it.

* Update the top-level makefiles to call the new 'all' and 'install'.
  The 'buildworld' target now doesn't require root priviledge, same as
  before the refactoring in 9b724c0dcb2b9548a82d28d97e34375f64668669.

* Only provide the 'initrd' top-level target to keep it simple.  This
  target will install the rescue tools and initrd image built by the
  'buildworld', overwriting the existing ones.

* Clean up the nrelease/Makefile a bit, since 'installworld' will also
  install the rescue tools and initrd image in such a case.

* Update the mkinitrd.sh script a bit.

* Update the build(7) man page and clean up a bit.

Reviewed-by: swildner
Makefile
Makefile.inc1
initrd/Makefile
initrd/mkinitrd.sh
nrelease/Makefile
share/man/man7/build.7