|
1 |
| -# -*- mode: ruby -*- |
2 |
| -# vi: set ft=ruby : |
3 |
| - |
4 |
| -# All Vagrant configuration is done below. The "2" in Vagrant.configure |
5 |
| -# configures the configuration version (we support older styles for |
6 |
| -# backwards compatibility). Please don't change it unless you know what |
7 |
| -# you're doing. |
8 | 1 | Vagrant.configure(2) do |config|
|
9 |
| - # The most common configuration options are documented and commented below. |
10 |
| - # For a complete reference, please see the online documentation at |
11 |
| - # https://docs.vagrantup.com. |
12 |
| - |
13 |
| - # Every Vagrant development environment requires a box. You can search for |
14 |
| - # boxes at https://atlas.hashicorp.com/search. |
15 | 2 | config.vm.box = "ubuntu/focal64"
|
16 | 3 |
|
17 |
| - # Disable automatic box update checking. If you disable this, then |
18 |
| - # boxes will only be checked for updates when the user runs |
19 |
| - # `vagrant box outdated`. This is not recommended. |
20 |
| - # config.vm.box_check_update = false |
21 |
| - |
22 |
| - # Create a forwarded port mapping which allows access to a specific port |
23 |
| - # within the machine from a port on the host machine. In the example below, |
24 |
| - # accessing "localhost:8080" will access port 80 on the guest machine. |
25 | 4 | config.vm.network "forwarded_port", guest: 5900, host: 5900
|
26 | 5 |
|
27 |
| - # Create a private network, which allows host-only access to the machine |
28 |
| - # using a specific IP. |
29 |
| - # config.vm.network "private_network", ip: "192.168.33.10" |
30 |
| - |
31 |
| - # Create a public network, which generally matched to bridged network. |
32 |
| - # Bridged networks make the machine appear as another physical device on |
33 |
| - # your network. |
34 |
| - # config.vm.network "public_network" |
35 |
| - |
36 |
| - # Share an additional folder to the guest VM. The first argument is |
37 |
| - # the path on the host to the actual folder. The second argument is |
38 |
| - # the path on the guest to mount the folder. And the optional third |
39 |
| - # argument is a set of non-required options. |
40 |
| - # config.vm.synced_folder "../data", "/vagrant_data" |
41 |
| - |
42 |
| - # Provider-specific configuration so you can fine-tune various |
43 |
| - # backing providers for Vagrant. These expose provider-specific options. |
44 |
| - # Example for VirtualBox: |
45 |
| - # |
46 | 6 | config.vm.provider "virtualbox" do |vb|
|
47 | 7 |
|
48 | 8 | # https://bugs.launchpad.net/cloud-images/+bug/1829625
|
49 |
| - vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"] |
50 |
| - vb.customize ["modifyvm", :id, "--uartmode1", "file", "./ttyS0.log"] |
| 9 | + # vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"] |
| 10 | + # vb.customize ["modifyvm", :id, "--uartmode1", "file", "./ttyS0.log"] |
51 | 11 |
|
52 |
| - # # Display the VirtualBox GUI when booting the machine |
53 | 12 | # vb.gui = true
|
54 |
| - # |
55 |
| - # # Customize the amount of memory on the VM: |
56 | 13 | # vb.memory = "1024"
|
57 | 14 | end
|
58 |
| - # |
59 |
| - # View the documentation for the provider you are using for more |
60 |
| - # information on available options. |
61 |
| - |
62 |
| - # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies |
63 |
| - # such as FTP and Heroku are also available. See the documentation at |
64 |
| - # https://docs.vagrantup.com/v2/push/atlas.html for more information. |
65 |
| - # config.push.define "atlas" do |push| |
66 |
| - # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" |
67 |
| - # end |
68 |
| - |
69 |
| - # Enable provisioning with a shell script. Additional provisioners such as |
70 |
| - # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the |
71 |
| - # documentation for more information about their specific syntax and use. |
72 |
| - $script = " |
73 |
| - export DEBIAN_FRONTEND=noninteractive |
74 |
| - echo 'export distutils_issue8876_workaround_enabled=1' >> /home/vagrant/.profile |
75 |
| - echo 'export export LC_ALL=C' >> /home/vagrant/.profile |
76 |
| - |
77 |
| - # tools |
78 |
| - sudo apt-get update |
79 |
| - sudo apt-get install -y mc htop |
80 |
| - sudo apt-get install -y evtest |
81 |
| - sudo apt-get install -y xvfb |
82 |
| - sudo apt-get install -y python3-pip |
83 |
| - sudo apt-get install -y libvncserver-dev |
84 |
| - sudo apt-get install -y build-essential flex bison |
85 |
| - sudo apt-get install -y cmake |
86 |
| - sudo apt-get install -y qt5-qmake qt5-default |
87 |
| - sudo apt-get install -y linux-source libssl-dev libelf-dev |
88 |
| - sudo apt-get install -y fbset fbcat fbterm fbi |
89 |
| - sudo apt-get install -y qmlscene |
90 |
| - sudo apt-get install -y x11vnc |
91 |
| - sudo pip3 install entrypoint2 |
92 |
| -
|
93 |
| - # fb-test |
94 |
| - cd /home/vagrant |
95 |
| - git clone https://github.com/ponty/fb-test-app.git |
96 |
| - cd fb-test-app |
97 |
| - make |
98 |
| - cp perf /usr/local/bin |
99 |
| - cp rect /usr/local/bin |
100 |
| - cp fb-test /usr/local/bin |
101 |
| - cp fb-string /usr/local/bin |
102 | 15 |
|
103 |
| - # vfb |
104 |
| - cd /home/vagrant |
105 |
| - tar xaf /usr/src/linux-source-*.tar.* |
106 |
| - #cd linux-source-*/ |
107 |
| - mkdir -p vfb && cd vfb |
108 |
| - ln -s /home/vagrant/linux-source-*/drivers/video/fbdev/vfb.c vfb.c |
109 |
| - ln -s /vagrant/tests/vfb/ins.sh ins.sh |
110 |
| - ln -s /vagrant/tests/vfb/Makefile Makefile |
111 |
| - make |
112 |
| - #./ins.sh |
113 |
| -
|
114 |
| - echo '#!/bin/sh |
115 |
| -modinfo /home/vagrant/vfb/vfb.ko |
116 |
| -modprobe fb_sys_fops |
117 |
| -modprobe sysfillrect |
118 |
| -modprobe syscopyarea |
119 |
| -modprobe sysimgblt |
120 |
| -insmod /home/vagrant/vfb/vfb.ko vfb_enable=1 videomemorysize=32000000 |
121 |
| - ' > /usr/local/bin/vfbload.sh |
122 |
| - chmod +x /usr/local/bin/vfbload.sh |
123 |
| - /usr/local/bin/vfbload.sh > /tmp/vfbload.log 2>&1 |
124 |
| -
|
125 |
| - echo 'ENV{ID_INPUT_MOUSE}==\"?*\",ENV{ID_PATH}==\"pci-0000:00:04.0\", SYMLINK+=\"input/ms\"' > /etc/udev/rules.d/98-input.rules |
126 |
| - echo 'ENV{ID_INPUT_KEYBOARD}==\"?*\", SYMLINK+=\"input/kbd\"' >> /etc/udev/rules.d/98-input.rules |
127 |
| - udevadm control --reload-rules |
128 |
| - udevadm trigger |
129 |
| -
|
130 |
| - echo 'SHELL=/bin/sh |
131 |
| -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
132 |
| -@reboot root vfbload.sh;sleep 0.1;fbset -g 640 480 640 480 16;/home/vagrant/buildc/framebuffer-vncserver -t /dev/input/ms -k /dev/input/kbd > /tmp/framebuffer-vncserver.log 2>&1 |
133 |
| - ' > /etc/cron.d/framebuffer-vncserver |
134 |
| -
|
135 |
| - # https://askubuntu.com/questions/168279/how-do-i-build-a-single-in-tree-kernel-module |
136 |
| - # https://askubuntu.com/questions/515407/how-recipe-to-build-only-one-kernel-module |
137 |
| - #cd /usr/src/ |
138 |
| - #tar xaf linux-source-*.tar.* |
139 |
| - #cd linux-source-*/ |
140 |
| - #make oldconfig # it copies .config to ./ |
141 |
| - #echo 'CONFIG_FB_VIRTUAL=m' >> .config |
142 |
| - #make scripts |
143 |
| - #make drivers/video/fbdev/vfb.ko |
144 |
| -
|
145 |
| -
|
146 |
| - # cmake build |
147 |
| - cd /home/vagrant |
148 |
| - mkdir -p buildc && cd buildc |
149 |
| - cmake /vagrant |
150 |
| - make |
151 |
| - |
152 |
| - # qmake build |
153 |
| - cd /home/vagrant |
154 |
| - mkdir -p buildq && cd buildq |
155 |
| - qmake /vagrant |
156 |
| - make |
157 |
| -
|
158 |
| - fbset -g 640 480 640 480 16 |
159 |
| - /home/vagrant/buildc/framebuffer-vncserver -t /dev/input/ms -k /dev/input/kbd > /tmp/framebuffer-vncserver.log 2>&1 & |
160 |
| - " |
161 |
| - config.vm.provision "shell", inline: $script |
| 16 | + config.vm.provision "shell", path: "vagrant.sh" |
162 | 17 |
|
163 | 18 | config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"]
|
164 |
| - |
165 | 19 | end
|
0 commit comments