diff --git a/cloud.json b/cloud.json index 92794bea9d2ef42a3d356966acc27101114eb50b..0871957a8232d50753befa5d2d81ccc58af43503 100644 --- a/cloud.json +++ b/cloud.json @@ -8,7 +8,8 @@ "cpus": "2", "headless": "true", "write_zeroes": "", - "boot_wait": "60s" + "boot_wait": "60s", + "mirror": "" }, "builders": [ { @@ -40,7 +41,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-cloud}.sh'<enter><wait>", - "bash install.sh < <(cat install-{cloud,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{cloud,common}.sh) && systemctl reboot<enter>" ] } ], diff --git a/http/install.sh b/http/install.sh index e22be6c9b7fc858e12eeb02df8e86835764ec541..84678db688a170f0a990aa7cb6e6c68d855544e7 100644 --- a/http/install.sh +++ b/http/install.sh @@ -25,9 +25,13 @@ mkswap "${device}1" mkfs.ext4 -L "rootfs" "${device}2" mount "${device}2" /mnt -pacstrap /mnt base linux grub openssh sudo polkit haveged netctl python reflector +if [ -n "${MIRROR}" ]; then + echo "Server = ${MIRROR}" >/etc/pacman.d/mirrorlist +fi +pacstrap -M /mnt base linux grub openssh sudo polkit haveged netctl python reflector swapon "${device}1" genfstab -p /mnt >>/mnt/etc/fstab swapoff "${device}1" +arch-chroot /mnt /usr/bin/sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist arch-chroot /mnt /bin/bash diff --git a/local.json b/local.json index b0d5677ead94ff71436ae13ecb8340ea3c5e818b..1b147d71d768cc579a858023bcc6e6300bf8ebc6 100644 --- a/local.json +++ b/local.json @@ -9,7 +9,8 @@ "cpus": "2", "headless": "true", "write_zeroes": "", - "boot_wait": "60s" + "boot_wait": "60s", + "mirror": "" }, "builders": [ { @@ -45,7 +46,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", - "bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" ] }, { "type": "qemu", @@ -74,7 +75,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", - "bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" ] }, { "type": "vmware-iso", @@ -95,7 +96,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", - "bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" ] } diff --git a/vagrant.json b/vagrant.json index 30645dec3ca1aafcc9897a0e206e1810ce2bb183..b19a20dbb618b48bdd127347a2b9ddca50d99ba4 100644 --- a/vagrant.json +++ b/vagrant.json @@ -9,7 +9,8 @@ "headless": "true", "vagrant_cloud_token": "PLACEHOLDER", "write_zeroes": "", - "boot_wait": "60s" + "boot_wait": "60s", + "mirror": "" }, "builders": [ { @@ -45,7 +46,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", - "bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" ] }, { "type": "qemu", @@ -74,7 +75,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", - "bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" ] }, { "type": "vmware-iso", @@ -95,7 +96,7 @@ "boot_command": [ "<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", - "bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" + "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" ] }