diff --git a/distros/opensuse/16.0/amd64.pkrvars.hcl b/distros/opensuse/16.0/amd64.pkrvars.hcl index 5eb5b1c..70e2752 100644 --- a/distros/opensuse/16.0/amd64.pkrvars.hcl +++ b/distros/opensuse/16.0/amd64.pkrvars.hcl @@ -1,8 +1,6 @@ distro = "opensuse" version = "16.0" iso = { - #url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer.x86_64-Leap_16.0.iso" - #checksum = "d3e7a86c4ab7296480ad41a2ca30bde5cad0ff2210b145dd2011403f648f76cb" url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer.x86_64-17.0.0-Leap_16.0-Build151.4.iso" checksum = "d3e7a86c4ab7296480ad41a2ca30bde5cad0ff2210b145dd2011403f648f76cb" } @@ -16,6 +14,5 @@ boot_command = [ "x" ] boot_wait = "8s" -cd_files = [ "distros/opensuse/16.0/http/" ] http_directory = "distros/opensuse/16.0/http/" vbox_os_type = "OpenSUSE_Leap_64" diff --git a/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh b/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh deleted file mode 100755 index b8eca9e..0000000 --- a/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!env bash - -set -x - -name="${0%.sh}" - -base="https://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Current.iso" - -# Working directory -tmp="$(mktemp -d)" -checksums="${tmp}/checksums" - -# Read the SHA256 sum value -sums="${base}.sha256" -until curl -f -L -o "${checksums}" "${sums}"; do - sleep 1 -done -sha="$(cut -d' ' -f 1 "${checksums}")" - -cat << EOF > "${name}" -distro = "opensuse" -version = "tumbleweed" -iso = { - url = "${base}" - checksum = "${sha}" -} -boot_command = [ - "e", - "", - " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1", - "x" -] -http_directory = "distros/opensuse/tumbleweed/http/" -vbox_os_type = "OpenSUSE_Tumbleweed_64" -EOF - -rm -r "${tmp}" diff --git a/distros/opensuse/tumbleweed/http/autoinst.xml b/distros/opensuse/tumbleweed/http/autoinst.xml deleted file mode 100644 index 6df26a9..0000000 --- a/distros/opensuse/tumbleweed/http/autoinst.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - false - true - - - - - - wheel - vagrant - - - - true - external - - - public - - eth0 - - - ssh - - - - - - - all - - - /boot - 512MiB - - - / - max - - - - - - en_US - - - network_manager - - - - - sshd - - - - - - openssh - sudo - - true - false - - openSUSE - - - - UTC - UTC - - - - root - vagrant - false - - - vagrant - vagrant - false - - - - - - - - - - /etc/sudoers.d/vagrant - - - - 440 - root - - - /home/vagrant/.ssh/authorized_keys - 600 - vagrant - https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub - - - diff --git a/distros/opensuse/tumbleweed/http/profile.jsonnet b/distros/opensuse/tumbleweed/http/profile.jsonnet new file mode 100644 index 0000000..9d32930 --- /dev/null +++ b/distros/opensuse/tumbleweed/http/profile.jsonnet @@ -0,0 +1,88 @@ +// For more docs, check out +// https://agama-project.github.io/docs/user/profile/dynamic +// This is a Jsonnet file. Please, check https://jsonnet.org/ for more +// information about the language. +// For the schema, see +// https://github.com/openSUSE/agama/blob/master/rust/agama-lib/share/profile.schema.json + +// The "hw.libsonnet" file contains hardware information from the "lshw" tool. +// Agama generates this file at runtime by running (with root privileges): +// +// lshw -json +// +// There are included also helpers to search this hardware tree. To see helpers check +// "/usr/share/agama-cli/agama.libsonnet" +local agama = import 'hw.libsonnet'; + +// Find the biggest disk which is suitable for installing the system. +local findBiggestDisk(disks) = + local sizedDisks = std.filter(function(d) std.objectHas(d, 'size'), disks); + local sorted = std.sort(sizedDisks, function(x) -x.size); + sorted[0].logicalname; + +// Find how much physical memory system has. +local memory = agama.findByID(agama.lshw, 'memory').size; + +{ + product: { + id: 'Tumbleweed', + }, + software: { + patterns: [ + ], + }, + user: { + fullName: 'vagrant', + userName: 'vagrant', + password: 'vagrant', + }, + root: { + password: 'vagrant', + }, + localization: { + language: 'en_US', + keyboard: 'us', + }, + bootloader: { + extraKernelParams: "nomodeset" + }, + storage: { + boot: { + configure: true, + device: "boot", + }, + drives: [{ + search: findBiggestDisk(agama.selectByClass(agama.lshw, 'disk')), + alias: "boot", + ptableType: 'gpt', + partitions: [{ + "search": "*", + "delete": true, + },{ + "generate": "default" + }], + }] + }, + scripts: { + post: [ { + name: 'configure-vagrant', + chroot: true, + content: ||| + #!/bin/bash + # Configure the insecure Vagrant SSH key + mkdir -p /home/vagrant/.ssh + curl -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub + chown -R vagrant /home/vagrant/.ssh + chmod 600 /home/vagrant/.ssh + # Start services + systemctl enable sshd + # Configure sudo access for the vagrant user + cat << EOF > /etc/sudoers.d/00_vagrant + Defaults:vagrant !requiretty + vagrant ALL=(ALL) NOPASSWD: ALL + root ALL=(ALL) NOPASSWD: ALL + EOF + |||, + } ] + }, +} diff --git a/distros/opensuse/tumbleweed/update.sh b/distros/opensuse/tumbleweed/update.sh new file mode 100755 index 0000000..23e02aa --- /dev/null +++ b/distros/opensuse/tumbleweed/update.sh @@ -0,0 +1,24 @@ +#!env bash + +set -exo pipefail + +dir="$(cd "$(dirname "${0}")"; pwd)" + +base="https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel/images/iso/agama-installer.x86_64-17.0.0-openSUSE-Build6.13.iso" + +# Working directory +tmp="$(mktemp -d)" +trap "rm -rf '${tmp}'" EXIT +checksums="${tmp}/checksums" + +# Read the SHA256 sum value +sums="${base}.sha256" +until curl -f -L -o "${checksums}" "${sums}"; do + sleep 1 +done +sha="$(cut -d' ' -f 1 "${checksums}")" + +sed -E -i \ + -e "s,( checksum *=).*$,\1 \"$sha\"," + +rm -r "${tmp}"