From 125b06889ab4b4492e242756776c9512080d1557 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 28 Nov 2023 01:15:53 +0100 Subject: [PATCH] Allow setting custom labels for partitions --- scripts/Arch/OS/setup.sh | 1 + scripts/Common/OS/partition.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/Arch/OS/setup.sh b/scripts/Arch/OS/setup.sh index c87a5b7c..dae47827 100755 --- a/scripts/Arch/OS/setup.sh +++ b/scripts/Arch/OS/setup.sh @@ -23,6 +23,7 @@ tempDir="$tempRoot/$relativeDir"; loadkeys "$ARCH_KEYMAP"; timedatectl set-timezone "$ARCH_TIMEZONE"; OS_DISK="${ARCH_DISK}" \ +OS_LABEL="Arch" \ . "../../Common/OS/partition.sh"; pacman-key --init; diff --git a/scripts/Common/OS/partition.sh b/scripts/Common/OS/partition.sh index 9ef32d0c..22d1c3b1 100755 --- a/scripts/Common/OS/partition.sh +++ b/scripts/Common/OS/partition.sh @@ -4,6 +4,9 @@ pushd "${BASH_SOURCE%/*}" > /dev/null; source "../Scripts/is-truthy.sh"; source "../Scripts/choose-disk.sh"; OS_DISK="${OS_DISK}"; +BOOT_LABEL="${BOOT_LABEL:-Boot}"; +OS_LABEL="${OS_LABEL:-Linux}"; +SWAP_LABEL="${SWAP_LABEL:-Swap}"; SKIP_FORMAT_EFI="${SKIP_FORMAT_EFI}"; PARTITION_SCRIPT="${PARTITION_SCRIPT:-"./default-partition.sh"}"; memory="$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }')"; @@ -35,11 +38,11 @@ linuxDisk="${LINUX_DISK:-"${disks[3]}"}"; if ! isTruthy "$SKIP_FORMAT_EFI" then - mkfs.fat -F 32 "$bootDisk"; + mkfs.fat -F 32 -n "$BOOT_LABEL" "$bootDisk"; fi -mkswap "$swapDisk"; -mkfs.ext4 -F "$linuxDisk"; +mkswap -L "$SWAP_LABEL" "$swapDisk"; +mkfs.ext4 -L "$OS_LABEL" -F "$linuxDisk"; mount "$linuxDisk" /mnt; mount --mkdir "$bootDisk" /mnt/boot;