Skip to contentSkip to conversation

skopeo: add native and nativesdk support

PATCH In review Xu, Yanfei 2 participants 2 messages Jun 22, 2021 – Jun 24, 2021

lore
Share & tools
lore

Xu, Yanfei

author
#0 lore raw

PATCH 1/1 skopeo: add native and nativesdk support

1.Add native and nativesdk support.

2.Replace "multipath-tools" with "libdevmapper" and "lvm2". Because the really direct DEPENDS package is "libdevmapper" and "lvm2". Log of do_comopile as below:

-----------------[cut here]---------------------
DEBUG: Executing shell function do_compile
NOTE: make -j 40 BUILDTAGS= bin/skopeo CGO_CFLAGS="-I/...../usr/include" CGO_LDFLAGS="-L/...../usr/lib
-lgpgme -lgpg-error -lassuan" GO111MODULE=on go build -mod=vendor "-buildmode=pie" -ldflags '-X main.gitCommit=8efffce8befc2de87670ba75d6c86ada61e869fd ' -gcflags "" -tags "" -o bin/skopeo ./cmd/skopeo
Package devmapper was not found in the pkg-config search path. Perhaps you should add the directory containing `devmapper.pc' to the PKG_CONFIG_PATH environment variable
No package 'devmapper' found
pkg-config: exit status 1
make: *** [Makefile:134: bin/skopeo] Error 2

---
 recipes-containers/skopeo/skopeo_git.bb | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
recipes-containers/skopeo/skopeo_git.bb +14 -1
index 2c292463..6c95bf3e 100644
@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=7e611105d3e369954840a6668c4385
 
 DEPENDS = " \
     gpgme \
-    multipath-tools \
+    libdevmapper \
+    lvm2 \
     btrfs-tools \
     glib-2.0 \
     ostree \
@@ -80,4 +81,16 @@ do_install() {
 	install ${WORKDIR}/registries.conf ${D}/${sysconfdir}/containers/registries.conf
 }
 
+do_install_append_class-native() {
+    create_cmdline_wrapper ${D}/${sbindir}/skopeo \
+        --policy ${sysconfdir}/containers/policy.json
+}
+
+do_install_append_class-nativesdk() {
+    create_cmdline_wrapper ${D}/${sbindir}/skopeo \
+        --policy ${sysconfdir}/containers/policy.json
+}
+
 INSANE_SKIP_${PN} += "ldflags"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.27.0
#1 lore raw

merged

Bruce

Quoted 65 lines · Yanfei

1.Add native and nativesdk support.

2.Replace "multipath-tools" with "libdevmapper" and "lvm2". Because the really direct DEPENDS package is "libdevmapper" and "lvm2". Log of do_comopile as below:

-----------------[cut here]---------------------
DEBUG: Executing shell function do_compile
NOTE: make -j 40 BUILDTAGS= bin/skopeo CGO_CFLAGS="-I/...../usr/include" CGO_LDFLAGS="-L/...../usr/lib
-lgpgme -lgpg-error -lassuan" GO111MODULE=on go build -mod=vendor "-buildmode=pie" -ldflags '-X main.gitCommit=8efffce8befc2de87670ba75d6c86ada61e869fd ' -gcflags "" -tags "" -o bin/skopeo ./cmd/skopeo
Package devmapper was not found in the pkg-config search path. Perhaps you should add the directory containing `devmapper.pc' to the PKG_CONFIG_PATH environment variable
No package 'devmapper' found
pkg-config: exit status 1
make: *** [Makefile:134: bin/skopeo] Error 2

---
 recipes-containers/skopeo/skopeo_git.bb | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
recipes-containers/skopeo/skopeo_git.bb +14 -2
index 2c292463..6c95bf3e 100644
@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=7e611105d3e369954840a6668c4385
 
 DEPENDS = " \
     gpgme \
-    multipath-tools \
+    libdevmapper \
+    lvm2 \
     btrfs-tools \
     glib-2.0 \
     ostree \
@@ -80,4 +81,16 @@ do_install() {
        install ${WORKDIR}/registries.conf ${D}/${sysconfdir}/containers/registries.conf
 }
 
+do_install_append_class-native() {
+    create_cmdline_wrapper ${D}/${sbindir}/skopeo \
+        --policy ${sysconfdir}/containers/policy.json
+}
+
+do_install_append_class-nativesdk() {
+    create_cmdline_wrapper ${D}/${sbindir}/skopeo \
+        --policy ${sysconfdir}/containers/policy.json
+}
+
 INSANE_SKIP_${PN} += "ldflags"
+
+BBCLASSEXTEND = "native nativesdk"
--

2.27.0

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II