53 lines
1,002 B
Bash
Executable file
53 lines
1,002 B
Bash
Executable file
pushd "${BASH_SOURCE%/*}" > /dev/null;
|
|
|
|
ARCH_DISK="${ARCH_DISK:-$(chooseDisk "Which disk do you wish to format for installing Arch?")}";
|
|
source "../../Scripts/choose-disk.sh";
|
|
memory="$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }')";
|
|
swapSize="$(echo "$memory" | awk '{ print int(($1 / 1024 / 1024 4) + 0.5)}')";
|
|
|
|
{
|
|
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";
|
|
|
|
disks=($(bash -c "echo $ARCH_DISK*"));
|
|
bootDisk="${disks[1]}";
|
|
swapDisk="${disks[2]}";
|
|
linuxDisk="${disks[3]}";
|
|
|
|
mkfs.fat -F 32 "$bootDisk";
|
|
mkswap "$swapDisk";
|
|
mkfs.ext4 "$linuxDisk";
|
|
|
|
mount "$linuxDisk" /mnt;
|
|
mount --mkdir "$bootDisk" /mnt/boot;
|
|
swapon "$swapDisk";
|
|
|
|
popd > /dev/null;
|