public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 11-16 of 16 v2 0/6] and now for the second half
@ 2017-08-03 19:15 Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb Henning Schild
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

For a possible integration in OE you should use the same names. If your 
base class inherits the OE base class you already have implementations.
Than your base class does not need to define the tasks and their order 
anymore and you overwrite the tasks you do not need.
If we do not go on top of OE we should still use the same names for the
same tasks.
That is why i am still causing name-clashes here.

11v1 dropped
 - do_compile would have been one matching OE name, but the match is
not perfect 
12v1 -> 1v2
 - use OE name
2v2
 - is a completely new one, but seems obvious
13v1 -> 3v2
 - create a new class isar-base-dpkg so images still have the fetcher
and unpacker
14v1 -> 4v2
 - unchanged
15v1 -> 5v2
 - update commit comment to explain why and what that is
 - rename DEBIAN_MAINTAINER to MAINTAINER
 - /find/find -type f/
 - /> $CONFFILES/>> $CONFFILES/  
 - /sed ..||/sed .. |/|/ in the conffiles the leading / was missing
 - put conffiles magic into its own task to allow easy
customization/disabling
 - add a basic header, not sure how license headers should look like
16v1 -> 6v2
 - use fetcher for FILES
 - have an example conffile
 - add a harmless depends example
 - small changes to the example postinst
 - introduce hack to handle BUILDROOT weirdness, needs to be discussed
   further


Henning Schild (6):
  meta: dpkg rename install to package_write_deb
  package_write_deb: change access rights on .debs
  meta: classes: move package_write_deb to new class isar-base-dpkg
  meta: classes: rename dpkg to dpkg-src
  meta: add dpkg-bin class
  recipes-app/hello-bin: add example on how to use dpkg-bin

 meta-isar/recipes-app/hello-bin/files/README     |  1 +
 meta-isar/recipes-app/hello-bin/files/postinst   | 16 +++++++
 meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 38 ++++++++++++++++
 meta-isar/recipes-app/hello/hello.bb             |  2 +-
 meta/classes/dpkg-bin.bbclass                    | 56 ++++++++++++++++++++++++
 meta/classes/dpkg-src.bbclass                    | 15 +++++++
 meta/classes/dpkg.bbclass                        | 34 --------------
 meta/classes/image.bbclass                       |  2 +-
 meta/classes/isar-base-dpkg.bbclass              | 40 +++++++++++++++++
 9 files changed, 168 insertions(+), 36 deletions(-)
 create mode 100644 meta-isar/recipes-app/hello-bin/files/README
 create mode 100644 meta-isar/recipes-app/hello-bin/files/postinst
 create mode 100644 meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb
 create mode 100644 meta/classes/dpkg-bin.bbclass
 create mode 100644 meta/classes/dpkg-src.bbclass
 delete mode 100644 meta/classes/dpkg.bbclass
 create mode 100644 meta/classes/isar-base-dpkg.bbclass

-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb
  2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
@ 2017-08-03 19:15 ` Henning Schild
  2017-08-08 13:06   ` Alexander Smirnov
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs Henning Schild
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

This way we stay with OE names. The name "install" will be used to
populate ${D} in a later patch, also in line with OE.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg.bbclass  | 9 ++++-----
 meta/classes/image.bbclass | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index ca0c5ab..97238b5 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -23,12 +23,11 @@ do_build() {
     sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
 }
 
-
 # Install package to dedicated deploy directory
-do_install() {
+do_package_write_deb() {
     install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
 }
 
-addtask install after do_build
-do_install[dirs] = "${DEPLOY_DIR_DEB}"
-do_install[stamp-extra-info] = "${MACHINE}"
+addtask package_write_deb after do_build
+do_package_write_deb[dirs] = "${DEPLOY_DIR_DEB}"
+do_package_write_deb[stamp-extra-info] = "${MACHINE}"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3e4877c..f60ec11 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -27,4 +27,4 @@ do_populate() {
 }
 
 addtask populate before do_build
-do_populate[deptask] = "do_install"
+do_populate[deptask] = "do_package_write_deb"
-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs
  2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb Henning Schild
@ 2017-08-03 19:15 ` Henning Schild
  2017-08-08 13:16   ` Alexander Smirnov
  2017-08-21 23:14   ` Baurzhan Ismagulov
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 3/6] meta: classes: move package_write_deb to new class isar-base-dpkg Henning Schild
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

The packets do not need to be x-able, that was probably a copy/paste
artefact.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 97238b5..e86e0f4 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -25,7 +25,7 @@ do_build() {
 
 # Install package to dedicated deploy directory
 do_package_write_deb() {
-    install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
+    install -m 644 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
 }
 
 addtask package_write_deb after do_build
-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 11-16 of 16 v2 3/6] meta: classes: move package_write_deb to new class isar-base-dpkg
  2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs Henning Schild
@ 2017-08-03 19:15 ` Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 4/6] meta: classes: rename dpkg to dpkg-src Henning Schild
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

This step is generic to later classes that generate .deb files. This is
preparing for another class doing so.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg.bbclass           | 20 +------------------
 meta/classes/isar-base-dpkg.bbclass | 40 +++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 19 deletions(-)
 create mode 100644 meta/classes/isar-base-dpkg.bbclass

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index e86e0f4..ca687de 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -1,33 +1,15 @@
 # This software is a part of ISAR.
 # Copyright (C) 2015-2016 ilbers GmbH
 
-inherit isar-base
+inherit isar-base-dpkg
 
 # Add dependency from buildchroot creation
 DEPENDS += "buildchroot"
 do_unpack[deptask] = "do_build"
 
-# Each package should have its own unique build folder, so use
-# recipe name as identifier
-PP = "/home/builder/${PN}"
-BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
-S ?= "${BUILDROOT}"
-
-# make the unpacker extract to BUILDROOT
-WORKDIR_task-unpack = "${BUILDROOT}"
-
 do_build[stamp-extra-info] = "${DISTRO}"
 
 # Build package from sources using build script
 do_build() {
     sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
 }
-
-# Install package to dedicated deploy directory
-do_package_write_deb() {
-    install -m 644 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
-}
-
-addtask package_write_deb after do_build
-do_package_write_deb[dirs] = "${DEPLOY_DIR_DEB}"
-do_package_write_deb[stamp-extra-info] = "${MACHINE}"
diff --git a/meta/classes/isar-base-dpkg.bbclass b/meta/classes/isar-base-dpkg.bbclass
new file mode 100644
index 0000000..e2c151b
--- /dev/null
+++ b/meta/classes/isar-base-dpkg.bbclass
@@ -0,0 +1,40 @@
+# This software is a part of ISAR.
+# Copyright (C) 2017  Siemens AG
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+inherit isar-base
+
+# Each package should have its own unique build folder, so use
+# recipe name as identifier
+PP = "/home/builder/${PN}"
+BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
+S ?= "${BUILDROOT}"
+
+# make the unpacker extract to BUILDROOT
+WORKDIR_task-unpack = "${BUILDROOT}"
+
+# Install package to dedicated deploy directory
+do_package_write_deb() {
+    install -m 644 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
+}
+
+addtask package_write_deb after do_build
+do_package_write_deb[dirs] = "${DEPLOY_DIR_DEB}"
+do_package_write_deb[stamp-extra-info] = "${MACHINE}"
-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 11-16 of 16 v2 4/6] meta: classes: rename dpkg to dpkg-src
  2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
                   ` (2 preceding siblings ...)
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 3/6] meta: classes: move package_write_deb to new class isar-base-dpkg Henning Schild
@ 2017-08-03 19:15 ` Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 5/6] meta: add dpkg-bin class Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 6/6] recipes-app/hello-bin: add example on how to use dpkg-bin Henning Schild
  5 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

We will soon have another dpkg-class prepare for that.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta-isar/recipes-app/hello/hello.bb            | 2 +-
 meta/classes/{dpkg.bbclass => dpkg-src.bbclass} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename meta/classes/{dpkg.bbclass => dpkg-src.bbclass} (100%)

diff --git a/meta-isar/recipes-app/hello/hello.bb b/meta-isar/recipes-app/hello/hello.bb
index 56424fb..5c5d714 100644
--- a/meta-isar/recipes-app/hello/hello.bb
+++ b/meta-isar/recipes-app/hello/hello.bb
@@ -15,4 +15,4 @@ SRCREV = "ad7065ecc4840cc436bfcdac427386dbba4ea719"
 
 SRC_DIR = "git"
 
-inherit dpkg
+inherit dpkg-src
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg-src.bbclass
similarity index 100%
rename from meta/classes/dpkg.bbclass
rename to meta/classes/dpkg-src.bbclass
-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 11-16 of 16 v2 5/6] meta: add dpkg-bin class
  2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
                   ` (3 preceding siblings ...)
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 4/6] meta: classes: rename dpkg to dpkg-src Henning Schild
@ 2017-08-03 19:15 ` Henning Schild
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 6/6] recipes-app/hello-bin: add example on how to use dpkg-bin Henning Schild
  5 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

This class introduces a new class for building debian packages on the
fly. They can basically contain anything from random sources, where
building happens outside of Isar. It also allows to create meta-packages
that contain nothing but pull in dependencies, once all our packets come
in via multistrap that will come in handy.
For rootfs configuration you would use post- and pre- scripts just like
regular debian packages do.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg-bin.bbclass | 56 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 meta/classes/dpkg-bin.bbclass

diff --git a/meta/classes/dpkg-bin.bbclass b/meta/classes/dpkg-bin.bbclass
new file mode 100644
index 0000000..29480ff
--- /dev/null
+++ b/meta/classes/dpkg-bin.bbclass
@@ -0,0 +1,56 @@
+# This software is a part of ISAR.
+# Copyright (C) 2017 Siemens AG
+
+inherit isar-base-dpkg
+
+DEBIAN_DEPENDS ?= ""
+MAINTAINER ?= "FIXME Unknown maintainer"
+
+D = "${WORKDIR}/image/"
+
+# Populate folder that will be picked up as package
+do_install() {
+	bbnote "Put your files for this package in ${D}"
+}
+
+addtask install after do_unpack before do_deb_package_prepare
+
+# so we can put hooks etc. in there already
+do_install[dirs] = "${D}/DEBIAN"
+
+do_deb_package_prepare() {
+	cat<<-__EOF__ > ${D}/DEBIAN/control
+		Package: ${PN}
+		Architecture: `dpkg --print-architecture`
+		Section: misc
+		Priority: optional
+		Maintainer: ${MAINTAINER}
+		Depends: `echo ${DEBIAN_DEPENDS} | tr '[:blank:]' ','`
+		Version: ${PV}+isar
+		Description: ${DESCRIPTION}
+	__EOF__
+	for t in pre post
+	do
+		for a in inst rm
+		do
+			chmod -f +x ${D}/DEBIAN/${t}${a} || true
+		done
+	done
+}
+
+addtask deb_package_prepare after do_install before do_deb_package_conffiles
+
+do_deb_package_conffiles() {
+	CONFFILES=${D}/DEBIAN/conffiles
+	find ${D} -type f -path '*/etc/*' | sed -e 's|^${D}|/|' >> $CONFFILES
+	test -s $CONFFILES || rm $CONFFILES
+}
+
+addtask deb_package_conffiles after do_deb_package_prepare before do_deb_package
+
+do_deb_package() {
+	sudo chown -R root:root ${D}/DEBIAN/
+	sudo dpkg-deb --build ${D} ${WORKDIR}
+}
+
+addtask deb_package after do_deb_package_conffiles before do_package_write_deb
-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 11-16 of 16 v2 6/6] recipes-app/hello-bin: add example on how to use dpkg-bin
  2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
                   ` (4 preceding siblings ...)
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 5/6] meta: add dpkg-bin class Henning Schild
@ 2017-08-03 19:15 ` Henning Schild
  5 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2017-08-03 19:15 UTC (permalink / raw)
  To: isar-users; +Cc: Alexander Smirnov, Henning Schild

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta-isar/recipes-app/hello-bin/files/README     |  1 +
 meta-isar/recipes-app/hello-bin/files/postinst   | 16 ++++++++++
 meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 38 ++++++++++++++++++++++++
 3 files changed, 55 insertions(+)
 create mode 100644 meta-isar/recipes-app/hello-bin/files/README
 create mode 100644 meta-isar/recipes-app/hello-bin/files/postinst
 create mode 100644 meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb

diff --git a/meta-isar/recipes-app/hello-bin/files/README b/meta-isar/recipes-app/hello-bin/files/README
new file mode 100644
index 0000000..6e2ce0f
--- /dev/null
+++ b/meta-isar/recipes-app/hello-bin/files/README
@@ -0,0 +1 @@
+This is an example file that we get from FILESDIR in recipe.
diff --git a/meta-isar/recipes-app/hello-bin/files/postinst b/meta-isar/recipes-app/hello-bin/files/postinst
new file mode 100644
index 0000000..a47abf3
--- /dev/null
+++ b/meta-isar/recipes-app/hello-bin/files/postinst
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if ! getent group hello >/dev/null; then
+	addgroup --quiet --system hello
+fi
+
+if ! getent passwd hello >/dev/null; then
+	useradd --system --gid hello --create-home \
+		--home /var/lib/hello --no-user-group \
+		--comment "My hello user" \
+		hello
+fi
+
+chown -R hello:hello /var/lib/hello
diff --git a/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb
new file mode 100644
index 0000000..d739dbf
--- /dev/null
+++ b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb
@@ -0,0 +1,38 @@
+# Sample application using dpkg-bin, which turns a folder (${D}) of
+# files into a .deb 
+#
+# This software is a part of ISAR.
+
+DESCRIPTION = "Sample bin application for ISAR"
+MAINTAINER = "Your name here <you@domain.com>"
+DEBIAN_DEPENDS = "apt"
+
+SRC_URI = "file://README \
+	   file://postinst"
+
+# we have to do that because we are using a broken unpack
+WORKDIR = "${BUILDROOT}"
+
+inherit dpkg-bin
+
+do_install() {
+	bbnote "Creating ${PN} binary"
+	echo "#!/bin/sh" > ${WORKDIR}/${PN}
+	echo "echo Hello World! ${PN}_${PV}" >> ${WORKDIR}/${PN}
+
+	bbnote "Putting ${PN} into package"
+	install -v -d ${D}/usr/local/bin/
+	install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
+
+	bbnote "Now copy ${FILESDIR}/README into package"
+	install -v -d ${D}/usr/local/doc/
+	install -v -m 644 ${WORKDIR}/README ${D}/usr/local/doc/README-${P}
+
+	bbnote "Now for a debian hook, see dpkg-deb"
+	install -v -m 755 ${WORKDIR}/postinst ${D}/DEBIAN/postinst
+
+	bbnote "Now for a faked config file"
+	echo "# empty config file" > ${WORKDIR}/${PN}.conf
+	install -v -d ${D}/usr/local/etc/
+	install -v -m 644 ${WORKDIR}/${PN}.conf ${D}/usr/local/etc/${PN}.conf
+}
-- 
2.13.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb Henning Schild
@ 2017-08-08 13:06   ` Alexander Smirnov
  2017-08-08 14:49     ` Henning Schild
  0 siblings, 1 reply; 12+ messages in thread
From: Alexander Smirnov @ 2017-08-08 13:06 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

[-- Attachment #1: Type: text/plain, Size: 2659 bytes --]

2017-08-03 22:15 GMT+03:00 Henning Schild <henning.schild@siemens.com>:

> This way we stay with OE names. The name "install" will be used to
> populate ${D} in a later patch, also in line with OE.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/classes/dpkg.bbclass  | 9 ++++-----
>  meta/classes/image.bbclass | 2 +-
>  2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> index ca0c5ab..97238b5 100644
> --- a/meta/classes/dpkg.bbclass
> +++ b/meta/classes/dpkg.bbclass
> @@ -23,12 +23,11 @@ do_build() {
>      sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
>  }
>
> -
>  # Install package to dedicated deploy directory
> -do_install() {
> +do_package_write_deb() {
>

Why it's 'package_write_deb'? If we speak about 'like-OE' style, in OE this
function does (NOTE: I provide links to GitHub because they have line
numbering):

1. package_write_deb:
https://github.com/MentorEmbedded/poky/blob/master/meta/classes/package_deb.bbclass#L342

2. It calls package_deb:
https://github.com/MentorEmbedded/poky/blob/master/meta/classes/package_deb.bbclass#L51

So this function performs creating of deb package from built binaries.


In general it's quite difficult to map Isar package building process to OE
(some tasks like 'patch' are missed due to no meaning in this context):

1. Isar: fetch -> unpack -> (!) build (using dpkg)
2. OE: fetch -> unpack -> (!) configure -> compile -> install ->
package_write_deb

So all the tasks after (!) in OE are done in single task in Isar. That's
one of the Isar main difference from OE, that package building is performed
by native Debian tools and this process can't be break-down and one-to-one
mapped to OE tasks.

Regarding the function in patch, this is defenitely install and not package
write, but we can specify what kind of install, for example:
install_to_deploy, or populate_apt or etc...

Alex


>      install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
>  }
>
> -addtask install after do_build
> -do_install[dirs] = "${DEPLOY_DIR_DEB}"
> -do_install[stamp-extra-info] = "${MACHINE}"
> +addtask package_write_deb after do_build
> +do_package_write_deb[dirs] = "${DEPLOY_DIR_DEB}"
> +do_package_write_deb[stamp-extra-info] = "${MACHINE}"
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 3e4877c..f60ec11 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -27,4 +27,4 @@ do_populate() {
>  }
>
>  addtask populate before do_build
> -do_populate[deptask] = "do_install"
> +do_populate[deptask] = "do_package_write_deb"
> --
> 2.13.0
>
>

[-- Attachment #2: Type: text/html, Size: 4008 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs Henning Schild
@ 2017-08-08 13:16   ` Alexander Smirnov
  2017-08-21 23:14   ` Baurzhan Ismagulov
  1 sibling, 0 replies; 12+ messages in thread
From: Alexander Smirnov @ 2017-08-08 13:16 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

2017-08-03 22:15 GMT+03:00 Henning Schild <henning.schild@siemens.com>:

> The packets do not need to be x-able, that was probably a copy/paste
> artefact.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/classes/dpkg.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> index 97238b5..e86e0f4 100644
> --- a/meta/classes/dpkg.bbclass
> +++ b/meta/classes/dpkg.bbclass
> @@ -25,7 +25,7 @@ do_build() {
>
>  # Install package to dedicated deploy directory
>  do_package_write_deb() {
> -    install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
> +    install -m 644 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
>

Good point, thanks!


>  }
>
>  addtask package_write_deb after do_build
> --
> 2.13.0
>
>

[-- Attachment #2: Type: text/html, Size: 1460 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb
  2017-08-08 13:06   ` Alexander Smirnov
@ 2017-08-08 14:49     ` Henning Schild
  2017-08-08 15:06       ` Alexander Smirnov
  0 siblings, 1 reply; 12+ messages in thread
From: Henning Schild @ 2017-08-08 14:49 UTC (permalink / raw)
  To: Alexander Smirnov; +Cc: isar-users

Am Tue, 8 Aug 2017 16:06:11 +0300
schrieb Alexander Smirnov <alex.bluesman.smirnov@gmail.com>:

> 2017-08-03 22:15 GMT+03:00 Henning Schild
> <henning.schild@siemens.com>:
> 
> > This way we stay with OE names. The name "install" will be used to
> > populate ${D} in a later patch, also in line with OE.
> >
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> >  meta/classes/dpkg.bbclass  | 9 ++++-----
> >  meta/classes/image.bbclass | 2 +-
> >  2 files changed, 5 insertions(+), 6 deletions(-)
> >
> > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> > index ca0c5ab..97238b5 100644
> > --- a/meta/classes/dpkg.bbclass
> > +++ b/meta/classes/dpkg.bbclass
> > @@ -23,12 +23,11 @@ do_build() {
> >      sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> >  }
> >
> > -
> >  # Install package to dedicated deploy directory
> > -do_install() {
> > +do_package_write_deb() {
> >  
> 
> Why it's 'package_write_deb'? If we speak about 'like-OE' style, in
> OE this function does (NOTE: I provide links to GitHub because they
> have line numbering):
> 
> 1. package_write_deb:
> https://github.com/MentorEmbedded/poky/blob/master/meta/classes/package_deb.bbclass#L342
> 
> 2. It calls package_deb:
> https://github.com/MentorEmbedded/poky/blob/master/meta/classes/package_deb.bbclass#L51
> 
> So this function performs creating of deb package from built binaries.
> 
> 
> In general it's quite difficult to map Isar package building process
> to OE (some tasks like 'patch' are missed due to no meaning in this
> context):
> 
> 1. Isar: fetch -> unpack -> (!) build (using dpkg)
>
> 2. OE: fetch -> unpack -> (!) configure -> compile -> install ->
> package_write_deb
> 
> So all the tasks after (!) in OE are done in single task in Isar.
> That's one of the Isar main difference from OE, that package building
> is performed by native Debian tools and this process can't be
> break-down and one-to-one mapped to OE tasks.
>
> Regarding the function in patch, this is defenitely install and not
> package write, but we can specify what kind of install, for example:
> install_to_deploy, or populate_apt or etc...

http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#ref-tasks-package_write_deb

Yes they also build the package in that step. But after that step
a .deb is in DEPLOY_DEB_DIR.

Henning

> Alex
> 
> 
> >      install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
> >  }
> >
> > -addtask install after do_build
> > -do_install[dirs] = "${DEPLOY_DIR_DEB}"
> > -do_install[stamp-extra-info] = "${MACHINE}"
> > +addtask package_write_deb after do_build
> > +do_package_write_deb[dirs] = "${DEPLOY_DIR_DEB}"
> > +do_package_write_deb[stamp-extra-info] = "${MACHINE}"
> > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > index 3e4877c..f60ec11 100644
> > --- a/meta/classes/image.bbclass
> > +++ b/meta/classes/image.bbclass
> > @@ -27,4 +27,4 @@ do_populate() {
> >  }
> >
> >  addtask populate before do_build
> > -do_populate[deptask] = "do_install"
> > +do_populate[deptask] = "do_package_write_deb"
> > --
> > 2.13.0
> >
> >  


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb
  2017-08-08 14:49     ` Henning Schild
@ 2017-08-08 15:06       ` Alexander Smirnov
  0 siblings, 0 replies; 12+ messages in thread
From: Alexander Smirnov @ 2017-08-08 15:06 UTC (permalink / raw)
  To: isar-users

On 08/08/2017 05:49 PM, Henning Schild wrote:
> Am Tue, 8 Aug 2017 16:06:11 +0300
> schrieb Alexander Smirnov <alex.bluesman.smirnov@gmail.com>:
> 
>> 2017-08-03 22:15 GMT+03:00 Henning Schild
>> <henning.schild@siemens.com>:
>>
>>> This way we stay with OE names. The name "install" will be used to
>>> populate ${D} in a later patch, also in line with OE.
>>>
>>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
>>> ---
>>>   meta/classes/dpkg.bbclass  | 9 ++++-----
>>>   meta/classes/image.bbclass | 2 +-
>>>   2 files changed, 5 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
>>> index ca0c5ab..97238b5 100644
>>> --- a/meta/classes/dpkg.bbclass
>>> +++ b/meta/classes/dpkg.bbclass
>>> @@ -23,12 +23,11 @@ do_build() {
>>>       sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
>>>   }
>>>
>>> -
>>>   # Install package to dedicated deploy directory
>>> -do_install() {
>>> +do_package_write_deb() {
>>>   
>>
>> Why it's 'package_write_deb'? If we speak about 'like-OE' style, in
>> OE this function does (NOTE: I provide links to GitHub because they
>> have line numbering):
>>
>> 1. package_write_deb:
>> https://github.com/MentorEmbedded/poky/blob/master/meta/classes/package_deb.bbclass#L342
>>
>> 2. It calls package_deb:
>> https://github.com/MentorEmbedded/poky/blob/master/meta/classes/package_deb.bbclass#L51
>>
>> So this function performs creating of deb package from built binaries.
>>
>>
>> In general it's quite difficult to map Isar package building process
>> to OE (some tasks like 'patch' are missed due to no meaning in this
>> context):
>>
>> 1. Isar: fetch -> unpack -> (!) build (using dpkg)
>>
>> 2. OE: fetch -> unpack -> (!) configure -> compile -> install ->
>> package_write_deb
>>
>> So all the tasks after (!) in OE are done in single task in Isar.
>> That's one of the Isar main difference from OE, that package building
>> is performed by native Debian tools and this process can't be
>> break-down and one-to-one mapped to OE tasks.
>>
>> Regarding the function in patch, this is defenitely install and not
>> package write, but we can specify what kind of install, for example:
>> install_to_deploy, or populate_apt or etc...
> 
> http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#ref-tasks-package_write_deb
> 
> Yes they also build the package in that step. But after that step
> a .deb is in DEPLOY_DEB_DIR.

In your link, this task *creates* Debian package and stores it to deploy 
directory, what is *not* true for Isar. I'd suggest to name tasks 
identically to OE *only* when they have identical meaning, otherwise 
there is no reason to do so.

Isar is not OE, so not every task in Isar could be directly mapped to 
relevant OE one.

Alex

>>
>>
>>>       install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
>>>   }
>>>
>>> -addtask install after do_build
>>> -do_install[dirs] = "${DEPLOY_DIR_DEB}"
>>> -do_install[stamp-extra-info] = "${MACHINE}"
>>> +addtask package_write_deb after do_build
>>> +do_package_write_deb[dirs] = "${DEPLOY_DIR_DEB}"
>>> +do_package_write_deb[stamp-extra-info] = "${MACHINE}"
>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>> index 3e4877c..f60ec11 100644
>>> --- a/meta/classes/image.bbclass
>>> +++ b/meta/classes/image.bbclass
>>> @@ -27,4 +27,4 @@ do_populate() {
>>>   }
>>>
>>>   addtask populate before do_build
>>> -do_populate[deptask] = "do_install"
>>> +do_populate[deptask] = "do_package_write_deb"
>>> --
>>> 2.13.0
>>>
>>>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs
  2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs Henning Schild
  2017-08-08 13:16   ` Alexander Smirnov
@ 2017-08-21 23:14   ` Baurzhan Ismagulov
  1 sibling, 0 replies; 12+ messages in thread
From: Baurzhan Ismagulov @ 2017-08-21 23:14 UTC (permalink / raw)
  To: isar-users

On Thu, Aug 03, 2017 at 09:15:20PM +0200, Henning Schild wrote:
> The packets do not need to be x-able, that was probably a copy/paste
> artefact.

Applied with comment amendments, thanks.

With kind regards,
Baurzhan.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-08-21 23:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03 19:15 [PATCH 11-16 of 16 v2 0/6] and now for the second half Henning Schild
2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 1/6] meta: dpkg rename install to package_write_deb Henning Schild
2017-08-08 13:06   ` Alexander Smirnov
2017-08-08 14:49     ` Henning Schild
2017-08-08 15:06       ` Alexander Smirnov
2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 2/6] package_write_deb: change access rights on .debs Henning Schild
2017-08-08 13:16   ` Alexander Smirnov
2017-08-21 23:14   ` Baurzhan Ismagulov
2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 3/6] meta: classes: move package_write_deb to new class isar-base-dpkg Henning Schild
2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 4/6] meta: classes: rename dpkg to dpkg-src Henning Schild
2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 5/6] meta: add dpkg-bin class Henning Schild
2017-08-03 19:15 ` [PATCH 11-16 of 16 v2 6/6] recipes-app/hello-bin: add example on how to use dpkg-bin Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox