-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add cryptsetup + dm-crypt #5672
base: master
Are you sure you want to change the base?
Conversation
Oh also for x86_64 (with SSE) it probably makes sense to build |
@th0ma7 this branch fails in github build action while downloading prerequisites (i.e. kernel sources)
We should adjust the github build to limit the build for |
It's a section of the code that isn't that easy to handle right. Normally it should create a, let's say, x64 package containing pre-compiled modules for all x64 archs for a limited amout of kernels. This is set in Still, the side effect of this is the total size which is just to much to handle. An option would be to generate arch-specific packages and never cache kernel files... But this would require a lot of changes to the code to handle.
Which ones is the question? From a kernel versioning 6.1 & 6.2.4 & 7.0 makes sense (in lack of 7.1 kernel files). But should we also limit arch? Still, there's clearly a bug somewhere, I'll investigate. But I'm away for work most of the week and I'll be looking at closing my other pernding PR's first. |
And @jonathan-conder I really should have added, I'm glad someone else is using the kernel build portion of the framework. Your PR demonstrate the interesting possibilities that comes with it, nice work! |
For DSM 6, we can ommit all the 6.1 builds and build only for 6.2.4 |
Thanks, I've actually been using it (and spksrc in general) for quite a while so I'm grateful for the work you and others have put into it |
cross/cryptsetup/Makefile
Outdated
CONFIGURE_ARGS += --disable-veritysetup | ||
CONFIGURE_ARGS += --disable-integritysetup | ||
CONFIGURE_ARGS += --disable-selinux | ||
# CONFIGURE_ARGS += --enable-libargon2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting to remove and document why it's being kept
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this back in for x86 where the external argon2 is recommended (due to SSE/AVX)
cross/device-mapper/PLIST
Outdated
bin:sbin/blkdeactivate | ||
bin:sbin/dmsetup | ||
bin:sbin/dmstats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the binary needed or only the libraries are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see these being referenced anywhere so I've removed them
spk/cryptsetup/Makefile
Outdated
HOMEPAGE = https://gitlab.com/cryptsetup/cryptsetup | ||
LICENSE = GPLv2 | ||
|
||
PLIST_TRANSFORM = sed -e 's%@kernel@%$(TC_ARCH)-$(TC_VERS)/$(TC_KERNEL)%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead you can simply use lib:lib/modules/**
in the PLIST
as there won't be any other modules directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, I had another patch which changed the PLIST behaviour, but accidentally broke that behaviour. Fixed now
spk/cryptsetup/src/conf/privilege
Outdated
@@ -0,0 +1,5 @@ | |||
{ | |||
"defaults": { | |||
"run-as": "root" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work on DSM7 as it isn't allowed.
spk/cryptsetup/src/dsm-control.sh.in
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is well done. Although that won't work on DSM7 due to restricted permissions.
To alleviate this I had built a kernel module helper script part of synocli-kernel
which can be called manually using a configuration file to load requested modules. It follows the load & unload order to avoid collisions on used modules.
What I would suggest is :
- that you create a dependency towards the
synocli-kernel
package and provide a configuration file to be used. - Add documentation to the spksrc github wiki on how to use this package which could lead into (for instance) manually adding a command in the
local.rc
file to call the kernel module helper script using your configuration file.
On my end what I'll look into doing is relocating synocli-kernelmodule.sh
to facilitate development without impacting spksrc repository so it can be easy for all to test prior to repackaging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the dsm-control script and just made a standalone script. There are a few tricky things e.g. dm-builtin and dm-crypt vs. dm-crypt-armada so it was easier to make a script specific to this rather than extending the generic one. As a bonus this means fewer dependencies
Also, to limit impact I suggest you change This will reduce the pre-download time significantly + reducing total cache disk space usage. Anyway, I intend to only provide theses two in future package (until 7.1 kernel sources gets released). |
Also, FYI, I've now cleaned-up my personal synology repository and imported my latest snapshot of I'll be looking into fixing some of the issues raised earlier and add any missing features you may require (feel free to provide patches you see fit). |
0de0b35
to
ab33477
Compare
I've fixed most of those issues and added support for most of the 6.2.4 architectures. Although it just builds there, not sure if it actually works. Also added AES acceleration where supported (in theory some more of the ARMv7 architectures should support it too but it will require some more kernel patches). Not sure I'll be able to get around to 7.x support since it's pretty time consuming going through all the kernel configs. Maybe when 7.2 comes out. |
cross/openssl3/patches/armv8-6.2.4/001-fix-asm-arch-for-old-gcc.patch
Outdated
Show resolved
Hide resolved
ab33477
to
8923f0f
Compare
@@ -599,11 +599,10 @@ kernel-modules-%: | |||
archs2process=$* ; \ | |||
fi ; \ | |||
$(MSG) ARCH to be processed: $${archs2process} ; \ | |||
set -e ; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should explain why I'm reverting this. This is still useful when working on a package for a specific architecture. But when building dm-crypt for multiple architectures (e.g. for the aarch64 package), some of them are expected to fail because their kernel just doesn't support it. But the overall build should still succeed.
…oCommunity#5670)" This reverts commit 0bf9f11.
8923f0f
to
742f3cd
Compare
Description
This probably isn't ready to merge yet - it works for me on ipq806x-1.3 but
cryptsetup open
causes a kernel panic on SRM 1.2, and possibly other architectures. I've also chosen which kernel modules to build based onsynoconfigs/ipq806x
- these choices might be different for other kernels (in particular dm-mod only depends on md-mod due to Synology-specific patches).But I thought I would make a PR anyway in case others are interested. As a safety measure I've commented out the first
insmod
fromdsm-control.sh
, so the package doesn't auto-load after restarting the system (you have to manuallyinsmod dm-builtin.ko
first). It's also unsafe to auto-unloaddm-builtin.ko
due to a potential race condition (see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/md/dm-builtin.c for details).Checklist
all-supported
completed successfullyType of change