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

Update securedrop-workstation-grsec for 5.15.41/bullseye #326

Merged
merged 7 commits into from
May 19, 2022

Conversation

sssoleileraaa
Copy link
Contributor

@sssoleileraaa sssoleileraaa commented May 18, 2022

Towards #321

  • Update changelog for securedrop-workstation-grsec
  • Add job for building securedrop-workstation-grsec in CI
    • Change the versioning scheme to $KERNEL-$REVISION~$PLATFORM. This means the package's "upstream version" will be the kernel version, so we can use variables like ${source:Upstream-Version} and $DEB_VERSION_UPSTREAM to substitute in the kernel version without hardcoding it.
    • Skip u2mfn code on bullseye, it's not needed anymore on Qubes 4.1.
    • "Hack" CI to use changelog-bullseye since we need a different version on bullseye.

Cross link to freedomofpress/securedrop-apt-test#158

Test plan

  • Build on both buster and bullseye. Use apt show securedrop-workstation-grsec_4.14.241-2~buster_amd64.deb and apt show securedrop-workstation-grsec_5.15.41-1~bullseye_amd64.deb to verify the dependencies have the correct version substituted in
  • Extract the control metdata with ar x securedrop-workstation-grsec_5.15.41-1~bullseye_amd64.deb && tar xvf control.tar.xz, and look at the postinst to verify the token was substituted properly.

@legoktm
Copy link
Member

legoktm commented May 18, 2022

I think we still need some of the stuff Conor did in #301, let me take a stab at making it build on bullseye and buster...

@sssoleileraaa
Copy link
Contributor Author

@legoktm just explained that we can use debian substitution variables to no longer worry about having to manually update the version strings in the control file. This change can be appended to this PR.

@sssoleileraaa
Copy link
Contributor Author

I'm going to rebuild the kernel anyway before creating a PR with the new debs for dev-lfs. I'll link to that PR once it's ready.

@sssoleileraaa sssoleileraaa marked this pull request as draft May 19, 2022 01:15
@legoktm
Copy link
Member

legoktm commented May 19, 2022

The CI logic is a bit busted still, I'll fix that up tomorrow. But the package should build as we want it on both bullseye and buster.

legoktm and others added 2 commits May 19, 2022 12:31
* Automatically determine the kernel version from the package
  version, rearrange the package version scheme so the upstream
  version is exactly the kernel version and the distro name is
  in the debian version.
* Disable the u2mn stuff on bullseye/Qubes 4.1.
* Adjust the packaging script so it will support a changelog-bullseye
  since it has to be different from buster.
* Drop the old changelog-stretch.

Co-authored-by: Conor Schaefer <conor@freedom.press>
With TODO comments left that this should be cleaned up properly.
@legoktm legoktm force-pushed the securedrop-workstation-grsec-5.15.38 branch from 142ce59 to e5640b8 Compare May 19, 2022 16:31
@legoktm legoktm marked this pull request as ready for review May 19, 2022 16:37
@legoktm
Copy link
Member

legoktm commented May 19, 2022

CI correctly built securedrop-workstation-grsec_5.15.38-1~bullseye_amd64.deb and securedrop-workstation-grsec_4.14.241-2~buster_amd64.deb \o/

@legoktm
Copy link
Member

legoktm commented May 19, 2022

The ${source:Upstream-Version} syntax is documented at https://manpages.debian.org/bullseye/dpkg-dev/deb-substvars.5.en.html#source:Upstream

Tokens in postinst are documented at https://manpages.debian.org/bullseye/debhelper/dh_installdeb.1.en.html except the custom --define parameter is bullseye only, so we need to use sed for buster compat.

@legoktm legoktm changed the title Securedrop workstation grsec 5.15.38 Update securedrop-workstation-grsec for 5.15.38/bullseye May 19, 2022
@sssoleileraaa sssoleileraaa changed the title Update securedrop-workstation-grsec for 5.15.38/bullseye Update securedrop-workstation-grsec for 5.15.41/bullseye May 19, 2022
@sssoleileraaa
Copy link
Contributor Author

@legoktm It looks like PKG_VERSION=5.15.41 PKG_PLATFORM=bullseye make securedrop-workstation-grsec is failing now (it worked when I tested against these changes: https://github.com/freedomofpress/securedrop-debian-packaging/pull/301/files)... it looks like it has to do with the use of substitution variables maybe... I'll attach the error output from qubes in a followup comment

@legoktm
Copy link
Member

legoktm commented May 19, 2022

Should be fixed with f5d13b3.

@sssoleileraaa
Copy link
Contributor Author

sssoleileraaa commented May 19, 2022

Only thing left is to make sure we can run scripts/update-changelog so that it automatically formats the debian package version string appropriately for grsec as done manually in f5d13b3.

  • Change the versioning scheme to $KERNEL-$REVISION~$PLATFORM. This means the package's "upstream version" will be the kernel version, so we can use variables like ${source:Upstream-Version} and $DEB_VERSION_UPSTREAM to substitute in the kernel version without hardcoding it.

Just making note that the result of this is also that our changelog script will need special casing for grsec.

It needs a Debian revision while all the others are native packages.
This is mostly a best effort thing, if people want to increment the
Debian revision they should just run `dch` manually.
Copy link
Contributor Author

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

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

Just tested the recent changes for a new test version of grsec and another package (i chose proxy) for a regression check.

So this lgtm and will need your approval still @legoktm!

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 this pull request may close these issues.

2 participants