Allow setting custom labels for partitions

This commit is contained in:
Manuel Thalmann 2023-11-28 01:15:53 +01:00
parent db9e6a4a99
commit 125b06889a
2 changed files with 7 additions and 3 deletions

View file

@ -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;

View file

@ -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;