diff --git a/qemu/Makefile b/qemu/Makefile index 1fc14cc5..adc87ff5 100644 --- a/qemu/Makefile +++ b/qemu/Makefile @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/qemu/autounattend.xml.m4 b/qemu/autounattend.xml.m4 index fd22291f..54ed74dc 100644 --- a/qemu/autounattend.xml.m4 +++ b/qemu/autounattend.xml.m4 @@ -263,36 +263,41 @@ 23 - cmd /c "copy e:\opam-dev.exe c:\cygwin64\bin\opam-dev.exe" + cmd /c "copy e:\opam-2.3.exe c:\cygwin64\bin\opam-2.3.exe" Copy opam executable 24 + cmd /c "copy e:\opam-dev.exe c:\cygwin64\bin\opam-dev.exe" + Copy opam executable + + + 25 c:\cygwin64\bin\bash.exe --login -c "cd /cygdrive/c/Users/opam && git clone https://github.com/ocaml/opam-repository" Add opam-repository - 25 + 26 c:\cygwin64\bin\opam init -y -k local -a c:\users\opam\opam-repository --bare --cygwin-location=c:\cygwin64 Opam init - 26 + 27 c:\cygwin64\bin\opam switch create VERSION --packages=ocaml-base-compiler.VERSION Opam switch - 27 + 28 c:\cygwin64\bin\opam pin add -k version ocaml-base-compiler VERSION Opam switch - 28 + 29 mkdir c:\users\opam\src Create a src directory - 29 + 30 shutdown /s /t 10 Shutdown diff --git a/qemu/install.site.m4 b/qemu/install.site.m4 index 447d7c9c..24e66c30 100644 --- a/qemu/install.site.m4 +++ b/qemu/install.site.m4 @@ -4,10 +4,11 @@ echo "https://cdn.openbsd.org/pub/OpenBSD" > /etc/installurl echo "permit nopass keepenv :wheel" >> /etc/doas.conf cat <> /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" diff --git a/qemu/user-data.yaml.m4 b/qemu/user-data.yaml.m4 index c242f9f3..3b25e5d8 100644 --- a/qemu/user-data.yaml.m4 +++ b/qemu/user-data.yaml.m4 @@ -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"