Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/lib/prepare: drop workarounds for rpmbuild rewriting /bin/sh #7806

Merged
merged 1 commit into from Nov 28, 2019

Conversation

bboozzoo
Copy link
Collaborator

Drop the workaround for rpmbuild rewriting /bin/sh to /usr/bin/sh.

case "$SPREAD_SYSTEM" in
fedora-*|centos-*|amazon-*)
# RPM can rewrite shebang to #!/usr/bin/sh
sed -i -e '1 s;#!/usr/bin/sh;#!/bin/sh;' squashfs-root/usr/lib/snapd/snap-device-helper
Copy link
Collaborator

Choose a reason for hiding this comment

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

For some context. The reason this was here in the first place is that we rebuild snapd on, say Fedora 31, and repackage the 16.04-based core snap with the package built on fedora. This now puts the /usr/bin/sh shebang line inside the core snap, which doesn't exist there.

We fixed this with cc4e91c so the workaround is no longer necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bboozzoo can you please include this in the commit message ^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll update the commit message and force push

Copy link
Collaborator

@sergiocazzolato sergiocazzolato left a comment

Choose a reason for hiding this comment

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

Nice, thanks

Drop the workaround for rpmbuild rewriting /bin/sh to /usr/bin/sh.

The snap-confine device cgroup setup would call snap-device-helper after
pivoting to the snap mount namespace. This used to fail on Fedora because of the
mangling done by rpm packaging that changes /bin/sh to /usr/bin/sh. In which,
case we would try to run snap-device-helper using an interpreter at /usr/bin/sh
that does not exist within the snap mount ns. The downstream packaging defined
macros that prevented this scenario.

Since snapcore#7049, snap-confine calls snap-device-helper before pivoting to the snap
mount namespace, thus the host interpreter is still visible at the correct path.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@mvo5 mvo5 merged commit 3654eb1 into snapcore:master Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants