From a05e697db6e0ba646cc7ea52e9bbfaaf9ae63378 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 11 Nov 2024 17:30:12 +0100 Subject: [PATCH] changes and fixes. --- configs/debian/bookworm_gnome.json | 1 + configs/debian/bookworm_kde.json | 1 + configs/debian/bookworm_lxqt.json | 1 + configs/debian/bookworm_mate.json | 1 + configs/debian/bookworm_server.json | 1 + configs/debian/bookworm_xfce.json | 1 + configs/scripts/install.sh | 10 ++++------ configs/scripts/server.sh | 0 configs/scripts/user.sh | 0 configs/ubuntu/noble_gnome.json | 1 + configs/ubuntu/noble_kde.json | 1 + configs/ubuntu/noble_lxqt.json | 1 + configs/ubuntu/noble_mate.json | 1 + configs/ubuntu/noble_server.json | 1 + configs/ubuntu/noble_xfce.json | 1 + main.py | 8 ++++---- 16 files changed, 20 insertions(+), 10 deletions(-) mode change 100644 => 100755 configs/scripts/server.sh mode change 100644 => 100755 configs/scripts/user.sh diff --git a/configs/debian/bookworm_gnome.json b/configs/debian/bookworm_gnome.json index d0dc34b..fb21abf 100644 --- a/configs/debian/bookworm_gnome.json +++ b/configs/debian/bookworm_gnome.json @@ -5,6 +5,7 @@ "download_name": "bookworm", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-amd64 task-gnome-desktop live-task-standard", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/debian/bookworm_kde.json b/configs/debian/bookworm_kde.json index 6a45512..b7ff22b 100644 --- a/configs/debian/bookworm_kde.json +++ b/configs/debian/bookworm_kde.json @@ -5,6 +5,7 @@ "download_name": "bookworm", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-amd64 task-kde-desktop live-task-standard", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/debian/bookworm_lxqt.json b/configs/debian/bookworm_lxqt.json index 496ef34..e345277 100644 --- a/configs/debian/bookworm_lxqt.json +++ b/configs/debian/bookworm_lxqt.json @@ -5,6 +5,7 @@ "download_name": "bookworm", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-amd64 task-lxqt-desktop live-task-standard", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/debian/bookworm_mate.json b/configs/debian/bookworm_mate.json index 353826b..0150c1e 100644 --- a/configs/debian/bookworm_mate.json +++ b/configs/debian/bookworm_mate.json @@ -5,6 +5,7 @@ "download_name": "bookworm", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-amd64 task-mate-desktop live-task-standard", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/debian/bookworm_server.json b/configs/debian/bookworm_server.json index 93f6364..90fbe18 100644 --- a/configs/debian/bookworm_server.json +++ b/configs/debian/bookworm_server.json @@ -5,6 +5,7 @@ "download_name": "bookworm", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "nginx grub-pc linux-image-amd64 live-task-standard", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/debian/bookworm_xfce.json b/configs/debian/bookworm_xfce.json index d08de46..d24fe7c 100644 --- a/configs/debian/bookworm_xfce.json +++ b/configs/debian/bookworm_xfce.json @@ -5,6 +5,7 @@ "download_name": "bookworm", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-amd64 task-xfce-desktop live-task-standard", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/scripts/install.sh b/configs/scripts/install.sh index 6f015a9..21356d8 100755 --- a/configs/scripts/install.sh +++ b/configs/scripts/install.sh @@ -23,16 +23,14 @@ mount --bind /dev /mnt/dev mount --bind /proc /mnt/proc mount --bind /sys /mnt/sys -if chroot /mnt /bin/bash -c "command -v grub2-mkconfig &>/dev/null;" then +if chroot /mnt /bin/bash -c "command -v grub2-mkconfig &>/dev/null"; then chroot /mnt /bin/bash -c "grub2-mkconfig -o /boot/grub/grub.cfg" -elif chroot /mnt /bin/bash -c "command -v grub-mkconfig &>/dev/null;" then +elif chroot /mnt /bin/bash -c "command -v grub-mkconfig &>/dev/null"; then chroot /mnt /bin/bash -c "grub-mkconfig -o /boot/grub/grub.cfg" fi -if chroot /mnt /bin/bash -c "command -v grub2-install &>/dev/null;" then +if chroot /mnt /bin/bash -c "command -v grub2-install &>/dev/null"; then chroot /mnt /bin/bash -c "grub2-install /dev/sda" -elif chroot /mnt /bin/bash -c "command -v grub-install &>/dev/null;" then +elif chroot /mnt /bin/bash -c "command -v grub-install &>/dev/null"; then chroot /mnt /bin/bash -c "grub-install /dev/sda" fi - - diff --git a/configs/scripts/server.sh b/configs/scripts/server.sh old mode 100644 new mode 100755 diff --git a/configs/scripts/user.sh b/configs/scripts/user.sh old mode 100644 new mode 100755 diff --git a/configs/ubuntu/noble_gnome.json b/configs/ubuntu/noble_gnome.json index cdfeb3d..2fda94e 100644 --- a/configs/ubuntu/noble_gnome.json +++ b/configs/ubuntu/noble_gnome.json @@ -5,6 +5,7 @@ "download_name": "noble-base-amd64.tar.gz", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-generic ubuntu-desktop", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/ubuntu/noble_kde.json b/configs/ubuntu/noble_kde.json index bb355aa..9032da8 100644 --- a/configs/ubuntu/noble_kde.json +++ b/configs/ubuntu/noble_kde.json @@ -5,6 +5,7 @@ "download_name": "noble-base-amd64.tar.gz", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-generic kubuntu-desktop", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/ubuntu/noble_lxqt.json b/configs/ubuntu/noble_lxqt.json index 649ae12..99fd26e 100644 --- a/configs/ubuntu/noble_lxqt.json +++ b/configs/ubuntu/noble_lxqt.json @@ -5,6 +5,7 @@ "download_name": "noble-base-amd64.tar.gz", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-generic lubuntu-desktop", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/ubuntu/noble_mate.json b/configs/ubuntu/noble_mate.json index 32d5b69..7545b06 100644 --- a/configs/ubuntu/noble_mate.json +++ b/configs/ubuntu/noble_mate.json @@ -5,6 +5,7 @@ "download_name": "noble-base-amd64.tar.gz", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-generic ubuntu-mate-desktop", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/ubuntu/noble_server.json b/configs/ubuntu/noble_server.json index eb85d68..ca92530 100644 --- a/configs/ubuntu/noble_server.json +++ b/configs/ubuntu/noble_server.json @@ -5,6 +5,7 @@ "download_name": "noble-base-amd64.tar.gz", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "nginx grub-pc linux-image-generic", "scripts": [ "configs/scripts/install.sh", diff --git a/configs/ubuntu/noble_xfce.json b/configs/ubuntu/noble_xfce.json index 0a00701..6517644 100644 --- a/configs/ubuntu/noble_xfce.json +++ b/configs/ubuntu/noble_xfce.json @@ -5,6 +5,7 @@ "download_name": "noble-base-amd64.tar.gz", "repositories": [], "replace_repositories": "False", + "keyrings": [], "packages": "grub-pc linux-image-generic xubuntu-desktop", "scripts": [ "configs/scripts/install.sh", diff --git a/main.py b/main.py index 3b7ceed..ab0dd67 100755 --- a/main.py +++ b/main.py @@ -177,10 +177,10 @@ def apt_rootfs_prepare( do_chroot_command(f"echo '{repository}' >/etc/apt/sources.list") overwritten + True - for download, name in keyrings: - do_chroot_command(f"wget {download}") - do_chroot_command(f"dpkg -i {name}") - do_chroot_command(f"rm {name}") + for keyring in keyrings: + do_chroot_command(f"wget {keyring["download"]}") + do_chroot_command(f"dpkg -i {keyring["name"]}") + do_chroot_command(f"rm {keyring["name"]}") do_chroot_command("apt update -y") do_chroot_command("apt full-upgrade -y")