From cefde2c097f114c63ddf0be513d81ef9c9e9a06d Mon Sep 17 00:00:00 2001 From: LindirQuenya <53021080+LindirQuenya@users.noreply.github.com> Date: Fri, 15 Jul 2022 12:45:38 -0400 Subject: [PATCH] Make flashpointvm able to run in read-only mode. --- .github/workflows/build.yml | 12 +++++++++++- snapshot.sh | 8 ++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32689d7..9f5ba37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: release_name: ${{ steps.prepare.outputs.sha_short }} draft: false prerelease: false - - name: Upload release + - name: Upload alpine.qcow2 id: upload_release uses: actions/upload-release-asset@v1 env: @@ -43,3 +43,13 @@ jobs: asset_path: ./alpine.qcow2 asset_name: alpine.qcow2 asset_content_type: application/octet-stream + - name: Upload dummy.qcow2 + id: upload_release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dummy.qcow2 + asset_name: dummy.qcow2 + asset_content_type: application/octet-stream diff --git a/snapshot.sh b/snapshot.sh index f352009..8d47434 100755 --- a/snapshot.sh +++ b/snapshot.sh @@ -1,7 +1,10 @@ #!/bin/sh +rm -f dummy.qcow2 +qemu-img create -f qcow2 dummy.qcow2 1M qemu-system-i386 $QEMU_EXTRA_ARGS -display none -m 128 \ -net 'nic,model=virtio-net-pci' -net 'user,hostfwd=tcp::22500-:80' \ --monitor 'tcp:localhost:4445,server,nowait' -drive 'file=alpine.qcow2,if=virtio' & +-monitor 'tcp:localhost:4445,server,nowait' -drive 'if=none,format=qcow2,file=dummy.qcow2' \ +-drive 'file=alpine.qcow2,if=virtio' & pid=$! while ! curl -sI 'http://127.0.0.1:22500/' >/dev/null; do @@ -10,4 +13,5 @@ done echo 'apache is ready .. snapshot in 10 seconds' && sleep 10 echo 'savevm quick' | nc -q1 -w5 127.0.0.1 4445 >/dev/null -kill -TERM "$pid" +sleep 2 +echo 'quit' | nc -q1 -w5 127.0.0.1 4445 >/dev/null