Overview

Request 888962 accepted

Add new package openSUSE-signkey-cert (bsc#1182641)



Fabian Vogt's avatar

The scriptlets don't take package upgrades/downgrades into account. Those would delete all certificates instead, because %postun of the old package is run last: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering


Joey Lee's avatar
author target maintainer

I have built two version of RPMs for testing upgrades/downgrades by 'rpm -Uvh ' and 'rpm -Uvh --oldpackage'. I didn't see problem.

The %postun will remove xxx-kmp.crt.del file if the corresponding xxx-kmp.crt is still exists after uninstallation. So it only removes remaining *-kmp.crt.del certificate by mokutils.


Fabian Vogt's avatar

Ok. My main confusion with the scripts is that they try to work with multiple files inside the directory, even though there's not actually more than one file in this package and not more than one package planned right now.

AFAICT it's possible to just call mokutil from %preun on the final uninstallation, if the scriptlet knows about the fingerprint, but that would need extra logic to deal with detection of fingerprint changes. I don't really have a better idea for this particular case. The cleanest way would be a package with trigger scripts which can tell whether a certificate is about to be removed, replaced or added, but that's just overengineering.


Fabian Vogt's avatar

Is it necessary to postpone the call to mokutil --delete to %postun or can it be done in %preun instead? Then it wouldn't be needed to do "backups" ($cert.del)


Joey Lee's avatar
author target maintainer

Can not. Please see my the above comment.


Fabian Vogt's avatar
if [[ "command -v mokutil >/dev/null" && -d "%{_sysconfdir}/uefi/certs/" ]]; then

That does not actually run command -v, it checks whether the constant string is non-empty. Also, this uses a bashism, so try this instead:

if command -v mokutil >/dev/null && [ -d "%{_sysconfdir}/uefi/certs/" ]; then

Joey Lee's avatar
author target maintainer

Thanks for your review! I will fix it in next version.


Fabian Vogt's avatar

Is it necessary to check for the existance of %{_sysconfdir}/uefi/certs/? It's owned by the package, so except for the final uninstallation it'll always be present.


Joey Lee's avatar
author target maintainer

I will try to remove it. As I remember that I add the check because I got warning messages in OBS log. I will remove the check to see if there have any warning.

Thanks!


Joey Lee's avatar
author target maintainer

I have tested after removed the check for the existance of %{_sysconfdir}/uefi/certs/. Looks no problem. I will remove in next version.



Joey Lee's avatar
author target maintainer

I have sent new version request number: 888962

Request History
Joey Lee's avatar

joeyli created request

Add new package openSUSE-signkey-cert (bsc#1182641)


Marcus Meissner's avatar

msmeissn accepted request

ok

openSUSE Build Service is sponsored by