From 2c519bb51b5e39d02c0f1da69ce7938fef42e92b Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 29 Oct 2024 09:56:53 +0100 Subject: [PATCH] Improve calamares configuration --- calamares/modules/bootloader/bootloader.conf | 17 ++++++++++ calamares/modules/mount/mount.conf | 19 +++++++++++ .../modules/shellprocess/shell_chroot.conf | 12 ++++++- .../shellprocess/shell_chroot_copy.conf | 11 ++++++ .../modules/shellprocess/shell_nonchroot.conf | 10 +++++- .../shellprocess/shell_nonchroot_copy.conf | 9 +++++ calamares/modules/users/users.conf | 34 +++++++++++++++++++ calamares/settings.conf | 2 +- openGnsys-installer.sh | 11 ++++-- 9 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 calamares/modules/bootloader/bootloader.conf create mode 100644 calamares/modules/mount/mount.conf mode change 120000 => 100644 calamares/modules/shellprocess/shell_chroot.conf create mode 100644 calamares/modules/shellprocess/shell_chroot_copy.conf mode change 120000 => 100644 calamares/modules/shellprocess/shell_nonchroot.conf create mode 100644 calamares/modules/shellprocess/shell_nonchroot_copy.conf create mode 100644 calamares/modules/users/users.conf diff --git a/calamares/modules/bootloader/bootloader.conf b/calamares/modules/bootloader/bootloader.conf new file mode 100644 index 0000000..a046392 --- /dev/null +++ b/calamares/modules/bootloader/bootloader.conf @@ -0,0 +1,17 @@ +--- +efiBootLoader: "grub" +kernelSearchPath: "/boot/" +kernelInstallPath: "/boot/" +kernelPattern: "^vmlinuz.*" +loaderEntries: + - "timeout 5" + - "console-mode keep" + +kernelParams: [ "quiet" ] + +grubInstall: "grub-install" +grubMkconfig: "grub-mkconfig" +grubCfg: "/boot/grub/grub.cfg" +grubProbe: "grub-probe" +efiBootMgr: "efibootmgr" + diff --git a/calamares/modules/mount/mount.conf b/calamares/modules/mount/mount.conf new file mode 100644 index 0000000..b1c36f5 --- /dev/null +++ b/calamares/modules/mount/mount.conf @@ -0,0 +1,19 @@ +--- +extraMounts: + - device: proc + fs: proc + mountPoint: /proc + - device: sys + fs: sysfs + mountPoint: /sys + - device: /dev + mountPoint: /dev + options: [ bind ] + - device: tmpfs + fs: tmpfs + mountPoint: /run + - device: /run/dev + mountPoint: /run/dev + options: [ bind ] + + diff --git a/calamares/modules/shellprocess/shell_chroot.conf b/calamares/modules/shellprocess/shell_chroot.conf deleted file mode 120000 index 9c2cd89..0000000 --- a/calamares/modules/shellprocess/shell_chroot.conf +++ /dev/null @@ -1 +0,0 @@ -../shell_chroot.conf \ No newline at end of file diff --git a/calamares/modules/shellprocess/shell_chroot.conf b/calamares/modules/shellprocess/shell_chroot.conf new file mode 100644 index 0000000..9cca214 --- /dev/null +++ b/calamares/modules/shellprocess/shell_chroot.conf @@ -0,0 +1,11 @@ +--- + +dontChroot: false +verbose: true +script: + - /opengnsys-installer/component-installer.sh +timeout: 600 +verbose: true + + + diff --git a/calamares/modules/shellprocess/shell_chroot_copy.conf b/calamares/modules/shellprocess/shell_chroot_copy.conf new file mode 100644 index 0000000..9cca214 --- /dev/null +++ b/calamares/modules/shellprocess/shell_chroot_copy.conf @@ -0,0 +1,11 @@ +--- + +dontChroot: false +verbose: true +script: + - /opengnsys-installer/component-installer.sh +timeout: 600 +verbose: true + + + diff --git a/calamares/modules/shellprocess/shell_nonchroot.conf b/calamares/modules/shellprocess/shell_nonchroot.conf deleted file mode 120000 index c36ce51..0000000 --- a/calamares/modules/shellprocess/shell_nonchroot.conf +++ /dev/null @@ -1 +0,0 @@ -../shell_nonchroot.conf \ No newline at end of file diff --git a/calamares/modules/shellprocess/shell_nonchroot.conf b/calamares/modules/shellprocess/shell_nonchroot.conf new file mode 100644 index 0000000..79a656f --- /dev/null +++ b/calamares/modules/shellprocess/shell_nonchroot.conf @@ -0,0 +1,9 @@ +--- + +dontChroot: true +verbose: true +script: + - mkdir -p ${ROOT}/opengnsys-installer + - cp /tmp/opengnsys-installer-configs/* ${ROOT}/opengnsys-installer + + diff --git a/calamares/modules/shellprocess/shell_nonchroot_copy.conf b/calamares/modules/shellprocess/shell_nonchroot_copy.conf new file mode 100644 index 0000000..79a656f --- /dev/null +++ b/calamares/modules/shellprocess/shell_nonchroot_copy.conf @@ -0,0 +1,9 @@ +--- + +dontChroot: true +verbose: true +script: + - mkdir -p ${ROOT}/opengnsys-installer + - cp /tmp/opengnsys-installer-configs/* ${ROOT}/opengnsys-installer + + diff --git a/calamares/modules/users/users.conf b/calamares/modules/users/users.conf new file mode 100644 index 0000000..7cac53e --- /dev/null +++ b/calamares/modules/users/users.conf @@ -0,0 +1,34 @@ +defaultGroups: + - name: users + system: true + - dip: + system: true + - plugdev: + system: true + - lxd: + system: true + - ogadmin: + + +sudoersGroup: ogadmin +setRootPassword: true +doReusePassword: true +passwordRequirements: + minLength: -1 # Password at least this many characters + maxLength: -1 # Password at most this many characters + libpwquality: + - minlen=0 + - minclass=0 + +user: + shell: /bin/bash + forbidden_names: [ root ] + home_permissions: "0700" + + +hostname: + location: EtcFile + writeHostsFile: true + template: "ogServer" + forbidden_names: [ localhost ] + diff --git a/calamares/settings.conf b/calamares/settings.conf index 0b970fc..9798062 100644 --- a/calamares/settings.conf +++ b/calamares/settings.conf @@ -41,7 +41,7 @@ sequence: - finished -branding: default +branding: opengnsys prompt-install: false dont-chroot: false oem-setup: false diff --git a/openGnsys-installer.sh b/openGnsys-installer.sh index 3474ed8..2b8ce31 100644 --- a/openGnsys-installer.sh +++ b/openGnsys-installer.sh @@ -33,18 +33,23 @@ for component in $components; do "ogCore") config=$(yad --form --title="Configuración para $selected_component" \ --field="Usuario administrador":TEXT \ - --field="Contraseña":HIDE \ + --field="Contraseña":H \ + --field="Tag del contenedor":TEXT \ + "ogadmin" "" "main" \ --width=400 --height=200 --center) user=$(echo "$config" | cut -d '|' -f 1) password=$(echo "$config" | cut -d '|' -f 2) - echo "{\"username\": \"$user\", \"password\": \"$password\"}" > $CONFIGS_DIR/"$config_file" + container_tag=$(echo "$config" | cut -d '|' -f 3) + echo "{\"username\": \"$user\", \"password\": \"$password\", \"container_version\": \"$container_tag\" }" > $CONFIGS_DIR/"$config_file" ;; "ogGui") config=$(yad --form --title="Configuración para $selected_component" \ --field="IP del servidor de ogCore" \ + --field="Tag del contenedor":TEXT \ --width=400 --height=200 --center) ogcore_ip=$(echo "$config" | cut -d '|' -f 1) - echo "{\"ogcore_ip\": \"$ogcore_ip\"}" > $CONFIGS_DIR/"$config_file" + container_version=$(echo "$config" | cut -d '|' -f 2) + echo "{\"ogcore_ip\": \"$ogcore_ip\" , \"container_version\": \"$container_version\" }" > $CONFIGS_DIR/"$config_file" ;; "ogDhcp") config=$(yad --form --title="Configuración para $selected_component" \