Skip to content

Commit 60815fc

Browse files
author
ponty
committed
improve test scripts
1 parent ff7ff9c commit 60815fc

File tree

4 files changed

+96
-153
lines changed

4 files changed

+96
-153
lines changed

.github/workflows/main.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
22

3-
name: Python package
3+
name: build
44

55
on:
66
schedule:
@@ -13,8 +13,9 @@ jobs:
1313
build:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
16+
fail-fast: false
1617
matrix:
17-
os: [ubuntu-latest]
18+
os: [ubuntu-20.04]
1819

1920
steps:
2021
- uses: actions/checkout@v2

Vagrantfile

+3-149
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,19 @@
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.
81
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.
152
config.vm.box = "ubuntu/focal64"
163

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.
254
config.vm.network "forwarded_port", guest: 5900, host: 5900
265

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-
#
466
config.vm.provider "virtualbox" do |vb|
477

488
# 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"]
5111

52-
# # Display the VirtualBox GUI when booting the machine
5312
# vb.gui = true
54-
#
55-
# # Customize the amount of memory on the VM:
5613
# vb.memory = "1024"
5714
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
10215

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"
16217

16318
config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"]
164-
16519
end

format-code.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33
autoflake -i -r --remove-all-unused-imports .
44
autoflake -i -r --remove-unused-variables .
5-
isort --recursive .
5+
isort .
66
black .

vagrant.sh

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
export DEBIAN_FRONTEND=noninteractive
3+
# echo 'export distutils_issue8876_workaround_enabled=1' >> /home/vagrant/.profile
4+
sudo update-locale LANG=en_US.UTF-8 LANGUAGE=en.UTF-8
5+
# echo 'export export LC_ALL=C' >> /home/vagrant/.profile
6+
7+
# tools
8+
sudo apt-get update
9+
sudo apt-get install -y mc htop
10+
sudo apt-get install -y evtest
11+
sudo apt-get install -y xvfb
12+
sudo apt-get install -y python3-pip
13+
sudo apt-get install -y libvncserver-dev
14+
sudo apt-get install -y build-essential flex bison
15+
sudo apt-get install -y cmake
16+
sudo apt-get install -y qt5-qmake qt5-default
17+
sudo apt-get install -y linux-source libssl-dev libelf-dev
18+
sudo apt-get install -y fbset fbcat fbterm fbi
19+
sudo apt-get install -y qmlscene
20+
sudo apt-get install -y x11vnc
21+
sudo pip3 install entrypoint2
22+
23+
# fb-test
24+
cd /home/vagrant
25+
git clone https://github.com/ponty/fb-test-app.git
26+
cd fb-test-app
27+
make
28+
cp perf /usr/local/bin
29+
cp rect /usr/local/bin
30+
cp fb-test /usr/local/bin
31+
cp fb-string /usr/local/bin
32+
33+
# vfb
34+
cd /home/vagrant
35+
tar xaf /usr/src/linux-source-*.tar.*
36+
#cd linux-source-*/
37+
mkdir -p vfb && cd vfb
38+
ln -s /home/vagrant/linux-source-*/drivers/video/fbdev/vfb.c vfb.c
39+
ln -s /vagrant/tests/vfb/ins.sh ins.sh
40+
ln -s /vagrant/tests/vfb/Makefile Makefile
41+
make
42+
#./ins.sh
43+
44+
echo '#!/bin/sh
45+
modinfo /home/vagrant/vfb/vfb.ko
46+
modprobe fb_sys_fops
47+
modprobe sysfillrect
48+
modprobe syscopyarea
49+
modprobe sysimgblt
50+
insmod /home/vagrant/vfb/vfb.ko vfb_enable=1 videomemorysize=32000000
51+
' >/usr/local/bin/vfbload.sh
52+
chmod +x /usr/local/bin/vfbload.sh
53+
/usr/local/bin/vfbload.sh >/tmp/vfbload.log 2>&1
54+
55+
echo 'ENV{ID_INPUT_MOUSE}==\"?*\",ENV{ID_PATH}==\"pci-0000:00:04.0\", SYMLINK+=\"input/ms\"' >/etc/udev/rules.d/98-input.rules
56+
echo 'ENV{ID_INPUT_KEYBOARD}==\"?*\", SYMLINK+=\"input/kbd\"' >>/etc/udev/rules.d/98-input.rules
57+
udevadm control --reload-rules
58+
udevadm trigger
59+
60+
echo 'SHELL=/bin/sh
61+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
62+
@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
63+
' >/etc/cron.d/framebuffer-vncserver
64+
65+
# https://askubuntu.com/questions/168279/how-do-i-build-a-single-in-tree-kernel-module
66+
# https://askubuntu.com/questions/515407/how-recipe-to-build-only-one-kernel-module
67+
#cd /usr/src/
68+
#tar xaf linux-source-*.tar.*
69+
#cd linux-source-*/
70+
#make oldconfig # it copies .config to ./
71+
#echo 'CONFIG_FB_VIRTUAL=m' >> .config
72+
#make scripts
73+
#make drivers/video/fbdev/vfb.ko
74+
75+
# cmake build
76+
cd /home/vagrant
77+
mkdir -p buildc && cd buildc
78+
cmake /vagrant
79+
make
80+
81+
# qmake build
82+
cd /home/vagrant
83+
mkdir -p buildq && cd buildq
84+
qmake /vagrant
85+
make
86+
87+
fbset -g 640 480 640 480 16
88+
/home/vagrant/buildc/framebuffer-vncserver -t /dev/input/ms -k /dev/input/kbd >/tmp/framebuffer-vncserver.log 2>&1 &

0 commit comments

Comments
 (0)