-
Notifications
You must be signed in to change notification settings - Fork 171
package_manager: apt: run postinst scripts for ca-certificates #2659
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
Conversation
Debian postinst scripts are designed to be called with an argument. This is normally `configure`, which tells the script to configure the package. The package being configured here (base-passwd) exits without doing anything if the argument is not `configure`, but other scripts can return an error code. Signed-off-by: Isaac True <[email protected]>
The ca-certificates package is required when any of the repositories being used for the image use HTTPS. In order to support this, the package needs to be added to the bootstrap packages. However, the bootstrap package installer will not run the postinst script, which is required to configure the system to use the SSL certificates. This patch adjusts the bootstrap package installer to additionally run the postinst scripts for ca-certificates. Signed-off-by: Isaac True <[email protected]>
|
Running Kiwi with these patches allow the build to succeed. The following additional output is printed: The "No such file or directory" messages are not fatal and don't cause any issues. |
|
@schaefi maybe it would make sense to run the post install scripts for all of the packages being installed during bootstrapping? |
|
This is strictly speaking not required, and why wouldn't you just add it to the bootstrap section in your description? |
|
The postinstall scripts aren't run for packages in the bootstrap section, which means that the certificates aren't copied to the right place and `update-ca-certificates` doesn't get run.
|
|
Example appliance description (adapted from https://github.com/OSInside/kiwi-descriptions/blob/main/debian/x86_64/debian-bookworm/config.xml) to reproduce the problem this PR fixes: Building this with the current main fails due to the missing certificates |
|
Thanks for the fix Isaac, this makes sense and is another part that I overlooked when we moved away from debootstrap
I think we should do this. In a former implementation I had it as such but several post install scripts failed to run. I remember that I called them directly after the unpacking and I think this was a mistake. iirc Debian based systems runs all scripts after all packages got installed, is that correct ? If so I think it would be good to do that after all bootstrap packages got unpacked I also think it would be good to do this as a refactor which moves the unpacking So how about merging this one first, then come up with a refactor ? Thoughts |
Correct - if you use apt, everything gets unpacked and then configured (i.e. the
Sounds good to me :) |
|
@IsaacJT I tested the the change from #2661 with your bootstrap section from here and the log now shows so should be working as expected |
|
Closing this one in favor of #2661 |
The ca-certificates package is required when any of the repositories
being used for the image use HTTPS. In order to support this, the
package needs to be added to the bootstrap packages. However, the
bootstrap package installer will not run the postinst script, which is
required to configure the system to use the SSL certificates.
This patch adjusts the bootstrap package installer to additionally run
the postinst scripts for ca-certificates.
If the ca-certificates package has not been configured, the build will
fail with the following error:
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification.