aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-04-15 17:27:30 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-04-15 17:27:30 -0400
commite2e24381672b260b9d644740b750ad02f5c7b87f (patch)
tree70be2ff04cc970e833efc114c6afac94b27c7a55
parent293fd940d6e309683f18c2a45d5ba1ce45d96003 (diff)
cleanup
-rwxr-xr-xinstall.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/install.sh b/install.sh
index fbc60ad..7e03412 100755
--- a/install.sh
+++ b/install.sh
@@ -3,8 +3,6 @@ if [ $(id -u) -ne 0 ]
then echo "Please run as root"
exit
fi
-if [ ! -e installed ]; then
-
SCRIPTPATH=$(dirname "$(readlink -f "$0")")
if [ -z $1 ]; then
echo "Which drive?"
@@ -17,6 +15,8 @@ export PART="/dev/$(basename $(echo /sys/class/block/$BASE/$BASE* | \
xargs -n1 echo | sed 1q | rev | cut -c 2- | rev ))"
# List all partitions of device, get first one, remove last char.
sudo umount $DRIVE*
+if [ ! -e installed ]; then
+
fdisk $DRIVE <<EOF
g
n
@@ -35,16 +35,18 @@ EOF
yes | mkfs.vfat ${PART}1
yes | mkfs.ext4 ${PART}2
+mount ${PART}2 /mnt
+mkdir /mnt/efi
+mount ${PART}1 /mnt/efi
+
pacstrap /mnt base
genfstab -U /mnt >> /mnt/etc/fstab
cp -r . /mnt
touch installed
-fi
+else
mount ${PART}2 /mnt
-mkdir /mnt/efi
mount ${PART}1 /mnt/efi
-#echo "arch-chroot into the new system and run dotfiles/build.sh"
-ip link
+fi
arch-chroot /mnt << EOF
cd dotfiles
sh build.sh