[pve-devel] [PATCH ceph master 3/3] buildsys: add check for changed ceph-osd sysctl settings
Friedrich Weber
f.weber at proxmox.com
Thu Feb 15 10:40:56 CET 2024
If the ceph-osd sysctl settings template (30-ceph-osd.conf.in) shipped
by upstream changes, our ceph-osd postinst patch will need to be
adapted to apply the new settings on package upgrade. To make sure we
do not forget, store the current checksum of that file in our Makefile
and fail the build early if the checksums do not match.
Signed-off-by: Friedrich Weber <f.weber at proxmox.com>
---
Notes:
- failing the build might be a bit drastic, but a simple warning seems
too easy to overlook
- strictly speaking we'll miss updates of `sysctl_pid_max` [1], but to
catch this, we'd need to check the generated 30-ceph-osd.conf
(without .in) after it is generated during the build process, and
failing then sounds may be too annoying :)
[1] https://github.com/ceph/ceph/blob/main/etc/sysctl/90-ceph-osd.conf.in
Makefile | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Makefile b/Makefile
index 9c23cadc5..e99b3b356 100644
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,11 @@ DEBS=$(MAIN_DEB) $(DEBS_REST)
DSC=ceph_${PKGVER}.dsc
+# ceph-osd postinst will need to be adjusted if the upstream 90-ceph-osd.conf.in
+# changes to make sure new settings are applied on package upgrade
+SYSCTL_CONF=etc/sysctl/90-ceph-osd.conf.in
+SYSCTL_CONF_CHECKSUM=0e3b515c4a81a5b118dbc9e08baec0dbd2a460b781b655e1e84807ccfb5827b4
+
all: ${DEBS} ${DBG_DEBS}
@echo ${DEBS}
@echo ${DBG_DEBS}
@@ -90,6 +95,8 @@ ${BUILDSRC}: ${SRCDIR} patches
deb: ${DEBS} ${DBG_DEBS}
${DEBS_REST} ${DBG_DEBS}: $(MAIN_DEB)
$(MAIN_DEB): ${BUILDSRC}
+ @echo "${SYSCTL_CONF_CHECKSUM} ${BUILDSRC}/${SYSCTL_CONF}" | sha256sum -c || \
+ (echo "sysctl settings file changed, adjust ceph-osd postinst and Makefile!"; exit 1)
cd ${BUILDSRC}; dpkg-buildpackage -b -uc -us
lintian ${DEBS}
@echo ${DEBS}
--
2.39.2
More information about the pve-devel
mailing list