From b1dc0b200995e39c4f5bde05a18f98df40d4f931 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 7 Jul 2024 20:04:05 +0200 Subject: [PATCH] Refactor installation functions --- profiles/DerGeret/Arch/install.sh | 13 ++++++++--- profiles/DerGeret/Arch/scripts/drivers.sh | 7 ------ profiles/ManuSurface/Arch/install.sh | 23 +++++++++++++++----- profiles/ManuSurface/Arch/scripts/config.sh | 9 -------- profiles/ManuSurface/Arch/scripts/drivers.sh | 5 ----- scripts/Arch/OS/install.sh | 7 +++--- 6 files changed, 32 insertions(+), 32 deletions(-) delete mode 100755 profiles/DerGeret/Arch/scripts/drivers.sh delete mode 100755 profiles/ManuSurface/Arch/scripts/config.sh delete mode 100755 profiles/ManuSurface/Arch/scripts/drivers.sh diff --git a/profiles/DerGeret/Arch/install.sh b/profiles/DerGeret/Arch/install.sh index 4d47a009..372e8a4f 100755 --- a/profiles/DerGeret/Arch/install.sh +++ b/profiles/DerGeret/Arch/install.sh @@ -1,8 +1,15 @@ #!/bin/bash -e function install() { - local dir="$(realpath "${BASH_SOURCE%/*}")"; - alias installDrivers=". ${dir@Q}/scripts/drivers.sh"; - alias initializeConfig=". ${dir@Q}/../../../scripts/Unix/Devices/Logitech G903/install.sh"; + function installDrivers() { + . "../../../scripts/Arch/Config/SecureBoot/install.sh"; + . "../../../scripts/Arch/Software/nvidia-dkms/install.sh"; + . "../../../scripts/Arch/Software/xone/install.sh"; + . "../../../scripts/Arch/Software/bt-dualboot/install.sh"; + } + + function initializeConfig() { + . "../../../scripts/Unix/Devices/Logitech G903/install.sh"; + } pushd "$dir" > /dev/null; . "../../../scripts/Arch/OS/install.sh"; diff --git a/profiles/DerGeret/Arch/scripts/drivers.sh b/profiles/DerGeret/Arch/scripts/drivers.sh deleted file mode 100755 index c26f9c34..00000000 --- a/profiles/DerGeret/Arch/scripts/drivers.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -pushd "${BASH_SOURCE%/*}" > /dev/null; -. "$dir/../../../scripts/Arch/Config/SecureBoot/install.sh"; -. "$dir/../../../scripts/Arch/Software/nvidia-dkms/install.sh"; -. "$dir/../../../scripts/Arch/Software/xone/install.sh"; -. "$dir/../../../scripts/Arch/Software/bt-dualboot/install.sh"; -popd > /dev/null; diff --git a/profiles/ManuSurface/Arch/install.sh b/profiles/ManuSurface/Arch/install.sh index 8147309e..cdfb95dd 100755 --- a/profiles/ManuSurface/Arch/install.sh +++ b/profiles/ManuSurface/Arch/install.sh @@ -1,11 +1,24 @@ #!/bin/bash -e function install() { - local dir="$(realpath "${BASH_SOURCE%/*}")"; - alias installDrivers=". ${dir@Q}/scripts/drivers.sh"; - alias installSoftware=". ${dir@Q}/../../../scripts/Arch/Collections/school.sh"; - alias initializeConfig=". ${dir@Q}/scripts/config.sh"; + function installDrivers() { + . "../../../scripts/Arch/Config/SecureBoot/install.sh"; + . "../../../scripts/Arch/Drivers/SurfaceBook2/install.sh"; + } - pushd "$dir" > /dev/null; + function installSoftware() { + . "../../../scripts/Arch/Collections/school.sh"; + } + + function initializeConfig() { + . "../../../scripts/Common/Config/Steam/hidpi.sh"; + . "../../../scripts/Unix/Devices/Surface Book 2/install.sh"; + . "../../../scripts/Unix/Devices/Logitech G903/install.sh"; + + # Because, as it looks, Surface Books are fucking stupid. + . "../../../scripts/Common/Config/GRUB/verbose.sh"; + } + + pushd "${BASH_SOURCE%/*}" > /dev/null; . "../../../scripts/Arch/OS/install.sh"; popd > /dev/null; } diff --git a/profiles/ManuSurface/Arch/scripts/config.sh b/profiles/ManuSurface/Arch/scripts/config.sh deleted file mode 100755 index ead3643e..00000000 --- a/profiles/ManuSurface/Arch/scripts/config.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -pushd "${BASH_SOURCE%/*}" > /dev/null; -. "../../../scripts/Common/Config/Steam/hidpi.sh"; -. "../../../scripts/Unix/Devices/Surface Book 2/install.sh"; -. "../../../scripts/Unix/Devices/Logitech G903/install.sh"; - -# Because, as it looks, Surface Books are fucking stupid. -. "$dir/../../../scripts/Common/Config/GRUB/verbose.sh"; -popd > /dev/null; diff --git a/profiles/ManuSurface/Arch/scripts/drivers.sh b/profiles/ManuSurface/Arch/scripts/drivers.sh deleted file mode 100755 index dc55de2f..00000000 --- a/profiles/ManuSurface/Arch/scripts/drivers.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -pushd "${BASH_SOURCE%/*}" > /dev/null; -. "../../../scripts/Arch/Config/SecureBoot/install.sh"; -. "../../../scripts/Arch/Drivers/SurfaceBook2/install.sh"; -popd > /dev/null; diff --git a/scripts/Arch/OS/install.sh b/scripts/Arch/OS/install.sh index 813beab5..e504beb1 100755 --- a/scripts/Arch/OS/install.sh +++ b/scripts/Arch/OS/install.sh @@ -1,9 +1,10 @@ #!/bin/bash -e rootDir="${BASH_SOURCE%/*}"; customPortValhallaSudoConfigFile="/etc/sudoers.d/1337_PortValhalla" -pushd "$rootDir" > /dev/null; +pushd "$rootDir" > /dev/null; . "../../Common/Scripts/hooks.sh"; +popd > /dev/null; function autoRoot() { { @@ -20,9 +21,11 @@ function defaultProfileSetup() { runHook initialize \ autoRoot; +pushd "$rootDir" > /dev/null; . "../Software/base-devel/install.sh"; . "../Config/pacman/install.sh"; . "../Software/yay/install.sh"; +popd > /dev/null; sudo pacman --noconfirm -Syu pacman-contrib; @@ -38,5 +41,3 @@ runHook initializeProfile \ runHook postInstall \ sudo rm "$customPortValhallaSudoConfigFile" /var/db/sudo/lectured/$UID; - -popd > /dev/null;