From 578e77235a586d62247ee3c5b7b2ddaca67dc7c9 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 28 Nov 2023 01:22:48 +0100 Subject: [PATCH] Allow customizing the OS mount root --- scripts/Arch/OS/setup.sh | 1 + scripts/Common/OS/partition.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/Arch/OS/setup.sh b/scripts/Arch/OS/setup.sh index dae47827..46902b73 100755 --- a/scripts/Arch/OS/setup.sh +++ b/scripts/Arch/OS/setup.sh @@ -22,6 +22,7 @@ tempDir="$tempRoot/$relativeDir"; loadkeys "$ARCH_KEYMAP"; timedatectl set-timezone "$ARCH_TIMEZONE"; +OS_MOUNT_ROOT="${ARCH_MOUNT_ROOT}"; OS_DISK="${ARCH_DISK}" \ OS_LABEL="Arch" \ . "../../Common/OS/partition.sh"; diff --git a/scripts/Common/OS/partition.sh b/scripts/Common/OS/partition.sh index 22d1c3b1..3ff89f37 100755 --- a/scripts/Common/OS/partition.sh +++ b/scripts/Common/OS/partition.sh @@ -3,6 +3,7 @@ pushd "${BASH_SOURCE%/*}" > /dev/null; source "../Scripts/is-truthy.sh"; source "../Scripts/choose-disk.sh"; +OS_MOUNT_ROOT="${OS_ROOT:-"/mnt"}"; OS_DISK="${OS_DISK}"; BOOT_LABEL="${BOOT_LABEL:-Boot}"; OS_LABEL="${OS_LABEL:-Linux}"; @@ -44,9 +45,9 @@ fi mkswap -L "$SWAP_LABEL" "$swapDisk"; mkfs.ext4 -L "$OS_LABEL" -F "$linuxDisk"; -mount "$linuxDisk" /mnt; -mount --mkdir "$bootDisk" /mnt/boot; -swapon "$swapDisk"; +mount "/dev/disk/by-label/$OS_LABEL" "$OS_MOUNT_ROOT"; +mount --mkdir "/dev/disk/by-label/$BOOT_LABEL" "$OS_MOUNT_ROOT/boot"; +swapon "/dev/disk/by-label/$SWAP_LABEL"; if command -v extraMounts then