diff --git a/main.py b/main.py index f850b14..232e041 100755 --- a/main.py +++ b/main.py @@ -189,13 +189,6 @@ def apt_rootfs_prepare( do_chroot_command(f"echo '{repository}' >/etc/apt/sources.list") overwritten + True - for preinstall_script in preinstall_scripts: - command(f"sudo mv {preinstall_script} {chroot}/root") - do_chroot_command(f"cd root && ./{preinstall_script}") - - if create_ca: - command(f"sudo cp {chroot}/etc/ssl/certs/ca.crt {output}") - for extra_file in extra_files: command(f"sudo cp '{extra_file}' '{chroot}/root'") @@ -203,6 +196,14 @@ def apt_rootfs_prepare( do_chroot_command("apt full-upgrade -y") do_chroot_command(f"DEBIAN_FRONTEND=noninteractive apt install -y {packages}") do_chroot_command("echo 'localmachine' > /etc/hostname") + + for preinstall_script in preinstall_scripts: + command(f"sudo mv {preinstall_script} {chroot}/root") + do_chroot_command(f"cd root && ./{preinstall_script}") + + if create_ca: + command(f"sudo cp {chroot}/etc/ssl/certs/ca.crt {output}") + close_chroot() rootfs_creator(f"{identifier}.tar.gz") rootfs_package(f"{output}{identifier}", scripts, extra_files)