-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
36 lines (31 loc) · 1.09 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$script = <<-SCRIPT
# Install required Debian packages.
apt-get update
apt-get install --yes ncurses-dev openjdk-8-jdk-headless
# Get the Kotlin/Native toolchain.
cd /tmp
wget -q https://github.com/JetBrains/kotlin/releases/download/v1.3.30/kotlin-native-linux-1.3.30.tar.gz
tar -xf kotlin-native-linux-1.3.30.tar.gz
export PATH="${PATH}:/tmp/kotlin-native-linux-1.3.30/bin"
# Built the Kotlin/Native application.
cd /vagrant
cinterop -def ncurses.def -o ncurses
kotlinc-native -l ncurses tui.kt -o tui
mv tui.kexe /usr/local/bin/
# Stop getty from running on tty1 and ttyS0.
systemctl disable getty@tty1
systemctl stop getty@tty1
systemctl disable serial-getty@ttyS0
systemctl stop serial-getty@ttyS0
# Configure systemd to start the TUI on boot on tty1 and ttyS0.
cp [email protected] /etc/systemd/system
systemctl enable tui@tty1
systemctl start tui@tty1
systemctl enable tui@ttyS0
systemctl start tui@ttyS0
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"
config.vm.synced_folder ".", "/vagrant", type: "rsync"
config.vm.provision "shell", inline: $script, privileged: true
end