Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

sysext: Add debugging commands #336

Merged
merged 2 commits into from
Sep 26, 2023
Merged

sysext: Add debugging commands #336

merged 2 commits into from
Sep 26, 2023

Conversation

pothos
Copy link
Contributor

@pothos pothos commented Sep 26, 2023

  • sysext: Add debugging commands

    When unsure what files an image ships or why the image is not compatible
    it can help to list the image contents or show the debug output from the
    matching.

  • Correct unshare mount command for listing /etc

    Unshare expects a single command with arguments but the "sh -c" was
    forgotten here.

How to use

Testing done

Ran the command for the docker compose image.

Unshare expects a single command with arguments but the "sh -c" was
forgotten here.
@pothos pothos requested a review from a team September 26, 2023 09:25
You can list the contents of a systemd-sysext image like this (assuming an image without dm-verity):

```
sudo unshare -m sh -c "mount docker-compose-2.18.1.raw /tmp && cd /tmp && find usr"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sudo unshare -m sh -c "mount docker-compose-2.18.1.raw /tmp && cd /tmp && find usr"
sudo unshare -m sh -c "mount docker-compose-2.18.1.raw /tmp && cd /tmp && find usr opt"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can only be both, or? Have added a comment for opt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I'd suggest even:

Suggested change
sudo unshare -m sh -c "mount docker-compose-2.18.1.raw /tmp && cd /tmp && find usr"
sudo unshare -m sh -c "mount docker-compose-2.18.1.raw /tmp && cd /tmp && find ."

Copy link
Contributor Author

@pothos pothos Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my first idea but since only usr is considered I thought to make it explicit.
Have now added a comment for that and switched back to ..

When unsure what files an image ships or why the image is not compatible
it can help to list the image contents or show the debug output from the
matching.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants