Move to external boot files
This commit is contained in:
+2
-1
@@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
virsh -q vol-list default | awk '{print $1}' | xargs -r -L 1 virsh vol-delete --pool default
|
virsh -q vol-list default | awk '{print $1}' | xargs -r -L 1 virsh vol-delete --pool default
|
||||||
sudo virsh -q vol-list default | awk '{print $1}' | sudo xargs -r -L 1 virsh vol-delete --pool default
|
sudo virsh -q vol-list default | awk '{print $1}' | sudo xargs -r -L 1 virsh vol-delete --pool default
|
||||||
vagrant box list | awk '{print $1}' | xargs -r -L 1 vagrant box remove
|
vagrant box list | awk '{print $1}' | sort -u | xargs -l vagrant box remove --provider virtualbox
|
||||||
|
vagrant box list | awk '{print $1}' | sort -u | xargs -l vagrant box remove --provider libvirt
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:])
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
url --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=BaseOS&infra=stock
|
||||||
|
repo --name=AppStream --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock
|
||||||
|
network --bootproto=dhcp --activate
|
||||||
|
reboot
|
||||||
|
|
||||||
|
text
|
||||||
|
keyboard --vckeymap us
|
||||||
|
lang en_US
|
||||||
|
skipx
|
||||||
|
rootpw --plaintext vagrant
|
||||||
|
firewall --disabled
|
||||||
|
timezone --utc UTC
|
||||||
|
services --enabled=vmtoolsd
|
||||||
|
# The biosdevname and ifnames options ensure we get "eth0" as our interface
|
||||||
|
# even in environments like virtualbox that emulate a real NW card
|
||||||
|
bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop"
|
||||||
|
zerombr
|
||||||
|
clearpart --all
|
||||||
|
part / --fstype=xfs --asprimary --size=1024 --grow
|
||||||
|
|
||||||
|
user --name=vagrant --plaintext --password=vagrant
|
||||||
|
|
||||||
|
%packages --instLangs=en
|
||||||
|
bash-completion
|
||||||
|
man-pages
|
||||||
|
bzip2
|
||||||
|
rsync
|
||||||
|
nfs-utils
|
||||||
|
cifs-utils
|
||||||
|
chrony
|
||||||
|
yum-utils
|
||||||
|
hyperv-daemons
|
||||||
|
open-vm-tools
|
||||||
|
# Vagrant boxes aren't normally visible, no need for Plymouth
|
||||||
|
-plymouth
|
||||||
|
# Microcode updates cannot work in a VM
|
||||||
|
-microcode_ctl
|
||||||
|
# Firmware packages are not needed in a VM
|
||||||
|
-iwl100-firmware
|
||||||
|
-iwl1000-firmware
|
||||||
|
-iwl105-firmware
|
||||||
|
-iwl135-firmware
|
||||||
|
-iwl2000-firmware
|
||||||
|
-iwl2030-firmware
|
||||||
|
-iwl3160-firmware
|
||||||
|
-iwl3945-firmware
|
||||||
|
-iwl4965-firmware
|
||||||
|
-iwl5000-firmware
|
||||||
|
-iwl5150-firmware
|
||||||
|
-iwl6000-firmware
|
||||||
|
-iwl6000g2a-firmware
|
||||||
|
-iwl6050-firmware
|
||||||
|
-iwl7260-firmware
|
||||||
|
# Don't build rescue initramfs
|
||||||
|
-dracut-config-rescue
|
||||||
|
%end
|
||||||
|
|
||||||
|
# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only
|
||||||
|
# works on systems with at least 2GB RAM (which excludes most Vagrant boxes)
|
||||||
|
# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169
|
||||||
|
%addon com_redhat_kdump --disable
|
||||||
|
%end
|
||||||
|
|
||||||
|
%post
|
||||||
|
# configure swap to a file
|
||||||
|
fallocate -l 2G /swapfile
|
||||||
|
chmod 600 /swapfile
|
||||||
|
mkswap /swapfile
|
||||||
|
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
||||||
|
|
||||||
|
# sudo
|
||||||
|
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
||||||
|
chmod 0440 /etc/sudoers.d/vagrant
|
||||||
|
|
||||||
|
# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38
|
||||||
|
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
||||||
|
DEVICE="eth0"
|
||||||
|
BOOTPROTO="dhcp"
|
||||||
|
ONBOOT="yes"
|
||||||
|
TYPE="Ethernet"
|
||||||
|
PERSISTENT_DHCLIENT="yes"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# sshd: disable password authentication and DNS checks
|
||||||
|
ex -s /etc/ssh/sshd_config <<EOF
|
||||||
|
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
|
||||||
|
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
||||||
|
:update
|
||||||
|
:quit
|
||||||
|
EOF
|
||||||
|
cat >>/etc/sysconfig/sshd <<EOF
|
||||||
|
|
||||||
|
# Decrease connection time by preventing reverse DNS lookups
|
||||||
|
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
||||||
|
# and man sshd for more information)
|
||||||
|
OPTIONS="-u0"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Default insecure vagrant key
|
||||||
|
mkdir -m 0700 -p /home/vagrant/.ssh
|
||||||
|
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
|
||||||
|
chmod 600 /home/vagrant/.ssh/authorized_keys
|
||||||
|
chown -R vagrant:vagrant /home/vagrant/.ssh
|
||||||
|
|
||||||
|
# Fix for issue #76, regular users can gain admin privileges via su
|
||||||
|
ex -s /etc/pam.d/su <<'EOF'
|
||||||
|
# allow vagrant to use su, but prevent others from becoming root or vagrant
|
||||||
|
/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/
|
||||||
|
:append
|
||||||
|
account [success=1 default=ignore] \\
|
||||||
|
pam_succeed_if.so user = vagrant use_uid quiet
|
||||||
|
account required pam_succeed_if.so user notin root:vagrant
|
||||||
|
.
|
||||||
|
:update
|
||||||
|
:quit
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# systemd should generate a new machine id during the first boot, to
|
||||||
|
# avoid having multiple Vagrant instances with the same id in the local
|
||||||
|
# network. /etc/machine-id should be empty, but it must exist to prevent
|
||||||
|
# boot errors (e.g. systemd-journald failing to start).
|
||||||
|
:>/etc/machine-id
|
||||||
|
|
||||||
|
echo 'vag' > /etc/yum/vars/infra
|
||||||
|
|
||||||
|
# Blacklist the floppy module to avoid probing timeouts
|
||||||
|
echo blacklist floppy > /etc/modprobe.d/nofloppy.conf
|
||||||
|
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf
|
||||||
|
|
||||||
|
# Customize the initramfs
|
||||||
|
pushd /etc/dracut.conf.d
|
||||||
|
# Enable VMware PVSCSI support for VMware Fusion guests.
|
||||||
|
echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf
|
||||||
|
echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf
|
||||||
|
# There's no floppy controller, but probing for it generates timeouts
|
||||||
|
echo 'omit_drivers+=" floppy "' > nofloppy.conf
|
||||||
|
popd
|
||||||
|
# Fix the SELinux context of the new files
|
||||||
|
restorecon -f - <<EOF
|
||||||
|
/etc/sudoers.d/vagrant
|
||||||
|
/etc/dracut.conf.d/vmware-fusion-drivers.conf
|
||||||
|
/etc/dracut.conf.d/hyperv-drivers.conf
|
||||||
|
/etc/dracut.conf.d/nofloppy.conf
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Rerun dracut for the installed kernel (not the running kernel):
|
||||||
|
KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
|
||||||
|
dracut -f /boot/initramfs-${KERNEL_VERSION}.img ${KERNEL_VERSION}
|
||||||
|
|
||||||
|
# Seal for deployment
|
||||||
|
rm -rf /etc/ssh/ssh_host_*
|
||||||
|
hostnamectl set-hostname localhost.localdomain
|
||||||
|
rm -rf /etc/udev/rules.d/70-*
|
||||||
|
%end
|
||||||
|
|
||||||
@@ -9,161 +9,4 @@ boot_command = [
|
|||||||
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
||||||
"<enter><wait>"
|
"<enter><wait>"
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [ "distros/centos-stream/8/disc/*" ]
|
||||||
"ks.cfg" = <<KICKSTART
|
|
||||||
url --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=BaseOS&infra=stock
|
|
||||||
repo --name=AppStream --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock
|
|
||||||
network --bootproto=dhcp --activate
|
|
||||||
reboot
|
|
||||||
|
|
||||||
text
|
|
||||||
keyboard --vckeymap us
|
|
||||||
lang en_US
|
|
||||||
skipx
|
|
||||||
rootpw --plaintext vagrant
|
|
||||||
firewall --disabled
|
|
||||||
timezone --utc UTC
|
|
||||||
services --enabled=vmtoolsd
|
|
||||||
# The biosdevname and ifnames options ensure we get "eth0" as our interface
|
|
||||||
# even in environments like virtualbox that emulate a real NW card
|
|
||||||
bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop"
|
|
||||||
zerombr
|
|
||||||
clearpart --all
|
|
||||||
part / --fstype=xfs --asprimary --size=1024 --grow
|
|
||||||
|
|
||||||
user --name=vagrant --plaintext --password=vagrant
|
|
||||||
|
|
||||||
%packages --instLangs=en
|
|
||||||
bash-completion
|
|
||||||
man-pages
|
|
||||||
bzip2
|
|
||||||
rsync
|
|
||||||
nfs-utils
|
|
||||||
cifs-utils
|
|
||||||
chrony
|
|
||||||
yum-utils
|
|
||||||
hyperv-daemons
|
|
||||||
open-vm-tools
|
|
||||||
# Vagrant boxes aren't normally visible, no need for Plymouth
|
|
||||||
-plymouth
|
|
||||||
# Microcode updates cannot work in a VM
|
|
||||||
-microcode_ctl
|
|
||||||
# Firmware packages are not needed in a VM
|
|
||||||
-iwl100-firmware
|
|
||||||
-iwl1000-firmware
|
|
||||||
-iwl105-firmware
|
|
||||||
-iwl135-firmware
|
|
||||||
-iwl2000-firmware
|
|
||||||
-iwl2030-firmware
|
|
||||||
-iwl3160-firmware
|
|
||||||
-iwl3945-firmware
|
|
||||||
-iwl4965-firmware
|
|
||||||
-iwl5000-firmware
|
|
||||||
-iwl5150-firmware
|
|
||||||
-iwl6000-firmware
|
|
||||||
-iwl6000g2a-firmware
|
|
||||||
-iwl6050-firmware
|
|
||||||
-iwl7260-firmware
|
|
||||||
# Don't build rescue initramfs
|
|
||||||
-dracut-config-rescue
|
|
||||||
%end
|
|
||||||
|
|
||||||
# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only
|
|
||||||
# works on systems with at least 2GB RAM (which excludes most Vagrant boxes)
|
|
||||||
# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169
|
|
||||||
%addon com_redhat_kdump --disable
|
|
||||||
%end
|
|
||||||
|
|
||||||
%post
|
|
||||||
# configure swap to a file
|
|
||||||
fallocate -l 2G /swapfile
|
|
||||||
chmod 600 /swapfile
|
|
||||||
mkswap /swapfile
|
|
||||||
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
|
||||||
|
|
||||||
# sudo
|
|
||||||
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
|
||||||
chmod 0440 /etc/sudoers.d/vagrant
|
|
||||||
|
|
||||||
# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38
|
|
||||||
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
|
||||||
DEVICE="eth0"
|
|
||||||
BOOTPROTO="dhcp"
|
|
||||||
ONBOOT="yes"
|
|
||||||
TYPE="Ethernet"
|
|
||||||
PERSISTENT_DHCLIENT="yes"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# sshd: disable password authentication and DNS checks
|
|
||||||
ex -s /etc/ssh/sshd_config <<EOF
|
|
||||||
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
|
|
||||||
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
cat >>/etc/sysconfig/sshd <<EOF
|
|
||||||
|
|
||||||
# Decrease connection time by preventing reverse DNS lookups
|
|
||||||
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
|
||||||
# and man sshd for more information)
|
|
||||||
OPTIONS="-u0"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Default insecure vagrant key
|
|
||||||
mkdir -m 0700 -p /home/vagrant/.ssh
|
|
||||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
|
|
||||||
chmod 600 /home/vagrant/.ssh/authorized_keys
|
|
||||||
chown -R vagrant:vagrant /home/vagrant/.ssh
|
|
||||||
|
|
||||||
# Fix for issue #76, regular users can gain admin privileges via su
|
|
||||||
ex -s /etc/pam.d/su <<'EOF'
|
|
||||||
# allow vagrant to use su, but prevent others from becoming root or vagrant
|
|
||||||
/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/
|
|
||||||
:append
|
|
||||||
account [success=1 default=ignore] \\
|
|
||||||
pam_succeed_if.so user = vagrant use_uid quiet
|
|
||||||
account required pam_succeed_if.so user notin root:vagrant
|
|
||||||
.
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# systemd should generate a new machine id during the first boot, to
|
|
||||||
# avoid having multiple Vagrant instances with the same id in the local
|
|
||||||
# network. /etc/machine-id should be empty, but it must exist to prevent
|
|
||||||
# boot errors (e.g. systemd-journald failing to start).
|
|
||||||
:>/etc/machine-id
|
|
||||||
|
|
||||||
echo 'vag' > /etc/yum/vars/infra
|
|
||||||
|
|
||||||
# Blacklist the floppy module to avoid probing timeouts
|
|
||||||
echo blacklist floppy > /etc/modprobe.d/nofloppy.conf
|
|
||||||
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf
|
|
||||||
|
|
||||||
# Customize the initramfs
|
|
||||||
pushd /etc/dracut.conf.d
|
|
||||||
# Enable VMware PVSCSI support for VMware Fusion guests.
|
|
||||||
echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf
|
|
||||||
echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf
|
|
||||||
# There's no floppy controller, but probing for it generates timeouts
|
|
||||||
echo 'omit_drivers+=" floppy "' > nofloppy.conf
|
|
||||||
popd
|
|
||||||
# Fix the SELinux context of the new files
|
|
||||||
restorecon -f - <<EOF
|
|
||||||
/etc/sudoers.d/vagrant
|
|
||||||
/etc/dracut.conf.d/vmware-fusion-drivers.conf
|
|
||||||
/etc/dracut.conf.d/hyperv-drivers.conf
|
|
||||||
/etc/dracut.conf.d/nofloppy.conf
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Rerun dracut for the installed kernel (not the running kernel):
|
|
||||||
KERNEL_VERSION=$(rpm -q kernel --qf '%\{version}-%\{release}.%\{arch}\n')
|
|
||||||
dracut -f /boot/initramfs-$\{KERNEL_VERSION}.img $\{KERNEL_VERSION}
|
|
||||||
|
|
||||||
# Seal for deployment
|
|
||||||
rm -rf /etc/ssh/ssh_host_*
|
|
||||||
hostnamectl set-hostname localhost.localdomain
|
|
||||||
rm -rf /etc/udev/rules.d/70-*
|
|
||||||
%end
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
# Name of the file to write out
|
# Name of the file to write out
|
||||||
name="${0%.sh}"
|
name="${0%.sh}"
|
||||||
|
|
||||||
@@ -21,162 +23,5 @@ boot_command = [
|
|||||||
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
||||||
"<enter><wait>"
|
"<enter><wait>"
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [ "distros/centos-stream/8/disc/*" ]
|
||||||
"ks.cfg" = <<KICKSTART
|
|
||||||
url --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=BaseOS&infra=stock
|
|
||||||
repo --name=AppStream --mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock
|
|
||||||
network --bootproto=dhcp --activate
|
|
||||||
reboot
|
|
||||||
|
|
||||||
text
|
|
||||||
keyboard --vckeymap us
|
|
||||||
lang en_US
|
|
||||||
skipx
|
|
||||||
rootpw --plaintext vagrant
|
|
||||||
firewall --disabled
|
|
||||||
timezone --utc UTC
|
|
||||||
services --enabled=vmtoolsd
|
|
||||||
# The biosdevname and ifnames options ensure we get "eth0" as our interface
|
|
||||||
# even in environments like virtualbox that emulate a real NW card
|
|
||||||
bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop"
|
|
||||||
zerombr
|
|
||||||
clearpart --all
|
|
||||||
part / --fstype=xfs --asprimary --size=1024 --grow
|
|
||||||
|
|
||||||
user --name=vagrant --plaintext --password=vagrant
|
|
||||||
|
|
||||||
%packages --instLangs=en
|
|
||||||
bash-completion
|
|
||||||
man-pages
|
|
||||||
bzip2
|
|
||||||
rsync
|
|
||||||
nfs-utils
|
|
||||||
cifs-utils
|
|
||||||
chrony
|
|
||||||
yum-utils
|
|
||||||
hyperv-daemons
|
|
||||||
open-vm-tools
|
|
||||||
# Vagrant boxes aren't normally visible, no need for Plymouth
|
|
||||||
-plymouth
|
|
||||||
# Microcode updates cannot work in a VM
|
|
||||||
-microcode_ctl
|
|
||||||
# Firmware packages are not needed in a VM
|
|
||||||
-iwl100-firmware
|
|
||||||
-iwl1000-firmware
|
|
||||||
-iwl105-firmware
|
|
||||||
-iwl135-firmware
|
|
||||||
-iwl2000-firmware
|
|
||||||
-iwl2030-firmware
|
|
||||||
-iwl3160-firmware
|
|
||||||
-iwl3945-firmware
|
|
||||||
-iwl4965-firmware
|
|
||||||
-iwl5000-firmware
|
|
||||||
-iwl5150-firmware
|
|
||||||
-iwl6000-firmware
|
|
||||||
-iwl6000g2a-firmware
|
|
||||||
-iwl6050-firmware
|
|
||||||
-iwl7260-firmware
|
|
||||||
# Don't build rescue initramfs
|
|
||||||
-dracut-config-rescue
|
|
||||||
%end
|
|
||||||
|
|
||||||
# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only
|
|
||||||
# works on systems with at least 2GB RAM (which excludes most Vagrant boxes)
|
|
||||||
# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169
|
|
||||||
%addon com_redhat_kdump --disable
|
|
||||||
%end
|
|
||||||
|
|
||||||
%post
|
|
||||||
# configure swap to a file
|
|
||||||
fallocate -l 2G /swapfile
|
|
||||||
chmod 600 /swapfile
|
|
||||||
mkswap /swapfile
|
|
||||||
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
|
||||||
|
|
||||||
# sudo
|
|
||||||
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
|
||||||
chmod 0440 /etc/sudoers.d/vagrant
|
|
||||||
|
|
||||||
# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38
|
|
||||||
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
|
||||||
DEVICE="eth0"
|
|
||||||
BOOTPROTO="dhcp"
|
|
||||||
ONBOOT="yes"
|
|
||||||
TYPE="Ethernet"
|
|
||||||
PERSISTENT_DHCLIENT="yes"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# sshd: disable password authentication and DNS checks
|
|
||||||
ex -s /etc/ssh/sshd_config <<EOF
|
|
||||||
:%substitute/^\(PasswordAuthentication\) yes\$/\1 no/
|
|
||||||
:%substitute/^#\(UseDNS\) yes\$/&\r\1 no/
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
cat >>/etc/sysconfig/sshd <<EOF
|
|
||||||
|
|
||||||
# Decrease connection time by preventing reverse DNS lookups
|
|
||||||
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
|
||||||
# and man sshd for more information)
|
|
||||||
OPTIONS="-u0"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Default insecure vagrant key
|
|
||||||
mkdir -m 0700 -p /home/vagrant/.ssh
|
|
||||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
|
|
||||||
chmod 600 /home/vagrant/.ssh/authorized_keys
|
|
||||||
chown -R vagrant:vagrant /home/vagrant/.ssh
|
|
||||||
|
|
||||||
# Fix for issue #76, regular users can gain admin privileges via su
|
|
||||||
ex -s /etc/pam.d/su <<'EOF'
|
|
||||||
# allow vagrant to use su, but prevent others from becoming root or vagrant
|
|
||||||
/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet\$/
|
|
||||||
:append
|
|
||||||
account [success=1 default=ignore] \\
|
|
||||||
pam_succeed_if.so user = vagrant use_uid quiet
|
|
||||||
account required pam_succeed_if.so user notin root:vagrant
|
|
||||||
.
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# systemd should generate a new machine id during the first boot, to
|
|
||||||
# avoid having multiple Vagrant instances with the same id in the local
|
|
||||||
# network. /etc/machine-id should be empty, but it must exist to prevent
|
|
||||||
# boot errors (e.g. systemd-journald failing to start).
|
|
||||||
:>/etc/machine-id
|
|
||||||
|
|
||||||
echo 'vag' > /etc/yum/vars/infra
|
|
||||||
|
|
||||||
# Blacklist the floppy module to avoid probing timeouts
|
|
||||||
echo blacklist floppy > /etc/modprobe.d/nofloppy.conf
|
|
||||||
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf
|
|
||||||
|
|
||||||
# Customize the initramfs
|
|
||||||
pushd /etc/dracut.conf.d
|
|
||||||
# Enable VMware PVSCSI support for VMware Fusion guests.
|
|
||||||
echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf
|
|
||||||
echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf
|
|
||||||
# There's no floppy controller, but probing for it generates timeouts
|
|
||||||
echo 'omit_drivers+=" floppy "' > nofloppy.conf
|
|
||||||
popd
|
|
||||||
# Fix the SELinux context of the new files
|
|
||||||
restorecon -f - <<EOF
|
|
||||||
/etc/sudoers.d/vagrant
|
|
||||||
/etc/dracut.conf.d/vmware-fusion-drivers.conf
|
|
||||||
/etc/dracut.conf.d/hyperv-drivers.conf
|
|
||||||
/etc/dracut.conf.d/nofloppy.conf
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Rerun dracut for the installed kernel (not the running kernel):
|
|
||||||
KERNEL_VERSION=\$(rpm -q kernel --qf '%\{version}-%\{release}.%\{arch}\n')
|
|
||||||
dracut -f /boot/initramfs-\$\{KERNEL_VERSION}.img \$\{KERNEL_VERSION}
|
|
||||||
|
|
||||||
# Seal for deployment
|
|
||||||
rm -rf /etc/ssh/ssh_host_*
|
|
||||||
hostnamectl set-hostname localhost.localdomain
|
|
||||||
rm -rf /etc/udev/rules.d/70-*
|
|
||||||
%end
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
HERPDERP
|
HERPDERP
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
unsupported = set({
|
|
||||||
#"virtualbox-iso.x86_64"
|
|
||||||
})
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:], unsupported)
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
url --metalink=https://mirrors.centos.org/metalink?arch=x86_64&repo=centos-baseos-9-stream
|
||||||
|
repo --name=AppStream --metalink=https://mirrors.centos.org/metalink?arch=x86_64&repo=centos-appstream-9-stream
|
||||||
|
network --bootproto=dhcp --activate
|
||||||
|
reboot
|
||||||
|
|
||||||
|
text
|
||||||
|
keyboard --vckeymap us
|
||||||
|
lang en_US
|
||||||
|
skipx
|
||||||
|
rootpw --plaintext vagrant
|
||||||
|
firewall --disabled
|
||||||
|
timezone --utc UTC
|
||||||
|
services --enabled=vmtoolsd
|
||||||
|
# The biosdevname and ifnames options ensure we get "eth0" as our interface
|
||||||
|
# even in environments like virtualbox that emulate a real NW card
|
||||||
|
bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop"
|
||||||
|
zerombr
|
||||||
|
%include /tmp/disks.ks
|
||||||
|
|
||||||
|
%pre --interpreter /bin/bash --log /tmp/greg
|
||||||
|
if [ -e /dev/vda ]; then
|
||||||
|
disk="vda"
|
||||||
|
else
|
||||||
|
disk="sda"
|
||||||
|
fi
|
||||||
|
echo "clearpart --all --drives=$disk" > /tmp/disks.ks
|
||||||
|
echo "part / --fstype=ext4 --asprimary --size=1024 --grow --ondisk=$disk" >> /tmp/disks.ks
|
||||||
|
%end
|
||||||
|
|
||||||
|
user --name=vagrant --plaintext --password=vagrant
|
||||||
|
|
||||||
|
%packages --inst-langs=en
|
||||||
|
bash-completion
|
||||||
|
man-pages
|
||||||
|
bzip2
|
||||||
|
rsync
|
||||||
|
nfs-utils
|
||||||
|
cifs-utils
|
||||||
|
chrony
|
||||||
|
yum-utils
|
||||||
|
hyperv-daemons
|
||||||
|
open-vm-tools
|
||||||
|
# Vagrant boxes aren't normally visible, no need for Plymouth
|
||||||
|
-plymouth
|
||||||
|
# Microcode updates cannot work in a VM
|
||||||
|
-microcode_ctl
|
||||||
|
# Firmware packages are not needed in a VM
|
||||||
|
-iwl100-firmware
|
||||||
|
-iwl1000-firmware
|
||||||
|
-iwl105-firmware
|
||||||
|
-iwl135-firmware
|
||||||
|
-iwl2000-firmware
|
||||||
|
-iwl2030-firmware
|
||||||
|
-iwl3160-firmware
|
||||||
|
-iwl3945-firmware
|
||||||
|
-iwl4965-firmware
|
||||||
|
-iwl5000-firmware
|
||||||
|
-iwl5150-firmware
|
||||||
|
-iwl6000-firmware
|
||||||
|
-iwl6000g2a-firmware
|
||||||
|
-iwl6050-firmware
|
||||||
|
-iwl7260-firmware
|
||||||
|
# Don't build rescue initramfs
|
||||||
|
-dracut-config-rescue
|
||||||
|
%end
|
||||||
|
|
||||||
|
# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only
|
||||||
|
# works on systems with at least 2GB RAM (which excludes most Vagrant boxes)
|
||||||
|
# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169
|
||||||
|
%addon com_redhat_kdump --disable
|
||||||
|
%end
|
||||||
|
|
||||||
|
%post
|
||||||
|
# configure swap to a file
|
||||||
|
fallocate -l 2G /swapfile
|
||||||
|
chmod 600 /swapfile
|
||||||
|
mkswap /swapfile
|
||||||
|
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
||||||
|
|
||||||
|
# sudo
|
||||||
|
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
||||||
|
chmod 0440 /etc/sudoers.d/vagrant
|
||||||
|
|
||||||
|
# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38
|
||||||
|
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
||||||
|
DEVICE="eth0"
|
||||||
|
BOOTPROTO="dhcp"
|
||||||
|
ONBOOT="yes"
|
||||||
|
TYPE="Ethernet"
|
||||||
|
PERSISTENT_DHCLIENT="yes"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# sshd: disable password authentication and DNS checks
|
||||||
|
ex -s /etc/ssh/sshd_config <<EOF
|
||||||
|
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
|
||||||
|
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
||||||
|
:update
|
||||||
|
:quit
|
||||||
|
EOF
|
||||||
|
cat >>/etc/sysconfig/sshd <<EOF
|
||||||
|
|
||||||
|
# Decrease connection time by preventing reverse DNS lookups
|
||||||
|
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
||||||
|
# and man sshd for more information)
|
||||||
|
OPTIONS="-u0"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Default insecure vagrant key
|
||||||
|
mkdir -m 0700 -p /home/vagrant/.ssh
|
||||||
|
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
|
||||||
|
chmod 600 /home/vagrant/.ssh/authorized_keys
|
||||||
|
chown -R vagrant:vagrant /home/vagrant/.ssh
|
||||||
|
|
||||||
|
# Fix for issue #76, regular users can gain admin privileges via su
|
||||||
|
ex -s /etc/pam.d/su <<'EOF'
|
||||||
|
# allow vagrant to use su, but prevent others from becoming root or vagrant
|
||||||
|
/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/
|
||||||
|
:append
|
||||||
|
account [success=1 default=ignore] \
|
||||||
|
pam_succeed_if.so user = vagrant use_uid quiet
|
||||||
|
account required pam_succeed_if.so user notin root:vagrant
|
||||||
|
.
|
||||||
|
:update
|
||||||
|
:quit
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# systemd should generate a new machine id during the first boot, to
|
||||||
|
# avoid having multiple Vagrant instances with the same id in the local
|
||||||
|
# network. /etc/machine-id should be empty, but it must exist to prevent
|
||||||
|
# boot errors (e.g. systemd-journald failing to start).
|
||||||
|
:>/etc/machine-id
|
||||||
|
|
||||||
|
echo 'vag' > /etc/yum/vars/infra
|
||||||
|
|
||||||
|
# Blacklist the floppy module to avoid probing timeouts
|
||||||
|
echo blacklist floppy > /etc/modprobe.d/nofloppy.conf
|
||||||
|
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf
|
||||||
|
|
||||||
|
# Customize the initramfs
|
||||||
|
pushd /etc/dracut.conf.d
|
||||||
|
# Enable VMware PVSCSI support for VMware Fusion guests.
|
||||||
|
echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf
|
||||||
|
echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf
|
||||||
|
# There's no floppy controller, but probing for it generates timeouts
|
||||||
|
echo 'omit_drivers+=" floppy "' > nofloppy.conf
|
||||||
|
popd
|
||||||
|
# Fix the SELinux context of the new files
|
||||||
|
restorecon -f - <<EOF
|
||||||
|
/etc/sudoers.d/vagrant
|
||||||
|
/etc/dracut.conf.d/vmware-fusion-drivers.conf
|
||||||
|
/etc/dracut.conf.d/hyperv-drivers.conf
|
||||||
|
/etc/dracut.conf.d/nofloppy.conf
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Rerun dracut for the installed kernel (not the running kernel):
|
||||||
|
KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
|
||||||
|
dracut -f /boot/initramfs-${KERNEL_VERSION}.img ${KERNEL_VERSION}
|
||||||
|
|
||||||
|
# Seal for deployment
|
||||||
|
rm -rf /etc/ssh/ssh_host_*
|
||||||
|
hostnamectl set-hostname localhost.localdomain
|
||||||
|
rm -rf /etc/udev/rules.d/70-*
|
||||||
|
%end
|
||||||
|
|
||||||
@@ -2,177 +2,11 @@ distro = "centos"
|
|||||||
version = "9stream"
|
version = "9stream"
|
||||||
iso = {
|
iso = {
|
||||||
url = "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-boot.iso"
|
url = "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-boot.iso"
|
||||||
checksum = "3ccccffb97c30906bc9ca1cb5fc2f07c76db632c0b4e061775155fb397dee1f1"
|
checksum = "be2104d6deac0bf5e52e7262511b7acd3cab0dff96ddef1f2604b2de892e060d"
|
||||||
}
|
}
|
||||||
boot_command = [
|
boot_command = [
|
||||||
"<up><tab><wait><bs><bs><bs><bs><bs>",
|
"<up><tab><wait><bs><bs><bs><bs><bs>",
|
||||||
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
||||||
"<enter><wait>"
|
"<enter><wait>"
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [ "distros/centos-stream/9/disc/*" ]
|
||||||
"ks.cfg" = <<KICKSTART
|
|
||||||
url --metalink=https://mirrors.centos.org/metalink?arch=x86_64&repo=centos-baseos-9-stream
|
|
||||||
repo --name=AppStream --metalink=https://mirrors.centos.org/metalink?arch=x86_64&repo=centos-appstream-9-stream
|
|
||||||
network --bootproto=dhcp --activate
|
|
||||||
reboot
|
|
||||||
|
|
||||||
text
|
|
||||||
keyboard --vckeymap us
|
|
||||||
lang en_US
|
|
||||||
skipx
|
|
||||||
rootpw --plaintext vagrant
|
|
||||||
firewall --disabled
|
|
||||||
timezone --utc UTC
|
|
||||||
services --enabled=vmtoolsd
|
|
||||||
# The biosdevname and ifnames options ensure we get "eth0" as our interface
|
|
||||||
# even in environments like virtualbox that emulate a real NW card
|
|
||||||
bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop"
|
|
||||||
zerombr
|
|
||||||
%include /tmp/disks.ks
|
|
||||||
|
|
||||||
%pre --interpreter /bin/bash --log /tmp/greg
|
|
||||||
if [ -e /dev/vda ]; then
|
|
||||||
disk="vda"
|
|
||||||
else
|
|
||||||
disk="sda"
|
|
||||||
fi
|
|
||||||
echo "clearpart --all --drives=$disk" > /tmp/disks.ks
|
|
||||||
echo "part / --fstype=ext4 --asprimary --size=1024 --grow --ondisk=$disk" >> /tmp/disks.ks
|
|
||||||
%end
|
|
||||||
|
|
||||||
user --name=vagrant --plaintext --password=vagrant
|
|
||||||
|
|
||||||
%packages --inst-langs=en
|
|
||||||
bash-completion
|
|
||||||
man-pages
|
|
||||||
bzip2
|
|
||||||
rsync
|
|
||||||
nfs-utils
|
|
||||||
cifs-utils
|
|
||||||
chrony
|
|
||||||
yum-utils
|
|
||||||
hyperv-daemons
|
|
||||||
open-vm-tools
|
|
||||||
# Vagrant boxes aren't normally visible, no need for Plymouth
|
|
||||||
-plymouth
|
|
||||||
# Microcode updates cannot work in a VM
|
|
||||||
-microcode_ctl
|
|
||||||
# Firmware packages are not needed in a VM
|
|
||||||
-iwl100-firmware
|
|
||||||
-iwl1000-firmware
|
|
||||||
-iwl105-firmware
|
|
||||||
-iwl135-firmware
|
|
||||||
-iwl2000-firmware
|
|
||||||
-iwl2030-firmware
|
|
||||||
-iwl3160-firmware
|
|
||||||
-iwl3945-firmware
|
|
||||||
-iwl4965-firmware
|
|
||||||
-iwl5000-firmware
|
|
||||||
-iwl5150-firmware
|
|
||||||
-iwl6000-firmware
|
|
||||||
-iwl6000g2a-firmware
|
|
||||||
-iwl6050-firmware
|
|
||||||
-iwl7260-firmware
|
|
||||||
# Don't build rescue initramfs
|
|
||||||
-dracut-config-rescue
|
|
||||||
%end
|
|
||||||
|
|
||||||
# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only
|
|
||||||
# works on systems with at least 2GB RAM (which excludes most Vagrant boxes)
|
|
||||||
# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169
|
|
||||||
%addon com_redhat_kdump --disable
|
|
||||||
%end
|
|
||||||
|
|
||||||
%post
|
|
||||||
# configure swap to a file
|
|
||||||
fallocate -l 2G /swapfile
|
|
||||||
chmod 600 /swapfile
|
|
||||||
mkswap /swapfile
|
|
||||||
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
|
||||||
|
|
||||||
# sudo
|
|
||||||
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
|
||||||
chmod 0440 /etc/sudoers.d/vagrant
|
|
||||||
|
|
||||||
# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38
|
|
||||||
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
|
||||||
DEVICE="eth0"
|
|
||||||
BOOTPROTO="dhcp"
|
|
||||||
ONBOOT="yes"
|
|
||||||
TYPE="Ethernet"
|
|
||||||
PERSISTENT_DHCLIENT="yes"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# sshd: disable password authentication and DNS checks
|
|
||||||
ex -s /etc/ssh/sshd_config <<EOF
|
|
||||||
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
|
|
||||||
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
cat >>/etc/sysconfig/sshd <<EOF
|
|
||||||
|
|
||||||
# Decrease connection time by preventing reverse DNS lookups
|
|
||||||
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
|
||||||
# and man sshd for more information)
|
|
||||||
OPTIONS="-u0"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Default insecure vagrant key
|
|
||||||
mkdir -m 0700 -p /home/vagrant/.ssh
|
|
||||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
|
|
||||||
chmod 600 /home/vagrant/.ssh/authorized_keys
|
|
||||||
chown -R vagrant:vagrant /home/vagrant/.ssh
|
|
||||||
|
|
||||||
# Fix for issue #76, regular users can gain admin privileges via su
|
|
||||||
ex -s /etc/pam.d/su <<'EOF'
|
|
||||||
# allow vagrant to use su, but prevent others from becoming root or vagrant
|
|
||||||
/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/
|
|
||||||
:append
|
|
||||||
account [success=1 default=ignore] \
|
|
||||||
pam_succeed_if.so user = vagrant use_uid quiet
|
|
||||||
account required pam_succeed_if.so user notin root:vagrant
|
|
||||||
.
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# systemd should generate a new machine id during the first boot, to
|
|
||||||
# avoid having multiple Vagrant instances with the same id in the local
|
|
||||||
# network. /etc/machine-id should be empty, but it must exist to prevent
|
|
||||||
# boot errors (e.g. systemd-journald failing to start).
|
|
||||||
:>/etc/machine-id
|
|
||||||
|
|
||||||
echo 'vag' > /etc/yum/vars/infra
|
|
||||||
|
|
||||||
# Blacklist the floppy module to avoid probing timeouts
|
|
||||||
echo blacklist floppy > /etc/modprobe.d/nofloppy.conf
|
|
||||||
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf
|
|
||||||
|
|
||||||
# Customize the initramfs
|
|
||||||
pushd /etc/dracut.conf.d
|
|
||||||
# Enable VMware PVSCSI support for VMware Fusion guests.
|
|
||||||
echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf
|
|
||||||
echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf
|
|
||||||
# There's no floppy controller, but probing for it generates timeouts
|
|
||||||
echo 'omit_drivers+=" floppy "' > nofloppy.conf
|
|
||||||
popd
|
|
||||||
# Fix the SELinux context of the new files
|
|
||||||
restorecon -f - <<EOF
|
|
||||||
/etc/sudoers.d/vagrant
|
|
||||||
/etc/dracut.conf.d/vmware-fusion-drivers.conf
|
|
||||||
/etc/dracut.conf.d/hyperv-drivers.conf
|
|
||||||
/etc/dracut.conf.d/nofloppy.conf
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Rerun dracut for the installed kernel (not the running kernel):
|
|
||||||
KERNEL_VERSION=$(rpm -q kernel --qf '%\{version}-%\{release}.%\{arch}\n')
|
|
||||||
dracut -f /boot/initramfs-$\{KERNEL_VERSION}.img $\{KERNEL_VERSION}
|
|
||||||
|
|
||||||
# Seal for deployment
|
|
||||||
rm -rf /etc/ssh/ssh_host_*
|
|
||||||
hostnamectl set-hostname localhost.localdomain
|
|
||||||
rm -rf /etc/udev/rules.d/70-*
|
|
||||||
%end
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -25,171 +25,5 @@ boot_command = [
|
|||||||
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
"inst.text inst.ks=cdrom:/ks.cfg console=tty0",
|
||||||
"<enter><wait>"
|
"<enter><wait>"
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [ "distros/centos-stream/9/disc/*" ]
|
||||||
"ks.cfg" = <<KICKSTART
|
|
||||||
url --metalink=https://mirrors.centos.org/metalink?arch=x86_64&repo=centos-baseos-9-stream
|
|
||||||
repo --name=AppStream --metalink=https://mirrors.centos.org/metalink?arch=x86_64&repo=centos-appstream-9-stream
|
|
||||||
network --bootproto=dhcp --activate
|
|
||||||
reboot
|
|
||||||
|
|
||||||
text
|
|
||||||
keyboard --vckeymap us
|
|
||||||
lang en_US
|
|
||||||
skipx
|
|
||||||
rootpw --plaintext vagrant
|
|
||||||
firewall --disabled
|
|
||||||
timezone --utc UTC
|
|
||||||
services --enabled=vmtoolsd
|
|
||||||
# The biosdevname and ifnames options ensure we get "eth0" as our interface
|
|
||||||
# even in environments like virtualbox that emulate a real NW card
|
|
||||||
bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop"
|
|
||||||
zerombr
|
|
||||||
%include /tmp/disks.ks
|
|
||||||
|
|
||||||
%pre --interpreter /bin/bash --log /tmp/greg
|
|
||||||
if [ -e /dev/vda ]; then
|
|
||||||
disk="vda"
|
|
||||||
else
|
|
||||||
disk="sda"
|
|
||||||
fi
|
|
||||||
echo "clearpart --all --drives=\$disk" > /tmp/disks.ks
|
|
||||||
echo "part / --fstype=ext4 --asprimary --size=1024 --grow --ondisk=\$disk" >> /tmp/disks.ks
|
|
||||||
%end
|
|
||||||
|
|
||||||
user --name=vagrant --plaintext --password=vagrant
|
|
||||||
|
|
||||||
%packages --inst-langs=en
|
|
||||||
bash-completion
|
|
||||||
man-pages
|
|
||||||
bzip2
|
|
||||||
rsync
|
|
||||||
nfs-utils
|
|
||||||
cifs-utils
|
|
||||||
chrony
|
|
||||||
yum-utils
|
|
||||||
hyperv-daemons
|
|
||||||
open-vm-tools
|
|
||||||
# Vagrant boxes aren't normally visible, no need for Plymouth
|
|
||||||
-plymouth
|
|
||||||
# Microcode updates cannot work in a VM
|
|
||||||
-microcode_ctl
|
|
||||||
# Firmware packages are not needed in a VM
|
|
||||||
-iwl100-firmware
|
|
||||||
-iwl1000-firmware
|
|
||||||
-iwl105-firmware
|
|
||||||
-iwl135-firmware
|
|
||||||
-iwl2000-firmware
|
|
||||||
-iwl2030-firmware
|
|
||||||
-iwl3160-firmware
|
|
||||||
-iwl3945-firmware
|
|
||||||
-iwl4965-firmware
|
|
||||||
-iwl5000-firmware
|
|
||||||
-iwl5150-firmware
|
|
||||||
-iwl6000-firmware
|
|
||||||
-iwl6000g2a-firmware
|
|
||||||
-iwl6050-firmware
|
|
||||||
-iwl7260-firmware
|
|
||||||
# Don't build rescue initramfs
|
|
||||||
-dracut-config-rescue
|
|
||||||
%end
|
|
||||||
|
|
||||||
# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only
|
|
||||||
# works on systems with at least 2GB RAM (which excludes most Vagrant boxes)
|
|
||||||
# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169
|
|
||||||
%addon com_redhat_kdump --disable
|
|
||||||
%end
|
|
||||||
|
|
||||||
%post
|
|
||||||
# configure swap to a file
|
|
||||||
fallocate -l 2G /swapfile
|
|
||||||
chmod 600 /swapfile
|
|
||||||
mkswap /swapfile
|
|
||||||
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
|
|
||||||
|
|
||||||
# sudo
|
|
||||||
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
|
|
||||||
chmod 0440 /etc/sudoers.d/vagrant
|
|
||||||
|
|
||||||
# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38
|
|
||||||
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
|
||||||
DEVICE="eth0"
|
|
||||||
BOOTPROTO="dhcp"
|
|
||||||
ONBOOT="yes"
|
|
||||||
TYPE="Ethernet"
|
|
||||||
PERSISTENT_DHCLIENT="yes"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# sshd: disable password authentication and DNS checks
|
|
||||||
ex -s /etc/ssh/sshd_config <<EOF
|
|
||||||
:%substitute/^\(PasswordAuthentication\) yes\$/\1 no/
|
|
||||||
:%substitute/^#\(UseDNS\) yes\$/&\r\1 no/
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
cat >>/etc/sysconfig/sshd <<EOF
|
|
||||||
|
|
||||||
# Decrease connection time by preventing reverse DNS lookups
|
|
||||||
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
|
||||||
# and man sshd for more information)
|
|
||||||
OPTIONS="-u0"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Default insecure vagrant key
|
|
||||||
mkdir -m 0700 -p /home/vagrant/.ssh
|
|
||||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
|
|
||||||
chmod 600 /home/vagrant/.ssh/authorized_keys
|
|
||||||
chown -R vagrant:vagrant /home/vagrant/.ssh
|
|
||||||
|
|
||||||
# Fix for issue #76, regular users can gain admin privileges via su
|
|
||||||
ex -s /etc/pam.d/su <<'EOF'
|
|
||||||
# allow vagrant to use su, but prevent others from becoming root or vagrant
|
|
||||||
/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet\$/
|
|
||||||
:append
|
|
||||||
account [success=1 default=ignore] \\
|
|
||||||
pam_succeed_if.so user = vagrant use_uid quiet
|
|
||||||
account required pam_succeed_if.so user notin root:vagrant
|
|
||||||
.
|
|
||||||
:update
|
|
||||||
:quit
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# systemd should generate a new machine id during the first boot, to
|
|
||||||
# avoid having multiple Vagrant instances with the same id in the local
|
|
||||||
# network. /etc/machine-id should be empty, but it must exist to prevent
|
|
||||||
# boot errors (e.g. systemd-journald failing to start).
|
|
||||||
:>/etc/machine-id
|
|
||||||
|
|
||||||
echo 'vag' > /etc/yum/vars/infra
|
|
||||||
|
|
||||||
# Blacklist the floppy module to avoid probing timeouts
|
|
||||||
echo blacklist floppy > /etc/modprobe.d/nofloppy.conf
|
|
||||||
chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf
|
|
||||||
|
|
||||||
# Customize the initramfs
|
|
||||||
pushd /etc/dracut.conf.d
|
|
||||||
# Enable VMware PVSCSI support for VMware Fusion guests.
|
|
||||||
echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf
|
|
||||||
echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf
|
|
||||||
# There's no floppy controller, but probing for it generates timeouts
|
|
||||||
echo 'omit_drivers+=" floppy "' > nofloppy.conf
|
|
||||||
popd
|
|
||||||
# Fix the SELinux context of the new files
|
|
||||||
restorecon -f - <<EOF
|
|
||||||
/etc/sudoers.d/vagrant
|
|
||||||
/etc/dracut.conf.d/vmware-fusion-drivers.conf
|
|
||||||
/etc/dracut.conf.d/hyperv-drivers.conf
|
|
||||||
/etc/dracut.conf.d/nofloppy.conf
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Rerun dracut for the installed kernel (not the running kernel):
|
|
||||||
KERNEL_VERSION=\$(rpm -q kernel --qf '%\{version}-%\{release}.%\{arch}\n')
|
|
||||||
dracut -f /boot/initramfs-\$\{KERNEL_VERSION}.img \$\{KERNEL_VERSION}
|
|
||||||
|
|
||||||
# Seal for deployment
|
|
||||||
rm -rf /etc/ssh/ssh_host_*
|
|
||||||
hostnamectl set-hostname localhost.localdomain
|
|
||||||
rm -rf /etc/udev/rules.d/70-*
|
|
||||||
%end
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
HERPDERP
|
HERPDERP
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:])
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
install
|
||||||
|
text
|
||||||
|
reboot
|
||||||
|
network --bootproto=dhcp --activate
|
||||||
|
url --url=http://mirror.centos.org/centos/7/os/x86_64/
|
||||||
|
repo --name=updates --baseurl=http://mirror.centos.org/centos/7/updates/x86_64/
|
||||||
|
lang en_US.UTF-8
|
||||||
|
keyboard us
|
||||||
|
timezone --utc Etc/UTC
|
||||||
|
rootpw --plaintext vagrant
|
||||||
|
user --name=vagrant --groups=vagrant --password=vagrant --plaintext
|
||||||
|
zerombr
|
||||||
|
clearpart --all --initlabel
|
||||||
|
autopart --type=plain
|
||||||
|
bootloader --timeout=1
|
||||||
|
|
||||||
|
%packages
|
||||||
|
@core
|
||||||
|
which
|
||||||
|
libselinux-python
|
||||||
|
# mandatory packages in the @core group
|
||||||
|
-btrfs-progs
|
||||||
|
-iprutils
|
||||||
|
-kexec-tools
|
||||||
|
-plymouth
|
||||||
|
# default packages in the @core group
|
||||||
|
-*-firmware
|
||||||
|
-dracut-config-rescue
|
||||||
|
-kernel-tools
|
||||||
|
-libsysfs
|
||||||
|
-microcode_ctl
|
||||||
|
-NetworkManager*
|
||||||
|
-postfix
|
||||||
|
-rdma
|
||||||
|
%end
|
||||||
|
|
||||||
|
%post --erroronfail
|
||||||
|
yum -y update
|
||||||
|
|
||||||
|
cat <<EOF > /etc/sudoers.d/vagrant
|
||||||
|
Defaults:vagrant !requiretty
|
||||||
|
vagrant ALL=(ALL) NOPASSWD: ALL
|
||||||
|
EOF
|
||||||
|
chmod 440 /etc/sudoers.d/vagrant
|
||||||
|
|
||||||
|
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
|
||||||
|
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
|
||||||
|
DEVICE="eth0"
|
||||||
|
BOOTPROTO="dhcp"
|
||||||
|
ONBOOT="yes"
|
||||||
|
TYPE="Ethernet"
|
||||||
|
EOF
|
||||||
|
%end
|
||||||
|
|
||||||
@@ -9,60 +9,4 @@ boot_command = [
|
|||||||
"<bs><bs><bs><bs><bs> inst.ks=cdrom:/ks.cfg console=tty0",
|
"<bs><bs><bs><bs><bs> inst.ks=cdrom:/ks.cfg console=tty0",
|
||||||
"<enter>"
|
"<enter>"
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [ "distros/centos/7/disc/*" ]
|
||||||
"ks.cfg" = <<KICKSTART
|
|
||||||
install
|
|
||||||
text
|
|
||||||
reboot
|
|
||||||
network --bootproto=dhcp --activate
|
|
||||||
url --url=http://mirror.centos.org/centos/7/os/x86_64/
|
|
||||||
repo --name=updates --baseurl=http://mirror.centos.org/centos/7/updates/x86_64/
|
|
||||||
lang en_US.UTF-8
|
|
||||||
keyboard us
|
|
||||||
timezone --utc Etc/UTC
|
|
||||||
rootpw --plaintext vagrant
|
|
||||||
user --name=vagrant --groups=vagrant --password=vagrant --plaintext
|
|
||||||
zerombr
|
|
||||||
clearpart --all --initlabel
|
|
||||||
autopart --type=plain
|
|
||||||
bootloader --timeout=1
|
|
||||||
|
|
||||||
%packages
|
|
||||||
@core
|
|
||||||
which
|
|
||||||
libselinux-python
|
|
||||||
# mandatory packages in the @core group
|
|
||||||
-btrfs-progs
|
|
||||||
-iprutils
|
|
||||||
-kexec-tools
|
|
||||||
-plymouth
|
|
||||||
# default packages in the @core group
|
|
||||||
-*-firmware
|
|
||||||
-dracut-config-rescue
|
|
||||||
-kernel-tools
|
|
||||||
-libsysfs
|
|
||||||
-microcode_ctl
|
|
||||||
-NetworkManager*
|
|
||||||
-postfix
|
|
||||||
-rdma
|
|
||||||
%end
|
|
||||||
|
|
||||||
%post --erroronfail
|
|
||||||
yum -y update
|
|
||||||
|
|
||||||
cat <<EOF > /etc/sudoers.d/vagrant
|
|
||||||
Defaults:vagrant !requiretty
|
|
||||||
vagrant ALL=(ALL) NOPASSWD: ALL
|
|
||||||
EOF
|
|
||||||
chmod 440 /etc/sudoers.d/vagrant
|
|
||||||
|
|
||||||
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
|
|
||||||
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
|
|
||||||
DEVICE="eth0"
|
|
||||||
BOOTPROTO="dhcp"
|
|
||||||
ONBOOT="yes"
|
|
||||||
TYPE="Ethernet"
|
|
||||||
EOF
|
|
||||||
%end
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
unsupported = set({
|
|
||||||
"vagrant-iso.x86_64"
|
|
||||||
})
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:], unsupported)
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
d-i debian-installer/locale string en_US
|
||||||
|
d-i keyboard-configuration/xkb-keymap select us
|
||||||
|
|
||||||
|
d-i passwd/root-password-again password vagrant
|
||||||
|
d-i passwd/root-password password vagrant
|
||||||
|
d-i passwd/user-fullname string vagrant
|
||||||
|
d-i passwd/username string vagrant
|
||||||
|
d-i passwd/user-password password vagrant
|
||||||
|
d-i passwd/user-password-again password vagrant
|
||||||
|
|
||||||
|
d-i time/zone string UTC
|
||||||
|
|
||||||
|
d-i partman-auto/method string regular
|
||||||
|
d-i partman-auto/expert_recipe string \
|
||||||
|
scheme :: \
|
||||||
|
200 0 200 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
$bootable{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ /boot } . \
|
||||||
|
200% 0 200% linux-swap \
|
||||||
|
$primary{ } \
|
||||||
|
method{ swap } \
|
||||||
|
format{ } . \
|
||||||
|
1 0 -1 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ / } .
|
||||||
|
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||||
|
d-i partman/choose_partition select finish
|
||||||
|
d-i partman/confirm boolean true
|
||||||
|
d-i partman/confirm_nooverwrite boolean true
|
||||||
|
|
||||||
|
d-i apt-setup/non-free boolean true
|
||||||
|
d-i apt-setup/contrib boolean true
|
||||||
|
|
||||||
|
tasksel tasksel/first multiselect
|
||||||
|
d-i pkgsel/include string curl openssh-server sudo python3
|
||||||
|
|
||||||
|
d-i grub-installer/bootdev string default
|
||||||
|
|
||||||
|
d-i finish-install/reboot_in_progress note
|
||||||
|
|
||||||
|
d-i preseed/early_command string \
|
||||||
|
sed -i \
|
||||||
|
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
||||||
|
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
||||||
|
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
||||||
|
d-i preseed/late_command string \
|
||||||
|
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
||||||
|
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
||||||
|
chmod 440 /target/etc/sudoers.d/vagrant
|
||||||
@@ -13,65 +13,4 @@ boot_command = [
|
|||||||
"--- net.ifnames=0 biosdevnames=0 ",
|
"--- net.ifnames=0 biosdevnames=0 ",
|
||||||
"<enter>"
|
"<enter>"
|
||||||
]
|
]
|
||||||
http_files = {
|
http_directory = "distros/debian/10/http/"
|
||||||
"/preseed.cfg" = <<KICKSTART
|
|
||||||
d-i debian-installer/locale string en_US
|
|
||||||
d-i keyboard-configuration/xkb-keymap select us
|
|
||||||
|
|
||||||
d-i passwd/root-password-again password vagrant
|
|
||||||
d-i passwd/root-password password vagrant
|
|
||||||
d-i passwd/user-fullname string vagrant
|
|
||||||
d-i passwd/username string vagrant
|
|
||||||
d-i passwd/user-password password vagrant
|
|
||||||
d-i passwd/user-password-again password vagrant
|
|
||||||
|
|
||||||
d-i time/zone string UTC
|
|
||||||
|
|
||||||
d-i partman-auto/method string regular
|
|
||||||
d-i partman-auto/expert_recipe string \
|
|
||||||
scheme :: \
|
|
||||||
200 0 200 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
$bootable{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ /boot } . \
|
|
||||||
200% 0 200% linux-swap \
|
|
||||||
$primary{ } \
|
|
||||||
method{ swap } \
|
|
||||||
format{ } . \
|
|
||||||
1 0 -1 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ / } .
|
|
||||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
|
||||||
d-i partman/choose_partition select finish
|
|
||||||
d-i partman/confirm boolean true
|
|
||||||
d-i partman/confirm_nooverwrite boolean true
|
|
||||||
|
|
||||||
d-i apt-setup/non-free boolean true
|
|
||||||
d-i apt-setup/contrib boolean true
|
|
||||||
|
|
||||||
tasksel tasksel/first multiselect
|
|
||||||
d-i pkgsel/include string curl openssh-server sudo python3
|
|
||||||
|
|
||||||
d-i grub-installer/bootdev string default
|
|
||||||
|
|
||||||
d-i finish-install/reboot_in_progress note
|
|
||||||
|
|
||||||
d-i preseed/early_command string \
|
|
||||||
sed -i \
|
|
||||||
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
|
||||||
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
|
||||||
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
|
||||||
d-i preseed/late_command string \
|
|
||||||
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
|
||||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
|
||||||
chmod 440 /target/etc/sudoers.d/vagrant
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
unsupported = set({
|
|
||||||
"virtualbox-iso.x86_64"
|
|
||||||
})
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:], unsupported)
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
d-i debian-installer/locale string en_US
|
||||||
|
d-i keyboard-configuration/xkb-keymap select us
|
||||||
|
|
||||||
|
d-i passwd/root-password-again password vagrant
|
||||||
|
d-i passwd/root-password password vagrant
|
||||||
|
d-i passwd/user-fullname string vagrant
|
||||||
|
d-i passwd/username string vagrant
|
||||||
|
d-i passwd/user-password password vagrant
|
||||||
|
d-i passwd/user-password-again password vagrant
|
||||||
|
|
||||||
|
d-i time/zone string UTC
|
||||||
|
|
||||||
|
d-i partman-auto/method string regular
|
||||||
|
d-i partman-auto/expert_recipe string \
|
||||||
|
scheme :: \
|
||||||
|
200 0 200 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
$bootable{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ /boot } . \
|
||||||
|
200% 0 200% linux-swap \
|
||||||
|
$primary{ } \
|
||||||
|
method{ swap } \
|
||||||
|
format{ } . \
|
||||||
|
1 0 -1 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ / } .
|
||||||
|
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||||
|
d-i partman/choose_partition select finish
|
||||||
|
d-i partman/confirm boolean true
|
||||||
|
d-i partman/confirm_nooverwrite boolean true
|
||||||
|
|
||||||
|
d-i apt-setup/non-free boolean true
|
||||||
|
d-i apt-setup/contrib boolean true
|
||||||
|
|
||||||
|
tasksel tasksel/first multiselect
|
||||||
|
d-i pkgsel/include string curl openssh-server sudo python3
|
||||||
|
|
||||||
|
d-i grub-installer/bootdev string default
|
||||||
|
|
||||||
|
d-i finish-install/reboot_in_progress note
|
||||||
|
|
||||||
|
d-i preseed/early_command string \
|
||||||
|
sed -i \
|
||||||
|
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
||||||
|
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
||||||
|
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
||||||
|
d-i preseed/late_command string \
|
||||||
|
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
||||||
|
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
||||||
|
chmod 440 /target/etc/sudoers.d/vagrant; \
|
||||||
|
sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces
|
||||||
|
|
||||||
|
#echo '[Match]' >> /target/etc/systemd/network/dhcp.network; \
|
||||||
|
#echo 'Name=en*' >> /target/etc/systemd/network/dhcp.network; \
|
||||||
|
#echo '[Network]' >> /target/etc/systemd/network/dhcp.network; \
|
||||||
|
#echo 'DHCP=yes' >> /target/etc/systemd/network/dhcp.network; \
|
||||||
@@ -13,70 +13,4 @@ boot_command = [
|
|||||||
"--- net.ifnames=0 biosdevnames=0 ",
|
"--- net.ifnames=0 biosdevnames=0 ",
|
||||||
"<enter>"
|
"<enter>"
|
||||||
]
|
]
|
||||||
http_files = {
|
http_directory = "distros/debian/11/http/"
|
||||||
"/preseed.cfg" = <<KICKSTART
|
|
||||||
d-i debian-installer/locale string en_US
|
|
||||||
d-i keyboard-configuration/xkb-keymap select us
|
|
||||||
|
|
||||||
d-i passwd/root-password-again password vagrant
|
|
||||||
d-i passwd/root-password password vagrant
|
|
||||||
d-i passwd/user-fullname string vagrant
|
|
||||||
d-i passwd/username string vagrant
|
|
||||||
d-i passwd/user-password password vagrant
|
|
||||||
d-i passwd/user-password-again password vagrant
|
|
||||||
|
|
||||||
d-i time/zone string UTC
|
|
||||||
|
|
||||||
d-i partman-auto/method string regular
|
|
||||||
d-i partman-auto/expert_recipe string \
|
|
||||||
scheme :: \
|
|
||||||
200 0 200 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
$bootable{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ /boot } . \
|
|
||||||
200% 0 200% linux-swap \
|
|
||||||
$primary{ } \
|
|
||||||
method{ swap } \
|
|
||||||
format{ } . \
|
|
||||||
1 0 -1 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ / } .
|
|
||||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
|
||||||
d-i partman/choose_partition select finish
|
|
||||||
d-i partman/confirm boolean true
|
|
||||||
d-i partman/confirm_nooverwrite boolean true
|
|
||||||
|
|
||||||
d-i apt-setup/non-free boolean true
|
|
||||||
d-i apt-setup/contrib boolean true
|
|
||||||
|
|
||||||
tasksel tasksel/first multiselect
|
|
||||||
d-i pkgsel/include string curl openssh-server sudo python3
|
|
||||||
|
|
||||||
d-i grub-installer/bootdev string default
|
|
||||||
|
|
||||||
d-i finish-install/reboot_in_progress note
|
|
||||||
|
|
||||||
d-i preseed/early_command string \
|
|
||||||
sed -i \
|
|
||||||
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
|
||||||
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
|
||||||
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
|
||||||
d-i preseed/late_command string \
|
|
||||||
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
|
||||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
|
||||||
chmod 440 /target/etc/sudoers.d/vagrant; \
|
|
||||||
sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
#echo '[Match]' >> /target/etc/systemd/network/dhcp.network; \
|
|
||||||
#echo 'Name=en*' >> /target/etc/systemd/network/dhcp.network; \
|
|
||||||
#echo '[Network]' >> /target/etc/systemd/network/dhcp.network; \
|
|
||||||
#echo 'DHCP=yes' >> /target/etc/systemd/network/dhcp.network; \
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
unsupported = set({
|
|
||||||
"virtualbox-iso.x86_64"
|
|
||||||
})
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:], unsupported)
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
d-i auto-install/enable boolean true
|
||||||
|
d-i debian-installer/locale string en_US
|
||||||
|
d-i keyboard-configuration/xkb-keymap select us
|
||||||
|
|
||||||
|
d-i passwd/root-password-again password vagrant
|
||||||
|
d-i passwd/root-password password vagrant
|
||||||
|
d-i passwd/user-fullname string vagrant
|
||||||
|
d-i passwd/username string vagrant
|
||||||
|
d-i passwd/user-password password vagrant
|
||||||
|
d-i passwd/user-password-again password vagrant
|
||||||
|
|
||||||
|
d-i time/zone string UTC
|
||||||
|
|
||||||
|
d-i partman-auto/method string regular
|
||||||
|
d-i partman-auto/expert_recipe string \
|
||||||
|
scheme :: \
|
||||||
|
200 0 200 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
$bootable{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ /boot } . \
|
||||||
|
200% 0 200% linux-swap \
|
||||||
|
$primary{ } \
|
||||||
|
method{ swap } \
|
||||||
|
format{ } . \
|
||||||
|
1 0 -1 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ / } .
|
||||||
|
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||||
|
d-i partman/choose_partition select finish
|
||||||
|
d-i partman/confirm boolean true
|
||||||
|
d-i partman/confirm_nooverwrite boolean true
|
||||||
|
|
||||||
|
d-i apt-setup/non-free boolean true
|
||||||
|
d-i apt-setup/contrib boolean true
|
||||||
|
|
||||||
|
tasksel tasksel/first multiselect
|
||||||
|
d-i pkgsel/include string curl openssh-server sudo python3
|
||||||
|
|
||||||
|
d-i grub-installer/bootdev string default
|
||||||
|
|
||||||
|
d-i finish-install/reboot_in_progress note
|
||||||
|
|
||||||
|
d-i preseed/early_command string \
|
||||||
|
sed -i \
|
||||||
|
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
||||||
|
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
||||||
|
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
||||||
|
d-i preseed/late_command string \
|
||||||
|
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
||||||
|
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
||||||
|
chmod 440 /target/etc/sudoers.d/vagrant
|
||||||
@@ -13,66 +13,4 @@ boot_command = [
|
|||||||
"--- net.ifnames=0 biosdevnames=0 ",
|
"--- net.ifnames=0 biosdevnames=0 ",
|
||||||
"<enter>"
|
"<enter>"
|
||||||
]
|
]
|
||||||
http_files = {
|
http_directory = "distros/debian/12/http/"
|
||||||
"/preseed.cfg" = <<KICKSTART
|
|
||||||
d-i auto-install/enable boolean true
|
|
||||||
d-i debian-installer/locale string en_US
|
|
||||||
d-i keyboard-configuration/xkb-keymap select us
|
|
||||||
|
|
||||||
d-i passwd/root-password-again password vagrant
|
|
||||||
d-i passwd/root-password password vagrant
|
|
||||||
d-i passwd/user-fullname string vagrant
|
|
||||||
d-i passwd/username string vagrant
|
|
||||||
d-i passwd/user-password password vagrant
|
|
||||||
d-i passwd/user-password-again password vagrant
|
|
||||||
|
|
||||||
d-i time/zone string UTC
|
|
||||||
|
|
||||||
d-i partman-auto/method string regular
|
|
||||||
d-i partman-auto/expert_recipe string \
|
|
||||||
scheme :: \
|
|
||||||
200 0 200 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
$bootable{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ /boot } . \
|
|
||||||
200% 0 200% linux-swap \
|
|
||||||
$primary{ } \
|
|
||||||
method{ swap } \
|
|
||||||
format{ } . \
|
|
||||||
1 0 -1 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ / } .
|
|
||||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
|
||||||
d-i partman/choose_partition select finish
|
|
||||||
d-i partman/confirm boolean true
|
|
||||||
d-i partman/confirm_nooverwrite boolean true
|
|
||||||
|
|
||||||
d-i apt-setup/non-free boolean true
|
|
||||||
d-i apt-setup/contrib boolean true
|
|
||||||
|
|
||||||
tasksel tasksel/first multiselect
|
|
||||||
d-i pkgsel/include string curl openssh-server sudo python3
|
|
||||||
|
|
||||||
d-i grub-installer/bootdev string default
|
|
||||||
|
|
||||||
d-i finish-install/reboot_in_progress note
|
|
||||||
|
|
||||||
d-i preseed/early_command string \
|
|
||||||
sed -i \
|
|
||||||
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
|
||||||
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
|
||||||
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
|
||||||
d-i preseed/late_command string \
|
|
||||||
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
|
||||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
|
||||||
chmod 440 /target/etc/sudoers.d/vagrant
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
unsupported = set({
|
|
||||||
"virtualbox-iso.x86_64"
|
|
||||||
})
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:], unsupported)
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
d-i mirror/country string manual
|
||||||
|
d-i mirror/http/hostname string archive.kernel.org
|
||||||
|
d-i mirror/http/directory string /debian-archive/debian
|
||||||
|
|
||||||
|
d-i apt-setup/security_host string archive.kernel.org/debian-archive
|
||||||
|
|
||||||
|
d-i netcfg/hostname string vagrant
|
||||||
|
|
||||||
|
d-i debian-installer/locale string en_US
|
||||||
|
d-i keyboard-configuration/xkb-keymap select us
|
||||||
|
|
||||||
|
d-i passwd/root-password-again password vagrant
|
||||||
|
d-i passwd/root-password password vagrant
|
||||||
|
d-i passwd/user-fullname string vagrant
|
||||||
|
d-i passwd/username string vagrant
|
||||||
|
d-i passwd/user-password password vagrant
|
||||||
|
d-i passwd/user-password-again password vagrant
|
||||||
|
|
||||||
|
d-i time/zone string UTC
|
||||||
|
|
||||||
|
d-i partman-auto/method string regular
|
||||||
|
d-i partman-auto/expert_recipe string \
|
||||||
|
scheme :: \
|
||||||
|
200 0 200 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
$bootable{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ /boot } . \
|
||||||
|
200% 0 200% linux-swap \
|
||||||
|
$primary{ } \
|
||||||
|
method{ swap } \
|
||||||
|
format{ } . \
|
||||||
|
1 0 -1 ext4 \
|
||||||
|
$primary{ } \
|
||||||
|
method{ format } \
|
||||||
|
format{ } \
|
||||||
|
use_filesystem{ } \
|
||||||
|
filesystem{ ext4 } \
|
||||||
|
mountpoint{ / } .
|
||||||
|
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||||
|
d-i partman/choose_partition select finish
|
||||||
|
d-i partman/confirm boolean true
|
||||||
|
d-i partman/confirm_nooverwrite boolean true
|
||||||
|
|
||||||
|
d-i apt-setup/non-free boolean true
|
||||||
|
d-i apt-setup/contrib boolean true
|
||||||
|
|
||||||
|
tasksel tasksel/first multiselect
|
||||||
|
d-i pkgsel/include string curl openssh-server sudo python3
|
||||||
|
|
||||||
|
d-i grub-installer/bootdev string default
|
||||||
|
|
||||||
|
d-i finish-install/reboot_in_progress note
|
||||||
|
|
||||||
|
d-i preseed/early_command string \
|
||||||
|
sed -i \
|
||||||
|
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
||||||
|
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
||||||
|
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
||||||
|
d-i preseed/late_command string \
|
||||||
|
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
||||||
|
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
||||||
|
chmod 440 /target/etc/sudoers.d/vagrant
|
||||||
@@ -15,74 +15,4 @@ boot_command = [
|
|||||||
"net.ifnames=0 ",
|
"net.ifnames=0 ",
|
||||||
"<enter>"
|
"<enter>"
|
||||||
]
|
]
|
||||||
http_files = {
|
http_directory = "distros/debian/9/http/"
|
||||||
"/preseed.cfg" = <<KICKSTART
|
|
||||||
d-i mirror/country string manual
|
|
||||||
d-i mirror/http/hostname string archive.kernel.org
|
|
||||||
d-i mirror/http/directory string /debian-archive/debian
|
|
||||||
|
|
||||||
d-i apt-setup/security_host string archive.kernel.org/debian-archive
|
|
||||||
|
|
||||||
d-i netcfg/hostname string vagrant
|
|
||||||
|
|
||||||
d-i debian-installer/locale string en_US
|
|
||||||
d-i keyboard-configuration/xkb-keymap select us
|
|
||||||
|
|
||||||
d-i passwd/root-password-again password vagrant
|
|
||||||
d-i passwd/root-password password vagrant
|
|
||||||
d-i passwd/user-fullname string vagrant
|
|
||||||
d-i passwd/username string vagrant
|
|
||||||
d-i passwd/user-password password vagrant
|
|
||||||
d-i passwd/user-password-again password vagrant
|
|
||||||
|
|
||||||
d-i time/zone string UTC
|
|
||||||
|
|
||||||
d-i partman-auto/method string regular
|
|
||||||
d-i partman-auto/expert_recipe string \
|
|
||||||
scheme :: \
|
|
||||||
200 0 200 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
$bootable{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ /boot } . \
|
|
||||||
200% 0 200% linux-swap \
|
|
||||||
$primary{ } \
|
|
||||||
method{ swap } \
|
|
||||||
format{ } . \
|
|
||||||
1 0 -1 ext4 \
|
|
||||||
$primary{ } \
|
|
||||||
method{ format } \
|
|
||||||
format{ } \
|
|
||||||
use_filesystem{ } \
|
|
||||||
filesystem{ ext4 } \
|
|
||||||
mountpoint{ / } .
|
|
||||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
|
||||||
d-i partman/choose_partition select finish
|
|
||||||
d-i partman/confirm boolean true
|
|
||||||
d-i partman/confirm_nooverwrite boolean true
|
|
||||||
|
|
||||||
d-i apt-setup/non-free boolean true
|
|
||||||
d-i apt-setup/contrib boolean true
|
|
||||||
|
|
||||||
tasksel tasksel/first multiselect
|
|
||||||
d-i pkgsel/include string curl openssh-server sudo python3
|
|
||||||
|
|
||||||
d-i grub-installer/bootdev string default
|
|
||||||
|
|
||||||
d-i finish-install/reboot_in_progress note
|
|
||||||
|
|
||||||
d-i preseed/early_command string \
|
|
||||||
sed -i \
|
|
||||||
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
|
||||||
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
|
||||||
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
|
||||||
d-i preseed/late_command string \
|
|
||||||
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
|
||||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
|
||||||
chmod 440 /target/etc/sudoers.d/vagrant
|
|
||||||
|
|
||||||
KICKSTART
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env xonsh
|
|
||||||
$RAISE_SUBPROC_ERROR = True
|
|
||||||
from pathlib import Path
|
|
||||||
import sys
|
|
||||||
self = Path(__file__).absolute()
|
|
||||||
base = self.parent.parent.parent.parent
|
|
||||||
source @(base / "test.xsh")
|
|
||||||
|
|
||||||
|
|
||||||
opts = get_parser(sys.argv[1:])
|
|
||||||
|
|
||||||
cd @(str(base))
|
|
||||||
for provider in opts["providers"]:
|
|
||||||
packer build -var=@(opts["headless"]) -var-file=@(self.parent / "x86_64.pkrvars.hcl") @(opts["upload"]) -only=@(provider) @(base / "sources")
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#cloud-config
|
||||||
|
# vim: set ft=yaml:
|
||||||
|
autoinstall:
|
||||||
|
version: 1
|
||||||
|
network: # Should disable networking, workaround for unattended-updates failing in install
|
||||||
|
version: 2
|
||||||
|
ethernets:
|
||||||
|
eth0:
|
||||||
|
match:
|
||||||
|
name: e*
|
||||||
|
dhcp4: yes
|
||||||
|
dhcp6: no
|
||||||
|
refresh-installer:
|
||||||
|
update: no
|
||||||
|
keyboard:
|
||||||
|
layout: us
|
||||||
|
toggle: null
|
||||||
|
variant: ''
|
||||||
|
locale: en_US.UTF-8
|
||||||
|
identity:
|
||||||
|
hostname: vagrant
|
||||||
|
username: vagrant
|
||||||
|
password: $6$rounds=4096$mJTRlY/vwPMquLe0$s4Ld3ZnvF.pM86xzbAgQD7Xpi/NMVgyQNb5CEfabFgL6nLRsP56WtwA.o.Jg/xC6HaJmM2p5fCGIo37jmKVRI0
|
||||||
|
ssh:
|
||||||
|
install-server: yes
|
||||||
|
authorized_keys:
|
||||||
|
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
||||||
|
allow-pw: yes
|
||||||
|
user-data:
|
||||||
|
disable_root: false
|
||||||
|
package_update: false # These will be done by Ansible after install
|
||||||
|
package_upgrade: false
|
||||||
|
late-commands:
|
||||||
|
- echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant
|
||||||
|
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /target/etc/sudoers.d/vagrant
|
||||||
|
- chmod 440 /target/etc/sudoers.d/vagrant
|
||||||
|
- curtin in-target --target=/target -- logger "finished late-commands"
|
||||||
|
packages:
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- sudo
|
||||||
@@ -14,49 +14,6 @@ boot_command = [
|
|||||||
"priority=critical ",
|
"priority=critical ",
|
||||||
"autoinstall ds=nocloud<enter><wait>"
|
"autoinstall ds=nocloud<enter><wait>"
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [
|
||||||
"/meta-data" = ""
|
"distros/ubuntu/20.04/disc/*"
|
||||||
"/user-data" = <<HEREDOC
|
]
|
||||||
#cloud-config
|
|
||||||
# vim: set ft=yaml:
|
|
||||||
autoinstall:
|
|
||||||
version: 1
|
|
||||||
network: # Should disable networking, workaround for unattended-updates failing in install
|
|
||||||
version: 2
|
|
||||||
ethernets:
|
|
||||||
eth0:
|
|
||||||
match:
|
|
||||||
name: e*
|
|
||||||
dhcp4: yes
|
|
||||||
dhcp6: no
|
|
||||||
refresh-installer:
|
|
||||||
update: no
|
|
||||||
keyboard:
|
|
||||||
layout: us
|
|
||||||
toggle: null
|
|
||||||
variant: ''
|
|
||||||
locale: en_US.UTF-8
|
|
||||||
identity:
|
|
||||||
hostname: vagrant
|
|
||||||
username: vagrant
|
|
||||||
password: $6$rounds=4096$mJTRlY/vwPMquLe0$s4Ld3ZnvF.pM86xzbAgQD7Xpi/NMVgyQNb5CEfabFgL6nLRsP56WtwA.o.Jg/xC6HaJmM2p5fCGIo37jmKVRI0
|
|
||||||
ssh:
|
|
||||||
install-server: yes
|
|
||||||
authorized_keys:
|
|
||||||
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
|
||||||
allow-pw: yes
|
|
||||||
user-data:
|
|
||||||
disable_root: false
|
|
||||||
package_update: false # These will be done by Ansible after install
|
|
||||||
package_upgrade: false
|
|
||||||
late-commands:
|
|
||||||
- echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant
|
|
||||||
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /target/etc/sudoers.d/vagrant
|
|
||||||
- chmod 440 /target/etc/sudoers.d/vagrant
|
|
||||||
- curtin in-target --target=/target -- logger "finished late-commands"
|
|
||||||
packages:
|
|
||||||
- ca-certificates
|
|
||||||
- curl
|
|
||||||
- sudo
|
|
||||||
HEREDOC
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#cloud-config
|
||||||
|
# vim: set ft=yaml:
|
||||||
|
autoinstall:
|
||||||
|
version: 1
|
||||||
|
network: # Should disable networking, workaround for unattended-updates failing in install
|
||||||
|
version: 2
|
||||||
|
ethernets:
|
||||||
|
eth0:
|
||||||
|
match:
|
||||||
|
name: e*
|
||||||
|
dhcp4: yes
|
||||||
|
dhcp6: no
|
||||||
|
refresh-installer:
|
||||||
|
update: no
|
||||||
|
keyboard:
|
||||||
|
layout: us
|
||||||
|
toggle: null
|
||||||
|
variant: ''
|
||||||
|
locale: en_US.UTF-8
|
||||||
|
identity:
|
||||||
|
hostname: vagrant
|
||||||
|
username: vagrant
|
||||||
|
password: $6$rounds=4096$mJTRlY/vwPMquLe0$s4Ld3ZnvF.pM86xzbAgQD7Xpi/NMVgyQNb5CEfabFgL6nLRsP56WtwA.o.Jg/xC6HaJmM2p5fCGIo37jmKVRI0
|
||||||
|
ssh:
|
||||||
|
install-server: yes
|
||||||
|
authorized_keys:
|
||||||
|
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
||||||
|
allow-pw: yes
|
||||||
|
user-data:
|
||||||
|
disable_root: false
|
||||||
|
package_update: false
|
||||||
|
package_upgrade: false
|
||||||
|
late-commands:
|
||||||
|
- echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant
|
||||||
|
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /target/etc/sudoers.d/vagrant
|
||||||
|
- chmod 440 /target/etc/sudoers.d/vagrant
|
||||||
|
- curtin in-target --target=/target -- logger "finished late-commands"
|
||||||
|
packages:
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- sudo
|
||||||
@@ -14,49 +14,6 @@ boot_command = [
|
|||||||
"autoinstall",
|
"autoinstall",
|
||||||
"<F10>",
|
"<F10>",
|
||||||
]
|
]
|
||||||
cd_files = {
|
cd_files = [
|
||||||
"/meta-data" = ""
|
"distros/ubuntu/22.04/disc/*"
|
||||||
"/user-data" = <<HEREDOC
|
]
|
||||||
#cloud-config
|
|
||||||
# vim: set ft=yaml:
|
|
||||||
autoinstall:
|
|
||||||
version: 1
|
|
||||||
network: # Should disable networking, workaround for unattended-updates failing in install
|
|
||||||
version: 2
|
|
||||||
ethernets:
|
|
||||||
eth0:
|
|
||||||
match:
|
|
||||||
name: e*
|
|
||||||
dhcp4: yes
|
|
||||||
dhcp6: no
|
|
||||||
refresh-installer:
|
|
||||||
update: no
|
|
||||||
keyboard:
|
|
||||||
layout: us
|
|
||||||
toggle: null
|
|
||||||
variant: ''
|
|
||||||
locale: en_US.UTF-8
|
|
||||||
identity:
|
|
||||||
hostname: vagrant
|
|
||||||
username: vagrant
|
|
||||||
password: $6$rounds=4096$mJTRlY/vwPMquLe0$s4Ld3ZnvF.pM86xzbAgQD7Xpi/NMVgyQNb5CEfabFgL6nLRsP56WtwA.o.Jg/xC6HaJmM2p5fCGIo37jmKVRI0
|
|
||||||
ssh:
|
|
||||||
install-server: yes
|
|
||||||
authorized_keys:
|
|
||||||
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
|
||||||
allow-pw: yes
|
|
||||||
user-data:
|
|
||||||
disable_root: false
|
|
||||||
package_update: false
|
|
||||||
package_upgrade: false
|
|
||||||
late-commands:
|
|
||||||
- echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant
|
|
||||||
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /target/etc/sudoers.d/vagrant
|
|
||||||
- chmod 440 /target/etc/sudoers.d/vagrant
|
|
||||||
- curtin in-target --target=/target -- logger "finished late-commands"
|
|
||||||
packages:
|
|
||||||
- ca-certificates
|
|
||||||
- curl
|
|
||||||
- sudo
|
|
||||||
HEREDOC
|
|
||||||
}
|
|
||||||
|
|||||||
+11
-1
@@ -49,11 +49,16 @@ variable "build" {
|
|||||||
default = "0.1"
|
default = "0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "cd_files" {
|
variable "cd_content" {
|
||||||
type = map(string)
|
type = map(string)
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "cd_files" {
|
||||||
|
type = list(string)
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
variable "cd_label" {
|
variable "cd_label" {
|
||||||
type = string
|
type = string
|
||||||
default = "cidata"
|
default = "cidata"
|
||||||
@@ -64,6 +69,11 @@ variable "http_files" {
|
|||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "http_directory" {
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
name = "${var.distro}-${var.version}-${var.arch}"
|
name = "${var.distro}-${var.version}-${var.arch}"
|
||||||
description = templatefile("../README.box.md", {
|
description = templatefile("../README.box.md", {
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ source "qemu" "x86_64" {
|
|||||||
accelerator = var.qemu_accelerator
|
accelerator = var.qemu_accelerator
|
||||||
|
|
||||||
http_content = var.http_files
|
http_content = var.http_files
|
||||||
cd_content = var.cd_files
|
http_directory = var.http_directory
|
||||||
|
cd_content = var.cd_content
|
||||||
|
cd_files = var.cd_files
|
||||||
cd_label = var.cd_label
|
cd_label = var.cd_label
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ source "virtualbox-iso" "x86_64" {
|
|||||||
]
|
]
|
||||||
|
|
||||||
http_content = var.http_files
|
http_content = var.http_files
|
||||||
cd_content = var.cd_files
|
http_directory = var.http_directory
|
||||||
|
cd_content = var.cd_content
|
||||||
|
cd_files = var.cd_files
|
||||||
cd_label = var.cd_label
|
cd_label = var.cd_label
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def main():
|
|||||||
#$RAISE_SUBPROC_ERROR = True
|
#$RAISE_SUBPROC_ERROR = True
|
||||||
for box in g`*.box`:
|
for box in g`*.box`:
|
||||||
sed -e f's#@@BOX@@#file:///home/greg/src/vms/vms/{box}#' -e f's/@@BOX_NAME@@/{box}/' Vagrantfile.in > Vagrantfile
|
sed -e f's#@@BOX@@#file:///home/greg/src/vms/vms/{box}#' -e f's/@@BOX_NAME@@/{box}/' Vagrantfile.in > Vagrantfile
|
||||||
vagrant up --provider libvirt
|
vagrant up --provider virtualbox
|
||||||
vagrant destroy -f
|
vagrant destroy -f
|
||||||
rm -rf .vagrant
|
rm -rf .vagrant
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user