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

Postinst script for dpkg package does not work in chroot'ed environment #8841

Closed
fiesh opened this issue Feb 4, 2025 · 2 comments · Fixed by #8843
Closed

Postinst script for dpkg package does not work in chroot'ed environment #8841

fiesh opened this issue Feb 4, 2025 · 2 comments · Fixed by #8843

Comments

@fiesh
Copy link
Contributor

fiesh commented Feb 4, 2025

This is a dup of signalapp/Signal-Desktop#7146 which I brought up in the wrong repository.

We use a chroot environment to maintain our diskless clients' boot images. The postinst script has a call

apparmor_parser --replace --write-cache --skip-read-cache "$APPARMOR_PROFILE_TARGET"

which one doesn't want to have in a chroot environment, and it fails for us. This means I typically remove the call from the postinst file manually.

Changing packages/app-builder-lib/templates/linux/after-install.tpl's problematic line to

if ! { [ -x '/usr/bin/ischroot' ] && ischroot; } && hash apparmor_parser 2>/dev/null; then

fixes the issue for me.

@mmaietta
Copy link
Collaborator

mmaietta commented Feb 4, 2025

Would you mind opening a PR for that change? This is the first I've seen of this error, but it seems reasonable of a change.

Also not sure how to test this locally as well. Can you provide instructions for doing this in a VM?

@fiesh
Copy link
Contributor Author

fiesh commented Feb 4, 2025

Would you mind opening a PR for that change? This is the first I've seen of this error, but it seems reasonable of a change.

Thanks, yes, I'll do that. Wanted to wait for feedback first.

Also not sure how to test this locally as well. Can you provide instructions for doing this in a VM?

Do the instructions from signalapp/Signal-Desktop#7146 help or suffice?

fiesh pushed a commit to fiesh/electron-builder that referenced this issue Feb 4, 2025
This prevents `postinst` script failure when run in a `chroot`
environment.

This closes electron-userland#8841.
fiesh pushed a commit to fiesh/electron-builder that referenced this issue Feb 4, 2025
This prevents `postinst` script failure when run in a `chroot`
environment.

This closes electron-userland#8841.
fiesh pushed a commit to fiesh/electron-builder that referenced this issue Feb 4, 2025
This prevents `postinst` script failure when run in a `chroot`
environment.

This closes electron-userland#8841.
fiesh pushed a commit to fiesh/electron-builder that referenced this issue Feb 5, 2025
This prevents `postinst` script failure when run in a `chroot`
environment.

This closes electron-userland#8841.
fiesh pushed a commit to fiesh/electron-builder that referenced this issue Feb 5, 2025
This prevents `postinst` script failure when run in a `chroot`
environment.

This closes electron-userland#8841.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants