Skip to content

Commit

Permalink
Fix potential permissions error with result file
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanjli committed May 30, 2024
1 parent da5a25e commit 6b68aaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-pinspawn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Grow the image
id: grow-image
uses: ethanjli/[email protected].0
uses: ethanjli/[email protected].1
with:
image: ${{ steps.download-base.outputs.destination }}
destination: rpi-os-image.img
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,17 @@ Note: the system in the container will shut down after the specified commands fi
uses: ethanjli/[email protected]
with:
image: rpi-os-image.img
args: |
--bind "$(pwd)":/run/external
args: --bind "$(pwd)":/run/external
boot: true
run: |
echo "Waiting for boot to finish..."
systemctl is-system-running --wait
systemd-analyze
while ! systemd-analyze 2>/dev/null; do
echo "Waiting for boot to finish..."
sleep 5
done
systemd-analyze critical-chain | cat
systemd-analyze blame | cat
systemd-analyze plot > /run/external/bootup-timeline.svg
echo "Done!"
- name: Upload the bootup timeline to Job Artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion pinspawn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ if [ ! -z "$boot_run_service" ]; then
# Check the return code of the shell script
# Note: this is not needed in unbooted containers because errors there are propagated to the
# caller of the script
if [ ! -f "$boot_tmp_result" ]; then
if [ ! "$(sudo cat "$boot_tmp_result" > /dev/null)" ]; then
echo "Error: $boot_run_service did not store a result indicating success/failure!"
exit 1
elif [ "$(sudo cat "$boot_tmp_result")" != "0" ]; then
Expand Down

0 comments on commit 6b68aaa

Please sign in to comment.