Skip to contentSkip to conversation

nerdctl: fix installed-vs-shipped with usrmerge

PATCH New Martin Jansa 1 participant 3 messages Aug 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 nerdctl: fix installed-vs-shipped with usrmerge

* fixes:
ERROR: nerdctl-v1.3.0-r0 do_package: QA Issue: nerdctl: Files/directories were installed but not shipped in any package:
/bin
/bin/nerdctl
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
nerdctl: 2 installed and not shipped files. [installed-vs-shipped]

---
 recipes-containers/nerdctl/nerdctl_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-containers/nerdctl/nerdctl_git.bb +2 -2
index ca4d3c6..62460a5 100644
@@ -75,8 +75,8 @@ do_compile() {
 }
 
 do_install() {
-        install -d "${D}${BIN_PREFIX}/bin"
-        install -m 755 "${S}/src/import/_output/nerdctl" "${D}${BIN_PREFIX}/bin"
+        install -d "${D}${BIN_PREFIX}${base_bindir}"
+        install -m 755 "${S}/src/import/_output/nerdctl" "${D}${BIN_PREFIX}${base_bindir}"
 }
 
 INHIBIT_PACKAGE_STRIP = "1"
Signature · 1 line
2.41.0
#1 lore raw

PATCH 2/3 kubernetes: fix installed-vs-shipped with usrmerge

* fixes:
ERROR: kubernetes-1_v1.27.1+git2555e0f90e80a13628f47eca5cde34decc89babb-r0 do_package: QA Issue: kubernetes: Files/directories were installed but not shipped in any package:
/bin
/bin/k8s-init
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
kubernetes: 2 installed and not shipped files. [installed-vs-shipped]

---
 recipes-containers/kubernetes/kubernetes_git.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
recipes-containers/kubernetes/kubernetes_git.bb +3 -3
index 1989350..c6d8c43 100644
@@ -104,8 +104,8 @@ do_install() {
     install -m 0644 ${WORKDIR}/git/release/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf  ${D}${systemd_unitdir}/system/kubelet.service.d/
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-	install -d "${D}${BIN_PREFIX}/bin"
-	install -m 755 "${WORKDIR}/k8s-init" "${D}${BIN_PREFIX}/bin"
+	install -d "${D}${BIN_PREFIX}${base_bindir}"
+	install -m 755 "${WORKDIR}/k8s-init" "${D}${BIN_PREFIX}${base_bindir}"
 
 	install -d ${D}${sysconfdir}/sysctl.d
 	install -m 0644 "${WORKDIR}/99-kubernetes.conf" "${D}${sysconfdir}/sysctl.d"
@@ -143,7 +143,7 @@ FILES:kube-proxy = "${bindir}/kube-proxy"
 FILES:${PN}-misc = "${bindir} ${sysconfdir}/sysctl.d"
 
 ALLOW_EMPTY:${PN}-host = "1"
-FILES:${PN}-host = "${BIN_PREFIX}/bin/k8s-init"
+FILES:${PN}-host = "${BIN_PREFIX}${base_bindir}/k8s-init"
 RDEPENDS:${PN}-host = "${PN}"
 
 RRECOMMENDS:${PN} = "\
Signature · 1 line
2.41.0
#2 lore raw

PATCH 3/3 cloud-init: fix usrmerge QA issue

In reply to Martin Jansa

* backport a fix from 23.2 version (notice that the recipe claims to be:
v23.2.2+git, but the commit in master-next which updated PV only changed the branch name, not the SRCREV, so it's still 23.1 and missing this fix

  cloud-init/v23.2.2+git/git $ git describe --tags
  23.1-53-g57752970e

* fixes:
ERROR: cloud-init-v23.2.2+git-r0 do_package_qa: QA Issue: cloud-init package is not obeying usrmerge distro feature. /lib should be relocated to /usr. [usrmerge]

caused by udev rules:

  $ find cloud-init/v23.2.2+git/image/lib/
  cloud-init/v23.2.2+git/image/lib/
  cloud-init/v23.2.2+git/image/lib/udev
  cloud-init/v23.2.2+git/image/lib/udev/rules.d
  cloud-init/v23.2.2+git/image/lib/udev/rules.d/66-azure-ephemeral.rules
---
 ...-pkg-config-for-udev-rules-path-2137.patch | 50 +++++++++++++++++++
 recipes-extended/cloud-init/cloud-init_git.bb |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 recipes-extended/cloud-init/cloud-init/0002-setup.py-use-pkg-config-for-udev-rules-path-2137.patch
recipes-extended/cloud-init/cloud-init/0002-setup.py-use-pkg-config-for-udev-rules-path-2137.patch new file +50 -0
new file mode 100644
index 0000000..9f3760c
@@ -0,0 +1,50 @@
+From 57752970ebea017820343aadf11b65c537bef336 Mon Sep 17 00:00:00 2001
+From: dankm <[email protected]>
+Date: Fri, 28 Apr 2023 15:10:34 -0600
+Subject: [PATCH] setup.py: use pkg-config for udev/rules path (#2137)
+
+Distributions other than RHEL also use /usr/lib/udev for the rules
+path. Instead of hardcoding the udev rules path for RedHat, check
+pkg-config for the proper location.
+
+Upstream-Status: Backport [23.2 https://github.com/canonical/cloud-init/commit/5abf5f5f2cf93c57ac74220251d2a2acce5f7099]
+Signed-off-by: Martin Jansa <[email protected]>
+---
+ setup.py | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index a6dbc5c23..66e618d3a 100644
+--- a/setup.py
++++ b/setup.py
+@@ -46,7 +46,10 @@ def pkg_config_read(library, var):
+             "systemdsystemconfdir": "/etc/systemd/system",
+             "systemdsystemunitdir": "/lib/systemd/system",
+             "systemdsystemgeneratordir": "/lib/systemd/system-generators",
+-        }
++        },
++        "udev": {
++            "udevdir": "/lib/udev",
++        },
+     }
+     cmd = ["pkg-config", "--variable=%s" % var, library]
+     try:
+@@ -309,14 +312,13 @@ data_files = [
+     ),
+ ]
+ if not platform.system().endswith("BSD"):
+-
+-    RULES_PATH = LIB
+-    if os.path.isfile("/etc/redhat-release"):
+-        RULES_PATH = "/usr/lib"
++    RULES_PATH = pkg_config_read("udev", "udevdir")
++    if not in_virtualenv():
++        RULES_PATH = "/" + RULES_PATH
+ 
+     data_files.extend(
+         [
+-            (RULES_PATH + "/udev/rules.d", [f for f in glob("udev/*.rules")]),
++            (RULES_PATH + "/rules.d", [f for f in glob("udev/*.rules")]),
+             (
+                 ETC + "/systemd/system/[email protected]/",
+                 ["systemd/disable-sshd-keygen-if-cloud-init-active.conf"],
recipes-extended/cloud-init/cloud-init_git.bb +1 -0
index f07bcf7..b5c2d71 100644
@@ -11,6 +11,7 @@ SRCREV = "e02c4607923af64311c70ae9a06d6794355e9a61"
 SRC_URI = "git://github.com/canonical/cloud-init;branch=23.2.x;protocol=https \
     file://cloud-init-source-local-lsb-functions.patch \
     file://0001-setup.py-check-for-install-anywhere-in-args.patch \
+    file://0002-setup.py-use-pkg-config-for-udev-rules-path-2137.patch \
 "
 
 PV = "v23.2.2+git"
Signature · 1 line
2.41.0