builder: build: bootstrap.py: add more filesystem stages

Signed-off-by: BigfootACA <bigfoot@classfun.cn>
This commit is contained in:
BigfootACA 2024-05-31 17:57:39 +08:00
parent 7e19eeddc5
commit be0624f947

View File

@ -88,6 +88,9 @@ def build_rootfs(ctx: ArchBuilderContext):
# initialize mount points for chroot # initialize mount points for chroot
mount.init_mount(ctx) mount.init_mount(ctx)
# running add files hooks (for build settings)
filesystem.add_files_all(ctx, "pre-build")
# initialize pacman context # initialize pacman context
pacman = pacman_comp.Pacman(ctx) pacman = pacman_comp.Pacman(ctx)
@ -103,9 +106,15 @@ def build_rootfs(ctx: ArchBuilderContext):
# install all keyring packages before other packages # install all keyring packages before other packages
pacman_build.proc_pacman_keyring(ctx, pacman) pacman_build.proc_pacman_keyring(ctx, pacman)
# running add files hooks (for pacman settings)
filesystem.add_files_all(ctx, "pre-pacman")
# real install all packages # real install all packages
pacman_build.proc_pacman(ctx, pacman) pacman_build.proc_pacman(ctx, pacman)
# running add files hooks (for user settings)
filesystem.add_files_all(ctx, "pre-user")
# reload user databases after install packages # reload user databases after install packages
ctx.reload_passwd() ctx.reload_passwd()
@ -124,6 +133,9 @@ def build_rootfs(ctx: ArchBuilderContext):
# setup system names (environments / hosts / hostname / machine-info) # setup system names (environments / hosts / hostname / machine-info)
names.proc_names(ctx) names.proc_names(ctx)
# running add files hooks (for initramfs settings)
filesystem.add_files_all(ctx, "pre-initramfs")
# recreate initramfs # recreate initramfs
mkinitcpio.proc_mkinitcpio(ctx) mkinitcpio.proc_mkinitcpio(ctx)
@ -139,6 +151,9 @@ def build_rootfs(ctx: ArchBuilderContext):
# cleanup unneeded files # cleanup unneeded files
cleanup(ctx) cleanup(ctx)
# running add files hooks (after build rootfs)
filesystem.add_files_all(ctx, "post-build")
# reload user database before create images # reload user database before create images
ctx.reload_passwd() ctx.reload_passwd()