Skip to content

Commit

Permalink
Update base images to OCaml 5.2.1 and opam 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mtelvers committed Nov 19, 2024
1 parent e0a6005 commit c8f7092
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
19 changes: 11 additions & 8 deletions qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ clean:

windows: windows-server-2022-amd64-ocaml-4.14.qcow2 windows-server-2022-amd64-ocaml-5.2.qcow2 busybox.qcow2

windows-server-2022-amd64-ocaml-5.2.qcow2: windows-server-2022-amd64-ocaml-5.2.0.qcow2
windows-server-2022-amd64-ocaml-5.2.qcow2: windows-server-2022-amd64-ocaml-5.2.1.qcow2
ln -sf $< $@

windows-server-2022-amd64-ocaml-4.14.qcow2: windows-server-2022-amd64-ocaml-4.14.2.qcow2
Expand All @@ -23,15 +23,18 @@ windows-server-2022-amd64-ocaml-%.qcow2: unattend-%.iso virtio-win.ISO
-drive file=$<,media=cdrom \
-drive file=virtio-win.ISO,media=cdrom

unattend-%.iso: autounattend.xml.m4 id_ed25519.pub openssh-win64.msi opam-2.2.exe opam-dev.exe setup-x86_64.exe
unattend-%.iso: autounattend.xml.m4 id_ed25519.pub openssh-win64.msi opam-2.2.exe opam-2.3.exe opam-dev.exe setup-x86_64.exe
m4 -D VERSION=$* $< > autounattend.xml
mkisofs -o $@ -r -J autounattend.xml id_ed25519.pub openssh-win64.msi opam-2.2.exe opam-dev.exe setup-x86_64.exe
mkisofs -o $@ -r -J autounattend.xml id_ed25519.pub openssh-win64.msi opam-2.2.exe opam-2.3.exe opam-dev.exe setup-x86_64.exe

opam-2.2.exe:
curl -L https://github.com/ocaml/opam/releases/download/2.2.1/opam-2.2.1-amd64-windows.exe -o opam-2.2.exe
curl -L https://github.com/ocaml/opam/releases/download/2.2.1/opam-2.2.1-x86_64-windows.exe -o opam-2.2.exe

opam-2.3.exe:
curl -L https://github.com/ocaml/opam/releases/download/2.3.0/opam-2.3.0-x86_64-windows.exe -o opam-2.3.exe

opam-dev.exe:
curl -L https://github.com/ocaml/opam/releases/download/2.3.0-beta1/opam-2.3.0-beta1-amd64-windows.exe -o opam-dev.exe
curl -L https://github.com/ocaml/opam/releases/download/2.3.0/opam-2.3.0-x86_64-windows.exe -o opam-dev.exe

openssh-win64.msi:
curl -L https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.2.2.0p1-Beta/OpenSSH-Win64-v9.2.2.0.msi -o openssh-win64.msi
Expand All @@ -46,7 +49,7 @@ virtio-win.ISO:

ubuntu: ubuntu-noble-amd64-ocaml-4.14.qcow2 ubuntu-noble-amd64-ocaml-5.2.qcow2 ubuntu-noble-riscv64-ocaml-4.14.qcow2 ubuntu-noble-riscv64-ocaml-5.2.qcow2 busybox.qcow2

ubuntu-noble-%-ocaml-5.2.qcow2: ubuntu-noble-%-ocaml-5.2.0.qcow2
ubuntu-noble-%-ocaml-5.2.qcow2: ubuntu-noble-%-ocaml-5.2.1.qcow2
ln -sf $< $@

ubuntu-noble-%-ocaml-4.14.qcow2: ubuntu-noble-%-ocaml-4.14.2.qcow2
Expand Down Expand Up @@ -94,9 +97,9 @@ busybox.qcow2: noble-server-cloudimg-amd64.qcow2 seed.iso

# OpenBSD

openbsd: openbsd-76-amd64-ocaml-4.14.2.qcow2 openbsd-76-amd64-ocaml-5.2.0.qcow2
openbsd: openbsd-76-amd64-ocaml-4.14.2.qcow2 openbsd-76-amd64-ocaml-5.2.1.qcow2

openbsd-76-amd64-ocaml-5.2.qcow2: openbsd-76-amd64-ocaml-5.2.0.qcow2
openbsd-76-amd64-ocaml-5.2.qcow2: openbsd-76-amd64-ocaml-5.2.1.qcow2
ln -sf $< $@

openbsd-76-amd64-ocaml-4.14.qcow2: openbsd-76-amd64-ocaml-4.14.2.qcow2
Expand Down
17 changes: 11 additions & 6 deletions qemu/autounattend.xml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -263,36 +263,41 @@
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>23</Order>
<CommandLine>cmd /c "copy e:\opam-dev.exe c:\cygwin64\bin\opam-dev.exe"</CommandLine>
<CommandLine>cmd /c "copy e:\opam-2.3.exe c:\cygwin64\bin\opam-2.3.exe"</CommandLine>
<Description>Copy opam executable</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>24</Order>
<CommandLine>cmd /c "copy e:\opam-dev.exe c:\cygwin64\bin\opam-dev.exe"</CommandLine>
<Description>Copy opam executable</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<CommandLine>c:\cygwin64\bin\bash.exe --login -c "cd /cygdrive/c/Users/opam &amp;&amp; git clone https://github.com/ocaml/opam-repository"</CommandLine>
<Description>Add opam-repository</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>25</Order>
<Order>26</Order>
<CommandLine>c:\cygwin64\bin\opam init -y -k local -a c:\users\opam\opam-repository --bare --cygwin-location=c:\cygwin64</CommandLine>
<Description>Opam init</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>26</Order>
<Order>27</Order>
<CommandLine>c:\cygwin64\bin\opam switch create VERSION --packages=ocaml-base-compiler.VERSION</CommandLine>
<Description>Opam switch</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>27</Order>
<Order>28</Order>
<CommandLine>c:\cygwin64\bin\opam pin add -k version ocaml-base-compiler VERSION</CommandLine>
<Description>Opam switch</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>28</Order>
<Order>29</Order>
<CommandLine>mkdir c:\users\opam\src</CommandLine>
<Description>Create a src directory</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>29</Order>
<Order>30</Order>
<CommandLine>shutdown /s /t 10</CommandLine>
<Description>Shutdown</Description>
</SynchronousCommand>
Expand Down
3 changes: 2 additions & 1 deletion qemu/install.site.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ echo "https://cdn.openbsd.org/pub/OpenBSD" > /etc/installurl
echo "permit nopass keepenv :wheel" >> /etc/doas.conf

cat <<EOF >> /etc/rc.firsttime
syspatch
echo "AcceptEnv=*" >> /etc/ssh/sshd_config
echo "PermitUserEnvironment=yes" >> /etc/ssh/sshd_config
pkg_add curl-- gmake gtar-- gpatch unzip-- rsync-- git
/usr/local/bin/curl -L https://github.com/ocaml/opam/releases/download/2.3.0-rc1/opam-2.3.0-rc1-x86_64-openbsd -o /usr/bin/opam-2.3
/usr/local/bin/curl -L https://github.com/ocaml/opam/releases/download/2.3.0/opam-2.3.0-x86_64-openbsd -o /usr/bin/opam-2.3
chmod +x /usr/bin/opam-2.3
ln -s /usr/bin/opam-2.3 /usr/bin/opam
su - opam -c "echo OPAMYES=1 >> .ssh/environment"
Expand Down
8 changes: 3 additions & 5 deletions qemu/user-data.yaml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ runcmd:
- mkdir /tmp/opam
- curl -L https://opam.ocaml.org/install.sh -o /tmp/opam/install.sh
- chmod +x /tmp/opam/install.sh
- (cd /tmp/opam && ./install.sh --download-only --dev)
- mv /tmp/opam/opam-* /usr/bin/opam-dev
- chmod +x /usr/bin/opam-dev
- ln -s /usr/bin/opam-dev /usr/bin/opam
- (cd /tmp/opam && for version in 2.2.1 2.3.0 dev ; do if [ "$version" = "dev" ] ; then ./install.sh --dev --download-only ; else ./install.sh --version $version --download-only ; fi ; chmod a+x opam-* ; mv opam-* /usr/bin/opam-"${version%.*}" ; done && rm install.sh)
- ln -s /usr/bin/opam-2.2 /usr/bin/opam
- apt update
- apt upgrade
- apt upgrade -y
- apt install build-essential unzip bubblewrap -y
- su - opam -c "git clone https://github.com/ocaml/opam-repository"
- su - opam -c "opam init -k local -a /home/opam/opam-repository --bare --disable-sandboxing"
Expand Down

0 comments on commit c8f7092

Please sign in to comment.