Skip to content

Commit

Permalink
Different mechanism for waiting for timesync
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Feb 6, 2024
1 parent 6538655 commit 3b6e994
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ RUN <<EOT
rm -rf /var/lib/apt/lists/*
EOT

COPY --from=gha wait_for_timesync.sh /opt/wait_for_timesync.sh
COPY --from=gha setup.sh /opt/setup.sh

RUN <<EOT
set -ex
run_vm.sh -serial null -daemonize
wait_ssh.sh
scp /opt/wait_for_timesync.sh root@localhost:/opt/bin
scp /opt/setup.sh root@localhost:/opt/bin
ssh root@localhost systemctl start systemd-time-wait-sync
ssh root@localhost 'bash -l -c wait_for_timesync.sh'
ssh root@localhost 'bash -l -c setup.sh'
save_vm.sh
EOT
Expand All @@ -29,7 +31,7 @@ RUN <<EOT
set -ex
run_vm.sh -serial null -daemonize
wait_ssh.sh
ssh root@localhost systemctl start systemd-time-wait-sync
ssh root@localhost 'bash -l -c wait_for_timesync.sh'
scp /opt/run.sh root@localhost:/opt/bin
rm /opt/run.sh
save_vm.sh
Expand Down
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ runs:
shell: bash
run: |
mkdir -p "$temp_dir/rira"
cp -al "$action/wait_for_timesync.sh" "$temp_dir/rira/wait_for_timesync.sh"
cp -al "$action/entrypoint.sh" "$temp_dir/rira/entrypoint.sh"
sed "
/#insert=rm-docker\/Dockerfile/r $workspace/.rm-docker-repo/Dockerfile
Expand Down
3 changes: 3 additions & 0 deletions wait_for_timesync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
echo "Waiting for timesync"
while [[ "$(timedatectl status | grep 'System clock synchronized' | awk '{print $4}')" != "yes" ]]; do sleep 1; done

0 comments on commit 3b6e994

Please sign in to comment.