diff --git a/configs/debian/bookworm_server.json b/configs/debian/bookworm_server.json index 90fbe18..5efb666 100644 --- a/configs/debian/bookworm_server.json +++ b/configs/debian/bookworm_server.json @@ -6,11 +6,13 @@ "repositories": [], "replace_repositories": "False", "keyrings": [], - "packages": "nginx grub-pc linux-image-amd64 live-task-standard", + "packages": "nginx grub-pc linux-image-amd64 live-task-standard python3.11-venv", "scripts": [ "configs/scripts/install.sh", "configs/scripts/server.sh" ], "package_manager": "apt", - "extra_files": [] + "extra_files": [ + "downloads/deployment.tar.gz" + ] } \ No newline at end of file diff --git a/configs/scripts/server.sh b/configs/scripts/server.sh index 58ef193..c25e553 100755 --- a/configs/scripts/server.sh +++ b/configs/scripts/server.sh @@ -20,4 +20,10 @@ while true; do if [ $? -eq 0 ]; then break fi -done \ No newline at end of file +done + +rm /mnt/etc/nginx/sites-enabled/default +tar -xzf deployment.tar.gz -C '/mnt/root' +chroot /mnt /bin/bash -c "./root/jet-search/deploy/setup.sh" + +read a diff --git a/main.py b/main.py index ab0dd67..a9355c8 100755 --- a/main.py +++ b/main.py @@ -95,14 +95,14 @@ def rootfs_package(identifier, scripts, extra_files): command(f"echo './{result}' | sudo tee -a '{chroot}/root/.profile'") command(f"echo './{result}' | sudo tee -a '{chroot}/root/.bashrc'") - for extra_file in extra_files: - command(f"sudo cp '{extra_file}' '{chroot}'") - command(f"echo 'umount -R /mnt' | sudo tee -a '{chroot}/root/.profile'") command(f"echo 'umount -R /mnt' | sudo tee -a '{chroot}/root/.bashrc'") command(f"echo 'reboot' | sudo tee -a '{chroot}/root/.profile'") command(f"echo 'reboot' | sudo tee -a '{chroot}/root/.bashrc'") + for extra_file in extra_files: + command(f"sudo cp '{extra_file}' '{chroot}/root'") + if shutil.which("grub-mkrescue"): command(f"sudo grub-mkrescue -o '{outfile}' '{chroot}'") elif shutil.which("grub2-mkrescue"):