git: initrd: Detach from the world and build on the fly
Aaron LI
aly at crater.dragonflybsd.org
Fri Jun 8 01:03:09 PDT 2018
commit e79a303f7db7331d570bb6c6abdd555eeefdcdc2
Author: Aaron LI <aly at aaronly.me>
Date: Sat Jun 2 13:31:45 2018 +0800
initrd: Detach from the world and build on the fly
Why
---
Currently, the files for initrd image creation are built and installed at
/usr/share/initrd by "buildworld" and "installworld", respectively, and then
mkinitrd(8) simply packs them to create the initrd.img.gz.
For normal users, the shipped /usr/share/initrd and mkinitrd(8) don't make
much sense, since they don't need to modify the initrd contents and create
a modified initrd image.
From a developer's perspective, the required steps (buildworld, installworld
and mkinitrd) to create and test a new initrd image can be annoying.
How
---
Detach the build and installation of the initrd contents from the world.
Build the (rescue/initrd) tools on-the-fly when creating the initrd image.
As per ftigeot's suggestion, these statically linked tools can be useful when
dealing with a broken system, so install them under /rescue to be more
intuitive and easier to use (similar to FreeBSD and maybe other BSDs).
What
----
* Move "share/initrd" to be top-level, and detach it from world.
+ Update the patch in bsd.crunchgen.mk accordingly.
+ Add Makefile.inc to simplify subdir's makefiles.
+ Rewrite the Makefile with targets:
- rescue: build and install the rescue tools into /rescue.
- initrd: further packs the etc and rescue staffs to create the initrd
image.
* Move "sbin/mkinitrd/mkinitrd.sh" under the new "initrd" directory and adapt
it to work with the "initrd" make target. Remove the other parts of
mkinitrd(8).
* Export the above "rescue" and "initrd" targets to be top-level.
* Update nrelease framework to use the new "make initrd".
* Update build.7 man page accordingly.
* Print the message about updating the initrd image and 3rd-party packages
after "make upgrade" instead of "make installworld".
* Document this change in UPDATING.
* Other small updates and style cleanups.
TODO
----
* Add initrd.7 man page
* Crunch more useful tools
* Crunch bin/sbin/etc. into a bundle to save space (??)
Reviewed-by: swildner
Thanks-to: dillon, swildner, ftigeot
Summary of changes:
Makefile | 33 ++-
Makefile.inc1 | 11 -
Makefile_upgrade.inc | 5 +
README | 3 +
UPDATING | 8 +
etc/Makefile | 2 +-
etc/mtree/BSD.root.dist | 2 +
etc/mtree/BSD.usr.dist | 8 -
initrd/Makefile | 30 +++
initrd/Makefile.inc | 8 +
{share/initrd => initrd}/bin/Makefile | 5 -
{share/initrd => initrd}/bin/dowpa | 2 +-
initrd/etc/Makefile | 24 ++
{share/initrd => initrd}/etc/motd | 0
{share/initrd => initrd}/etc/rc | 0
{share/initrd => initrd}/etc/rc.lvm2 | 0
{share/initrd => initrd}/etc/rcmount_crypt | 0
{share/initrd => initrd}/etc/rcmount_tcplay | 0
initrd/mkinitrd.sh | 295 +++++++++++++++++++++
{share/initrd/mini_init => initrd/oinit}/Makefile | 5 -
{share/initrd/mini_init => initrd/oinit}/oinit.c | 10 +-
.../initrd/mini_init => initrd/oinit}/pathnames.h | 3 +-
{share/initrd => initrd}/sbin.libcrypto/Makefile | 7 +-
{share/initrd => initrd}/sbin.lvm/Makefile | 9 +-
{share/initrd => initrd}/sbin/Makefile | 7 +-
nrelease/Makefile | 20 +-
sbin/Makefile | 1 -
sbin/mkinitrd/Makefile | 5 -
sbin/mkinitrd/mkinitrd.8 | 189 -------------
sbin/mkinitrd/mkinitrd.sh | 240 -----------------
share/Makefile | 27 +-
share/initrd/Makefile | 3 -
share/initrd/etc/Makefile | 33 ---
share/man/man7/build.7 | 17 +-
share/mk/bsd.crunchgen.mk | 2 +-
35 files changed, 453 insertions(+), 561 deletions(-)
create mode 100644 initrd/Makefile
create mode 100644 initrd/Makefile.inc
rename {share/initrd => initrd}/bin/Makefile (95%)
rename {share/initrd => initrd}/bin/dowpa (90%)
create mode 100644 initrd/etc/Makefile
rename {share/initrd => initrd}/etc/motd (100%)
rename {share/initrd => initrd}/etc/rc (100%)
rename {share/initrd => initrd}/etc/rc.lvm2 (100%)
rename {share/initrd => initrd}/etc/rcmount_crypt (100%)
rename {share/initrd => initrd}/etc/rcmount_tcplay (100%)
create mode 100755 initrd/mkinitrd.sh
rename {share/initrd/mini_init => initrd/oinit}/Makefile (57%)
rename {share/initrd/mini_init => initrd/oinit}/oinit.c (96%)
rename {share/initrd/mini_init => initrd/oinit}/pathnames.h (96%)
rename {share/initrd => initrd}/sbin.libcrypto/Makefile (87%)
rename {share/initrd => initrd}/sbin.lvm/Makefile (96%)
rename {share/initrd => initrd}/sbin/Makefile (91%)
delete mode 100644 sbin/mkinitrd/Makefile
delete mode 100644 sbin/mkinitrd/mkinitrd.8
delete mode 100644 sbin/mkinitrd/mkinitrd.sh
delete mode 100644 share/initrd/Makefile
delete mode 100644 share/initrd/etc/Makefile
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e79a303f7db7331d570bb6c6abdd555eeefdcdc2
--
DragonFly BSD source repository
More information about the Commits
mailing list