From b3572e8ace790542170fe400c3deffc92585d073 Mon Sep 17 00:00:00 2001 From: alban Date: Mon, 21 Sep 2020 19:03:01 +0200 Subject: [PATCH] [init] --- .gitignore | 9 ++++ build.json | 91 +++++++++++++++++++++++++++++++++ files/lxc/config | 11 ++++ files/supervisor-syncthing.conf | 6 +++ http/preseed.cfg | 59 +++++++++++++++++++++ 5 files changed, 176 insertions(+) create mode 100644 .gitignore create mode 100644 build.json create mode 100644 files/lxc/config create mode 100644 files/supervisor-syncthing.conf create mode 100644 http/preseed.cfg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79bbcfd --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +nbproject +*~ +*.swp +*.swo +*.lock +.~lock* +output +packer* +packer_cache diff --git a/build.json b/build.json new file mode 100644 index 0000000..10c23db --- /dev/null +++ b/build.json @@ -0,0 +1,91 @@ +{ + "variables": { + "user": "root", + "password": "laser", + "disk_size": "100000", + "domain": "" + }, + "builders": [ + + + { + "type": "lxc", + "name": "buster-lxc", + "config_file": "files/lxc/config", + "template_name": "debian", + "template_environment_vars": ["SUITE=buster"], + "output_directory": "output" + }, + + + { + + "headless": false, + "name": "buster-kvm", + "type": "qemu", + "format": "qcow2", + "accelerator": "kvm", + "disk_size": "{{ user `disk_size` }}", + "output_directory": "output", + "boot_key_interval": "20ms", + "iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso", + "iso_checksum": "sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7", + "http_directory": "http", + "ssh_username": "{{ user `user` }}", + "ssh_password": "{{ user `password` }}", + "shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now", + + "ssh_wait_timeout": "60m", + "qemuargs": [ + [ "-m", "2048M" ] + ], + + "boot_wait": "2s", + "boot_command": [ + "", + "install ", + "auto=true ", + "priority=critical ", + "interface=auto ", + "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", + "" + ] + } + ], + + "provisioners": [ + { + "type": "shell", + "inline": [ + "sleep 3", + "apt update", + "apt install -y --no-install-recommends git htop libasound2-dev libjack-dev nginx python3-pip redis-server screen ssh syncthing supervisor tmux portaudio19-dev cmake ", + "pip3 install DMXEnttecPro mido numpy pygame==1.9.2 pysimpledmx python-rtmidi redis scipy " + ] + }, + { + "type": "file", + "source": "files/supervisor-syncthing.conf", + "destination": "/etc/supervisor/conf.d/supervisor-syncthing.conf" + }, + { + "type": "shell", + "inline": [ + "git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install " + ] + }, + + { + "type": "shell", + "inline": [ + "cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . " + ] + }, + { + "type": "shell", + "inline": [ + "cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . " + ] + } + ] +} diff --git a/files/lxc/config b/files/lxc/config new file mode 100644 index 0000000..28baa23 --- /dev/null +++ b/files/lxc/config @@ -0,0 +1,11 @@ +arch: amd64 +cores: 1 +hostname: alternc +memory: 1024 +ostype: debian +swap: 512 +lxc.log.level: 1 +lxc.net.0.type = veth +lxc.net.0.link = lxcbr0 +lxc.net.0.flags = up + diff --git a/files/supervisor-syncthing.conf b/files/supervisor-syncthing.conf new file mode 100644 index 0000000..f0374e4 --- /dev/null +++ b/files/supervisor-syncthing.conf @@ -0,0 +1,6 @@ +[program:syncthing] +autorestart = True +directory = /home/teamlaser15/codesync +user = teamlaser15 +command = /usr/bin/syncthing -no-browser -home="/home/teamlaser15/codesync/.config/syncthing" +environment = STNORESTART="1", HOME="/home/teamlaser15/codesync/" diff --git a/http/preseed.cfg b/http/preseed.cfg new file mode 100644 index 0000000..28a1e8d --- /dev/null +++ b/http/preseed.cfg @@ -0,0 +1,59 @@ +choose-mirror-bin mirror/http/proxy string + +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US + +# Keyboard selection. +d-i console-setup/ask_detect boolean false +d-i keyboard-configuration/xkb-keymap select fr + +d-i apt-setup/use_mirror boolean true +d-i base-installer/kernel/override-image string linux-server +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true +d-i grub-installer/with_other_os boolean true +d-i grub-installer/bootdev string /dev/vda +d-i keymap select us +d-i mirror/country string manual +d-i mirror/http/directory string /debian +d-i mirror/http/hostname string httpredir.debian.org +d-i mirror/http/proxy string +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true +d-i passwd/root-login boolean true +d-i passwd/root-password-again password laser +d-i passwd/root-password password laser +d-i passwd/user-fullname string laser +d-i passwd/user-uid string 1000 +d-i passwd/user-password password laser +d-i passwd/user-password-again password laser +d-i passwd/username string laser +d-i pkgsel/include string sudo bzip2 acpid cryptsetup zlib1g-dev wget curl dkms fuse make nfs-common net-tools cifs-utils rsync +d-i pkgsel/install-language-support boolean false +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages +d-i time/zone string UTC +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false +d-i preseed/late_command string sed -i '/^deb cdrom:/s/^/#/' /target/etc/apt/sources.list; sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config + +d-i openssh-server/permit-root-login boolean true +apt-cdrom-setup apt-setup/cdrom/set-first boolean false +apt-mirror-setup apt-setup/use_mirror boolean true +popularity-contest popularity-contest/participate boolean false +tasksel tasksel/first multiselect standard, ssh-server