From 072de4ba94299a3eabe8b416ef2c27885c47e48f Mon Sep 17 00:00:00 2001 From: Christian Kotte Date: Sun, 12 Jul 2020 21:46:45 +0200 Subject: [PATCH] Remove hard tabs from install-base.sh It's best practice to use soft tabs instead of hard tabs. --- scripts/install-base.sh | 57 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/scripts/install-base.sh b/scripts/install-base.sh index 2ec6d95..0af70c3 100644 --- a/scripts/install-base.sh +++ b/scripts/install-base.sh @@ -4,9 +4,9 @@ set -eu if [[ $PACKER_BUILDER_TYPE == "qemu" ]]; then - DISK='/dev/vda' + DISK='/dev/vda' else - DISK='/dev/sda' + DISK='/dev/sda' fi FQDN='vagrant-arch.vagrantup.com' @@ -57,35 +57,34 @@ echo '==> Generating the system configuration script' /usr/bin/install --mode=0755 /dev/null "${TARGET_DIR}${CONFIG_SCRIPT}" cat <<-EOF > "${TARGET_DIR}${CONFIG_SCRIPT}" - echo '${FQDN}' > /etc/hostname - /usr/bin/ln -s /usr/share/zoneinfo/${TIMEZONE} /etc/localtime - echo 'KEYMAP=${KEYMAP}' > /etc/vconsole.conf - /usr/bin/sed -i 's/#${LANGUAGE}/${LANGUAGE}/' /etc/locale.gen - /usr/bin/locale-gen - /usr/bin/mkinitcpio -p linux - /usr/bin/usermod --password ${PASSWORD} root - # https://wiki.archlinux.org/index.php/Network_Configuration#Device_names - /usr/bin/ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules - /usr/bin/ln -s '/usr/lib/systemd/system/dhcpcd@.service' '/etc/systemd/system/multi-user.target.wants/dhcpcd@eth0.service' - /usr/bin/sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config - /usr/bin/systemctl enable sshd.service + echo '${FQDN}' > /etc/hostname + /usr/bin/ln -s /usr/share/zoneinfo/${TIMEZONE} /etc/localtime + echo 'KEYMAP=${KEYMAP}' > /etc/vconsole.conf + /usr/bin/sed -i 's/#${LANGUAGE}/${LANGUAGE}/' /etc/locale.gen + /usr/bin/locale-gen + /usr/bin/mkinitcpio -p linux + /usr/bin/usermod --password ${PASSWORD} root + # https://wiki.archlinux.org/index.php/Network_Configuration#Device_names + /usr/bin/ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules + /usr/bin/ln -s '/usr/lib/systemd/system/dhcpcd@.service' '/etc/systemd/system/multi-user.target.wants/dhcpcd@eth0.service' + /usr/bin/sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config + /usr/bin/systemctl enable sshd.service - # Workaround for https://bugs.archlinux.org/task/58355 which prevents sshd to accept connections after reboot - /usr/bin/pacman -S --noconfirm rng-tools - /usr/bin/systemctl enable rngd + # Workaround for https://bugs.archlinux.org/task/58355 which prevents sshd to accept connections after reboot + /usr/bin/pacman -S --noconfirm rng-tools + /usr/bin/systemctl enable rngd - # Vagrant-specific configuration - /usr/bin/useradd --password ${PASSWORD} --comment 'Vagrant User' --create-home --user-group vagrant - echo 'Defaults env_keep += "SSH_AUTH_SOCK"' > /etc/sudoers.d/10_vagrant - echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/10_vagrant - /usr/bin/chmod 0440 /etc/sudoers.d/10_vagrant - /usr/bin/install --directory --owner=vagrant --group=vagrant --mode=0700 /home/vagrant/.ssh - /usr/bin/curl --output /home/vagrant/.ssh/authorized_keys --location https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub - /usr/bin/chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys - /usr/bin/chmod 0600 /home/vagrant/.ssh/authorized_keys - - # clean up - /usr/bin/pacman -Rcns --noconfirm gptfdisk + # Vagrant-specific configuration + /usr/bin/useradd --password ${PASSWORD} --comment 'Vagrant User' --create-home --user-group vagrant + echo 'Defaults env_keep += "SSH_AUTH_SOCK"' > /etc/sudoers.d/10_vagrant + echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/10_vagrant + /usr/bin/chmod 0440 /etc/sudoers.d/10_vagrant + /usr/bin/install --directory --owner=vagrant --group=vagrant --mode=0700 /home/vagrant/.ssh + /usr/bin/curl --output /home/vagrant/.ssh/authorized_keys --location https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub + /usr/bin/chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys + /usr/bin/chmod 0600 /home/vagrant/.ssh/authorized_keys + # clean up + /usr/bin/pacman -Rcns --noconfirm gptfdisk EOF echo '==> Entering chroot and configuring system'