Allow specifying custom partition script
This commit is contained in:
parent
5ff7726d23
commit
fa32e7eb3f
2 changed files with 39 additions and 34 deletions
32
scripts/Arch/OS/default-partition.sh
Normal file
32
scripts/Arch/OS/default-partition.sh
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
{
|
||||
echo "g";
|
||||
|
||||
echo "n";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "+1G";
|
||||
echo "y";
|
||||
echo "t";
|
||||
echo "1";
|
||||
|
||||
echo "n";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "+${SWAP_SIZE}G";
|
||||
echo "y";
|
||||
echo "t";
|
||||
echo "";
|
||||
echo "19";
|
||||
|
||||
echo "n";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "y";
|
||||
echo "t";
|
||||
echo "";
|
||||
echo "23";
|
||||
|
||||
echo "w";
|
||||
} | fdisk "$ARCH_DISK";
|
|
@ -3,9 +3,12 @@ pushd "${BASH_SOURCE%/*}" > /dev/null;
|
|||
|
||||
source "../../Common/Scripts/choose-disk.sh";
|
||||
ARCH_DISK="${ARCH_DISK}";
|
||||
PARTITION_SCRIPT="${PARTITION_SCRIPT:-"./default-partition.sh"}";
|
||||
memory="$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }')";
|
||||
swapSize="$(echo "$memory" | awk '{ print int(($1 / 1024 / 1024 4) + 0.5)}')";
|
||||
|
||||
export SWAP_SIZE="$swapSize";
|
||||
|
||||
if [ ! -z "$ARCH_DISK" ] && [ ! -e "$ARCH_DISK" ]
|
||||
then
|
||||
ARCH_DISK="/dev/${ARCH_DISK}"
|
||||
|
@ -16,37 +19,7 @@ then
|
|||
chooseDisk ARCH_DISK "Which disk do you wish to format for installing Arch?";
|
||||
fi;
|
||||
|
||||
{
|
||||
echo "g";
|
||||
|
||||
echo "n";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "+1G";
|
||||
echo "y";
|
||||
echo "t";
|
||||
echo "1";
|
||||
|
||||
echo "n";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "+${swapSize}G";
|
||||
echo "y";
|
||||
echo "t";
|
||||
echo "";
|
||||
echo "19";
|
||||
|
||||
echo "n";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "";
|
||||
echo "y";
|
||||
echo "t";
|
||||
echo "";
|
||||
echo "23";
|
||||
|
||||
echo "w";
|
||||
} | fdisk "$ARCH_DISK";
|
||||
. "$PARTITION_SCRIPT";
|
||||
|
||||
while true
|
||||
do
|
||||
|
@ -54,9 +27,9 @@ do
|
|||
[ "${#disks[@]}" -ge 4 ] && break;
|
||||
done;
|
||||
|
||||
bootDisk="${disks[1]}";
|
||||
swapDisk="${disks[2]}";
|
||||
linuxDisk="${disks[3]}";
|
||||
bootDisk="${BOOT_DISK:-"${disks[1]}"}";
|
||||
swapDisk="${SWAP_DISK:-"${disks[2]}"}";
|
||||
linuxDisk="${LINUX_DISK:-"${disks[3]}"}";
|
||||
|
||||
mkfs.fat -F 32 "$bootDisk";
|
||||
mkswap "$swapDisk";
|
||||
|
|
Loading…
Reference in a new issue