Move Tumbleweed to using the Agama installer Change it from fully dynamic to using the update script
89 lines
2.4 KiB
Jsonnet
89 lines
2.4 KiB
Jsonnet
// 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
|
|
|||,
|
|
} ]
|
|
},
|
|
}
|