diff options
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..816857b --- /dev/null +++ b/install.sh @@ -0,0 +1,49 @@ +#!/bin/sh +if [ $(id -u) -ne 0 ] + then echo "Please run as root" + exit +fi + +SCRIPTPATH=$(dirname "$(readlink -f "$0")") +if [ -z $1 ]; then + echo "Which drive?" + read DRIVE +else + export DRIVE=$1 +fi +export BASE=$(basename $DRIVE) +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* +fdisk $DRIVE <<EOF + g + n + 1 + + +512M + t + 1 + n + 2 + + +20G + w +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 +cd $SCRIPTPATH/.. +cp -r dotfiles /mnt +#echo "arch-chroot into the new system and run dotfiles/build.sh" +arch-chroot /mnt << EOF + cd dotfiles + sh build.sh +EOF +echo "DONE!" |