diff --git a/vanilla_installer/utils/processor.py b/vanilla_installer/utils/processor.py index b8b43da1..8d1b25cb 100644 --- a/vanilla_installer/utils/processor.py +++ b/vanilla_installer/utils/processor.py @@ -618,7 +618,6 @@ def gen_install_recipe(log_path, finals, sys_recipe): "mkdir /.system/boot/init/vos-a", "mkdir /.system/boot/init/vos-b", "mv /.system/boot/vmlinuz* /.system/boot/init/vos-a", - "mv /.system/boot/initrd* /.system/boot/init/vos-a", ], chroot=True, ) @@ -656,7 +655,6 @@ def gen_install_recipe(log_path, finals, sys_recipe): "mv /var/storage /var/lib/abroot/", "mount -o bind /var/home /home", "mount -o bind /var/opt /opt", - "mount -o bind,ro /.system/usr /usr", ], chroot=True, ) @@ -725,6 +723,24 @@ def gen_install_recipe(log_path, finals, sys_recipe): chroot=True, ) + # Set up initramfs after all configuration is done + # Need to mount boot for initramfs generated + # Need to unmount afterwards to access init partition + recipe.add_postinstall_step( + "shell", + [ + f"mount {boot_part} /boot", + f"mount {efi_part} /boot/efi", + "update-initramfs -c -k all", + "mkdir /var/tmp/vanilla-generated-initrd", + "cp -a /boot/initrd* /var/tmp/vanilla-generated-initrd/", + "umount -l /boot/efi", + "umount -l /boot", + "mv /var/tmp/vanilla-generated-initrd/initrd* /.system/boot/init/vos-a", + ], + chroot=True, + ) + recipe.merge_postinstall_steps() if "VANILLA_FAKE" in os.environ: