From 87a25ce378d4956d2bf94dce779a76029e255939 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 25 Mar 2024 02:30:58 +0100 Subject: [PATCH] Implement partitioning using a function --- profiles/DerGeret/Arch/partition.sh | 54 +++++++++++++++-------------- profiles/DerGeret/Arch/setup.sh | 5 ++- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/profiles/DerGeret/Arch/partition.sh b/profiles/DerGeret/Arch/partition.sh index f26a6e1a..60752352 100755 --- a/profiles/DerGeret/Arch/partition.sh +++ b/profiles/DerGeret/Arch/partition.sh @@ -1,31 +1,33 @@ #!/bin/bash -{ - # Delete placeholders for swap and Linux partition - echo "d"; - echo "2"; +function dualbootPartition() { + { + # Delete placeholders for swap and Linux partition + echo "d"; + echo "2"; - echo "d"; - echo "3"; + echo "d"; + echo "3"; - # Create swap partition - echo "n"; - echo ""; - echo ""; - echo "+${SWAP_SIZE}G"; - echo "y"; - echo "t"; - echo "2"; - echo "19"; + # Create swap partition + echo "n"; + echo ""; + echo ""; + echo "+${SWAP_SIZE}G"; + echo "y"; + echo "t"; + echo "2"; + echo "19"; - # Fill remaining space with Linux partition - echo "n"; - echo ""; - echo ""; - echo ""; - echo "y"; - echo "t"; - echo "3"; - echo "23"; + # Fill remaining space with Linux partition + echo "n"; + echo ""; + echo ""; + echo ""; + echo "y"; + echo "t"; + echo "3"; + echo "23"; - echo "w"; -} | fdisk "$OS_DISK"; + echo "w"; + } | fdisk "$OS_DISK"; +} diff --git a/profiles/DerGeret/Arch/setup.sh b/profiles/DerGeret/Arch/setup.sh index bfc8bfa8..f0b4167b 100755 --- a/profiles/DerGeret/Arch/setup.sh +++ b/profiles/DerGeret/Arch/setup.sh @@ -1,5 +1,6 @@ #!/bin/bash -e pushd "${BASH_SOURCE%/*}" > /dev/null; +. "./partition.sh"; extraMounts() { @@ -8,9 +9,7 @@ extraMounts() } function initializePartitions() { - pushd "${BASH_SOURCE%/*}" > /dev/null; - . "./partition.sh"; - popd > /dev/null; + dualbootPartition; } SKIP_FORMAT_EFI=1 \