-
Notifications
You must be signed in to change notification settings - Fork 4
282 lines (257 loc) · 10 KB
/
main.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: CI
on:
push:
pull_request:
jobs:
build-linux:
strategy:
fail-fast: false
matrix:
container: [ "ubuntu:22.04", "ubuntu:latest", "debian:12", "debian:11", "archlinux:base", "almalinux:8", "almalinux:9", "opensuse/leap", "fedora:40", "fedora:41" ]
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
options: --privileged
steps:
- name: install packages
run: |
uname -a
case "${{ matrix.container }}" in
ubuntu*|debian*)
apt-get update -q
apt-get upgrade -qy
apt-get install -qy make gcc libx11-dev ncurses-dev
;;
archlinux*)
pacman -Syyu --noconfirm make gcc libx11 ncurses
;;
almalinux*)
dnf update -y
dnf install -y make gcc libX11-devel ncurses-devel
;;
opensuse*)
zypper update -y
zypper install -y gzip tar # for actions/checkout@v4
zypper install -y make gcc libX11-devel ncurses-devel
;;
fedora*)
dnf update -y
dnf install -y make gcc libX11-devel ncurses-devel
;;
esac
- uses: actions/checkout@v4
- name: configure and make
run: |
sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
cp src/config.h-linux src/config.h
make
make install
build-linux-qemu:
name: "build-linux qemu"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [386, arm, arm64]
include:
- arch: 386
image: i386/ubuntu:latest
platform: linux/386
- arch: arm
image: arm32v7/ubuntu:latest
platform: linux/arm/v7
- arch: arm64
image: arm64v8/ubuntu:latest
platform: linux/arm64
steps:
- uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.arch }}
- name: Run build process with Docker
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.image }}
options: |
--privileged
--platform ${{ matrix.platform }}
--volume ${{ github.workspace }}:/build
--workdir /build
run: |
uname -a
apt-get update -q
apt-get upgrade -qy
apt-get install -qy make gcc libx11-dev ncurses-dev
sysctl kernel.randomize_va_space=0
cp src/config.h-linux src/config.h
make
make install
build-netbsd:
name: "build-netbsd (NetBSD/amd64 10.1 with pkgsrc)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install packages and run configure and make (on the NetBSD VM)
uses: vmactions/netbsd-vm@v1
with:
release: "10.1"
copyback: false
prepare: |
uname -a
ftp -o - https://cdn.NetBSD.org/pub/NetBSD/NetBSD-`uname -r`/amd64/binary/sets/xbase.tar.xz | tar -C / -zxpf - ./usr/X11R7/bin ./usr/X11R7/include ./usr/X11R7/lib ./usr/X11R7/share
ftp -o - https://cdn.NetBSD.org/pub/NetBSD/NetBSD-`uname -r`/amd64/binary/sets/xcomp.tar.xz | tar -C / -zxpf - ./usr/X11R7/include ./usr/X11R7/lib ./usr/X11R7/share
run: |
cp src/config.h-netbsd src/config.h
make
make install
build-netbsd-vax:
name: "build-netbsd (NetBSD/vax 10.1 with pkgsrc and simh)"
runs-on: ubuntu-latest
steps:
- name: install packages to build opensimh etc.
run: |
sudo apt-get update -q
sudo apt-get upgrade -qy
sudo apt-get install -qy build-essential wget libpcap-dev libpcre3-dev vde2 libsdl2-dev libsdl2-ttf-dev libedit-dev
- name: fetch NetBSD sources and build crossbuild toolchains
run: |
cd $HOME
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/source/sets/gnusrc.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/source/sets/sharesrc.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/source/sets/src.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/source/sets/syssrc.tgz
tar -zxf gnusrc.tgz
tar -zxf sharesrc.tgz
tar -zxf src.tgz
tar -zxf syssrc.tgz
(cd usr/src && sh build.sh -m vax -U -j 4 -T tooldir.vax -V OBJMACHINE=1 tools)
- name: fetch NetBSD/vax binary sets
run: |
cd $HOME
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/kern-GENERIC.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/base.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/etc.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/comp.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/misc.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/text.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/xbase.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/xcomp.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/xetc.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/xfont.tgz
wget -q https://cdn.NetBSD.org/pub/NetBSD/NetBSD-10.1/vax/binary/sets/xserver.tgz
- name: create NetBSD/vax images
run: |
cd $HOME
mkdir targetroot
tar -C targetroot -zxf kern-GENERIC.tgz
tar -C targetroot -zxf base.tgz
tar -C targetroot -zxf etc.tgz
tar -C targetroot -zxf comp.tgz
tar -C targetroot -zxf misc.tgz
tar -C targetroot -zxf text.tgz
tar -C targetroot -zxf xbase.tgz
tar -C targetroot -zxf xcomp.tgz
tar -C targetroot -zxf xetc.tgz
tar -C targetroot -zxf xfont.tgz
tar -C targetroot -zxf xserver.tgz
chmod u+r targetroot/var/spool/ftp/hidden
cat > targetroot/etc/fstab <<EOF
ROOT.a / ffs rw,log 1 1
#ROOT.b none none sw
kernfs /kern kernfs rw
ptyfs /dev/pts ptyfs rw
procfs /proc procfs rw
EOF
sed -e 's/rc_configured=NO/rc_configured=YES/' targetroot/etc/rc.conf > rc.conf
echo "hostname=microvax" >> rc.conf
echo "dhcpcd=YES" >> rc.conf
echo "fccache=NO" >> rc.conf
echo "sshd=YES ssh_keygen_flags=\"-b 1024\"" >> rc.conf
cp rc.conf targetroot/etc
touch image.spec
cat targetroot/etc/mtree/* | sed -e 's/ size=[0-9]*//' >> image.spec
sh targetroot/dev/MAKEDEV -s all | sed -e '/^\. type=dir/d' -e 's,^\.,./dev,' >> image.spec
echo "./kern type=dir mode=0755" >> image.spec
echo "./proc type=dir mode=0755" >> image.spec
echo "./tmp type=dir mode=1777" >> image.spec
echo "./netbsd type=file mode=0755" >> image.spec
cat > sshd_config <<EOF
AllowUsers [email protected]
PermitRootLogin yes
PermitEmptyPasswords yes
AuthenticationMethods none
UsePam no
IgnoreUserKnownHosts yes
EOF
cat targetroot/etc/ssh/sshd_config >> sshd_config
cp sshd_config targetroot/etc/ssh
usr/src/tooldir.vax/bin/nbmakefs -t ffs -M 4294967296 -m 4294967296 -F image.spec -N targetroot/etc netbsd-vax.img targetroot
cat > disklabel.proto <<EOF
type: SCSI
disk: ci-vax
label:
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 4096
total sectors: 8388608
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0
track-to-track seek: 0
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 8388608 0 4.2BSD 2048 16384 128
c: 8388608 0 0 0
EOF
usr/src/tooldir.vax/bin/nbdisklabel -R -F -M vax netbsd-vax.img disklabel.proto
usr/src/tooldir.vax/bin/nbinstallboot -v -m vax netbsd-vax.img targetroot/usr/mdec/sdboot
- name: build opensimh
run: |
cd $HOME
git clone https://github.com/open-simh/simh
(cd simh && make TESTS=0 microvax3900)
touch simh-boot-netbsd-vax
cat > simh-boot-netbsd-vax <<EOF
set cpu 256m
set rq0 ra92
attach rq0 netbsd-vax.img
attach xq nat:tcp=10022:10.0.2.15:22
expect ">>>" send "boot dua0\r"; continue
boot cpu
EOF
cat simh-boot-netbsd-vax
- name: start simh
run: |
cd $HOME
echo "start simh and wait for NetBSD to reach multi-user mode"
echo "boot dua0" | simh/BIN/microvax3900 simh-boot-netbsd-vax > simh.log 2>&1 &
TIMEOUT=600
INTERVAL=10
while true; do
if grep -q "^login:" simh.log; then
echo "NetBSD/vax on simh is ready"
break
fi
if [ "$SECONDS" -ge "$TIMEOUT" ]; then
echo "Timeout: simh doesn't start properly"
cat simh.log
exit 1
fi
sleep $INTERVAL
echo "waiting simh to reach multi-user ($SECONDS s)"
done
- uses: actions/checkout@v4
- name: copy source tree to vm
run: |
cd $HOME
tar --exclude _actions --exclude _PipelineMapping -cf - work | ssh -o "StrictHostKeyChecking no" -p 10022 root@localhost tar -xvf -
- name: build on simh
run: |
ssh -o "StrictHostKeyChecking no" -p 10022 root@localhost "cd work/emacs-18.59-netbsd/emacs-18.59-netbsd && cp src/config.h-netbsd src/config.h && make && make install"