Browse Source

[init]

master
alban 2 years ago
commit
b3572e8ace
5 changed files with 176 additions and 0 deletions
  1. 9
    0
      .gitignore
  2. 91
    0
      build.json
  3. 11
    0
      files/lxc/config
  4. 6
    0
      files/supervisor-syncthing.conf
  5. 59
    0
      http/preseed.cfg

+ 9
- 0
.gitignore View File

@@ -0,0 +1,9 @@
1
+nbproject
2
+*~
3
+*.swp
4
+*.swo
5
+*.lock
6
+.~lock*
7
+output
8
+packer*
9
+packer_cache

+ 91
- 0
build.json View File

@@ -0,0 +1,91 @@
1
+{
2
+  "variables": {
3
+        "user": "root",
4
+        "password": "laser",
5
+        "disk_size": "100000",
6
+        "domain": ""
7
+    },
8
+  "builders": [
9
+
10
+
11
+    {
12
+      "type": "lxc",
13
+      "name": "buster-lxc",
14
+      "config_file": "files/lxc/config",
15
+      "template_name": "debian",
16
+      "template_environment_vars": ["SUITE=buster"],
17
+      "output_directory": "output"
18
+    },
19
+
20
+
21
+    {
22
+
23
+            "headless": false,
24
+            "name": "buster-kvm",
25
+            "type": "qemu",
26
+            "format": "qcow2",
27
+            "accelerator": "kvm",
28
+            "disk_size": "{{ user `disk_size` }}",
29
+            "output_directory": "output",
30
+            "boot_key_interval": "20ms",
31
+            "iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso",
32
+            "iso_checksum": "sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7",
33
+            "http_directory": "http",
34
+            "ssh_username": "{{ user `user` }}",
35
+            "ssh_password": "{{ user `password` }}",
36
+            "shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now",
37
+
38
+            "ssh_wait_timeout": "60m",
39
+              "qemuargs": [
40
+                  [ "-m", "2048M" ]
41
+              ],
42
+
43
+            "boot_wait": "2s",
44
+            "boot_command": [
45
+                   "<esc><wait><wait>",
46
+                   "install ",
47
+                   "auto=true ",
48
+                   "priority=critical ",
49
+                   "interface=auto ",
50
+                   "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
51
+                   "<enter>"
52
+            ]
53
+        }
54
+  ],
55
+
56
+  "provisioners": [
57
+    {
58
+      "type": "shell",
59
+      "inline": [
60
+        "sleep 3",
61
+        "apt update",
62
+        "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 ",
63
+        "pip3 install  DMXEnttecPro  mido  numpy  pygame==1.9.2  pysimpledmx  python-rtmidi  redis  scipy "
64
+      ]
65
+    },
66
+    {
67
+      "type": "file",
68
+      "source": "files/supervisor-syncthing.conf",
69
+      "destination": "/etc/supervisor/conf.d/supervisor-syncthing.conf"
70
+    },
71
+    {
72
+      "type": "shell",
73
+      "inline": [
74
+        "git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install "
75
+      ]
76
+    },
77
+
78
+    {
79
+      "type": "shell",
80
+      "inline": [
81
+        "cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . "
82
+      ]
83
+    },
84
+    {
85
+      "type": "shell",
86
+      "inline": [
87
+        "cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . "
88
+      ]
89
+    }
90
+  ]
91
+}

+ 11
- 0
files/lxc/config View File

@@ -0,0 +1,11 @@
1
+arch: amd64
2
+cores: 1
3
+hostname: alternc
4
+memory: 1024
5
+ostype: debian
6
+swap: 512
7
+lxc.log.level: 1
8
+lxc.net.0.type = veth
9
+lxc.net.0.link = lxcbr0
10
+lxc.net.0.flags = up
11
+

+ 6
- 0
files/supervisor-syncthing.conf View File

@@ -0,0 +1,6 @@
1
+[program:syncthing]
2
+autorestart = True
3
+directory = /home/teamlaser15/codesync
4
+user = teamlaser15
5
+command = /usr/bin/syncthing -no-browser -home="/home/teamlaser15/codesync/.config/syncthing"
6
+environment = STNORESTART="1", HOME="/home/teamlaser15/codesync/"

+ 59
- 0
http/preseed.cfg View File

@@ -0,0 +1,59 @@
1
+choose-mirror-bin mirror/http/proxy string
2
+
3
+# Preseeding only locale sets language, country and locale.
4
+d-i debian-installer/locale string en_US
5
+
6
+# Keyboard selection.
7
+d-i console-setup/ask_detect boolean false
8
+d-i keyboard-configuration/xkb-keymap select fr 
9
+
10
+d-i apt-setup/use_mirror boolean true
11
+d-i base-installer/kernel/override-image string linux-server
12
+d-i clock-setup/utc boolean true
13
+d-i clock-setup/utc-auto boolean true
14
+d-i finish-install/reboot_in_progress note
15
+d-i grub-installer/only_debian boolean true
16
+d-i grub-installer/with_other_os boolean true
17
+d-i grub-installer/bootdev string /dev/vda
18
+d-i keymap select us
19
+d-i mirror/country string manual
20
+d-i mirror/http/directory string /debian
21
+d-i mirror/http/hostname string httpredir.debian.org
22
+d-i mirror/http/proxy string
23
+d-i partman-auto-lvm/guided_size string max
24
+d-i partman-auto/choose_recipe select atomic
25
+d-i partman-auto/method string lvm
26
+d-i partman-lvm/confirm boolean true
27
+d-i partman-lvm/confirm boolean true
28
+d-i partman-lvm/confirm_nooverwrite boolean true
29
+d-i partman-lvm/device_remove_lvm boolean true
30
+d-i partman/choose_partition select finish
31
+d-i partman/confirm boolean true
32
+d-i partman/confirm_nooverwrite boolean true
33
+d-i partman/confirm_write_new_label boolean true
34
+d-i passwd/root-login boolean true 
35
+d-i passwd/root-password-again password laser
36
+d-i passwd/root-password password laser
37
+d-i passwd/user-fullname string laser
38
+d-i passwd/user-uid string 1000
39
+d-i passwd/user-password password laser
40
+d-i passwd/user-password-again password laser
41
+d-i passwd/username string laser
42
+d-i pkgsel/include string sudo bzip2 acpid cryptsetup zlib1g-dev wget curl dkms fuse make nfs-common net-tools cifs-utils rsync
43
+d-i pkgsel/install-language-support boolean false
44
+d-i pkgsel/update-policy select none
45
+d-i pkgsel/upgrade select full-upgrade
46
+# Prevent packaged version of VirtualBox Guest Additions being installed:
47
+d-i preseed/early_command string sed -i \
48
+  '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \
49
+  /usr/lib/pre-pkgsel.d/20install-hwpackages
50
+d-i time/zone string UTC
51
+d-i user-setup/allow-password-weak boolean true
52
+d-i user-setup/encrypt-home boolean false
53
+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
54
+
55
+d-i openssh-server/permit-root-login boolean true
56
+apt-cdrom-setup apt-setup/cdrom/set-first boolean false
57
+apt-mirror-setup apt-setup/use_mirror boolean true
58
+popularity-contest popularity-contest/participate boolean false
59
+tasksel tasksel/first multiselect standard, ssh-server

Loading…
Cancel
Save