* [PATCH v2 1/6] meta: Move 'do_fetch' and 'do_unpack' to base-class
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
@ 2017-09-12 15:58 ` Henning Schild
2017-09-12 15:58 ` [PATCH v2 2/6] meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass Henning Schild
` (7 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-12 15:58 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Henning Schild, Claudius Heine
Issues:
unpack and fetch can only be used if you inherit dpkg, they should be
available to others i.e. classes and images
Change:
Pull the code out of the dpdk-class and stick it into the base-class. It is the
same code, no changes to it.
Impact:
This patch does not change the behaviour of Isar. It addresses the
issue, preparing for future patches.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/base.bbclass | 37 +++++++++++++++++++++++++++++++++++++
meta/classes/dpkg.bbclass | 37 -------------------------------------
2 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 2179ba9..7d44f72 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -58,6 +58,43 @@ python do_listtasks() {
sys.__stdout__.write("%s\n" % e)
}
+do_fetch[dirs] = "${DL_DIR}"
+
+# Fetch package from the source link
+python do_fetch() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.download()
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask fetch before do_build
+
+do_unpack[dirs] = "${WORKDIR}"
+do_unpack[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+
+# Unpack package and put it into working directory
+python do_unpack() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ rootdir = d.getVar('WORKDIR', True)
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.unpack(rootdir)
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask unpack after do_fetch before do_build
+
addtask build
do_build[dirs] = "${TOPDIR}"
python base_do_build () {
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index c0c4499..504fd1b 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -9,43 +9,6 @@ do_build[deptask] = "do_build"
# recipe name as identifier
PP = "/home/builder/${PN}"
-do_fetch[dirs] = "${DL_DIR}"
-
-# Fetch package from the source link
-python do_fetch() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- try:
- fetcher = bb.fetch2.Fetch(src_uri, d)
- fetcher.download()
- except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
-}
-
-addtask fetch before do_build
-
-do_unpack[dirs] = "${WORKDIR}"
-do_unpack[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-
-# Unpack package and put it into working directory
-python do_unpack() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- rootdir = d.getVar('WORKDIR', True)
-
- try:
- fetcher = bb.fetch2.Fetch(src_uri, d)
- fetcher.unpack(rootdir)
- except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
-}
-
-addtask unpack after do_fetch before do_build
-
BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
--
2.13.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 2/6] meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
2017-09-12 15:58 ` [PATCH v2 1/6] meta: Move 'do_fetch' and 'do_unpack' to base-class Henning Schild
@ 2017-09-12 15:58 ` Henning Schild
2017-09-12 15:58 ` [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Henning Schild
` (6 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-12 15:58 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Henning Schild, Claudius Heine
Issue:
The 'do_install' in dpkg can only be used in this class or one derived from
it. But we are about to have another .deb-creating class, prepare for that
and move common code out.
Change:
Move do_install to a generic class that can be inherited by more specific
dpkg-classes.
Impact:
This patch does not change the behaviour of Isar. It addresses the issue
and prepares for another patch.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg-base.bbclass | 11 +++++++++++
meta/classes/dpkg.bbclass | 12 ++----------
2 files changed, 13 insertions(+), 10 deletions(-)
create mode 100644 meta/classes/dpkg-base.bbclass
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
new file mode 100644
index 0000000..64fd0e8
--- /dev/null
+++ b/meta/classes/dpkg-base.bbclass
@@ -0,0 +1,11 @@
+# This software is a part of ISAR.
+# Copyright (C) 2017 Siemens AG
+
+# Install package to dedicated deploy directory
+do_install() {
+ install -m 644 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
+}
+
+addtask install after do_build
+do_install[dirs] = "${DEPLOY_DIR_DEB}"
+do_install[stamp-extra-info] = "${MACHINE}"
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 504fd1b..abd4cef 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -1,6 +1,8 @@
# This software is a part of ISAR.
# Copyright (C) 2015-2016 ilbers GmbH
+inherit dpkg-base
+
# Add dependency from buildchroot creation
DEPENDS += "buildchroot"
do_build[deptask] = "do_build"
@@ -20,13 +22,3 @@ do_build() {
sudo umount ${BUILDROOT}
rm -rf ${BUILDROOT}
}
-
-
-# Install package to dedicated deploy directory
-do_install() {
- install -m 644 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
-}
-
-addtask install after do_build
-do_install[dirs] = "${DEPLOY_DIR_DEB}"
-do_install[stamp-extra-info] = "${MACHINE}"
--
2.13.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build'
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
2017-09-12 15:58 ` [PATCH v2 1/6] meta: Move 'do_fetch' and 'do_unpack' to base-class Henning Schild
2017-09-12 15:58 ` [PATCH v2 2/6] meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass Henning Schild
@ 2017-09-12 15:58 ` Henning Schild
2017-09-13 12:44 ` Alexander Smirnov
2017-09-12 15:58 ` [PATCH v2 4/6] meta/dpkg: Move 'do_build' and buildchroot stuff to dpkg-base.bbclass Henning Schild
` (5 subsequent siblings)
8 siblings, 1 reply; 25+ messages in thread
From: Henning Schild @ 2017-09-12 15:58 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Henning Schild, Claudius Heine
Issue:
The 'do_build' task in dpkg does more than just building, it also
prepares the build environment and cleans it up after building.
Other classes building debian packages might need the same steps while
implementing the actual build step in a different way.
Change:
Pull the actual building out into a function that gets called from
'do_build' between the pre and post stuff.
Impact:
This patch does not change the behaviour of Isar. It addresses the issue
and prepares for another patch.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg.bbclass | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index abd4cef..5c3c1f8 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
# Build package from sources using build script
+dpkg_runbuild() {
+ sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
+}
+
+# Wrap the function dpkg_runbuild with the bind mount for buildroot
do_build() {
mkdir -p ${BUILDROOT}
sudo mount --bind ${WORKDIR} ${BUILDROOT}
- sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
+ dpkg_runbuild
sudo umount ${BUILDROOT}
rm -rf ${BUILDROOT}
}
--
2.13.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build'
2017-09-12 15:58 ` [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Henning Schild
@ 2017-09-13 12:44 ` Alexander Smirnov
2017-09-13 13:41 ` Henning Schild
0 siblings, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-13 12:44 UTC (permalink / raw)
To: Henning Schild, isar-users; +Cc: Claudius Heine
Hi,
On 09/12/2017 06:58 PM, Henning Schild wrote:
> Issue:
> The 'do_build' task in dpkg does more than just building, it also
> prepares the build environment and cleans it up after building.
> Other classes building debian packages might need the same steps while
> implementing the actual build step in a different way.
>
> Change:
> Pull the actual building out into a function that gets called from
> 'do_build' between the pre and post stuff.
>
> Impact:
> This patch does not change the behaviour of Isar. It addresses the issue
> and prepares for another patch.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> meta/classes/dpkg.bbclass | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> index abd4cef..5c3c1f8 100644
> --- a/meta/classes/dpkg.bbclass
> +++ b/meta/classes/dpkg.bbclass
> @@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
>
> # Build package from sources using build script
> +dpkg_runbuild() {
> + sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> +}
That's one of the weak places in Isar (also there are several others
with the same issue). If chroot failed - we will have some folders
mounted. Can we somehow track return value and perform clean-up if build
failed?
I do not mean to rework this patch, this could be done later. The
question is if it's possible in general with such splitting approach.
Alex
> +
> +# Wrap the function dpkg_runbuild with the bind mount for buildroot
> do_build() {
> mkdir -p ${BUILDROOT}
> sudo mount --bind ${WORKDIR} ${BUILDROOT}
> - sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> + dpkg_runbuild
> sudo umount ${BUILDROOT}
> rm -rf ${BUILDROOT}
> }
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build'
2017-09-13 12:44 ` Alexander Smirnov
@ 2017-09-13 13:41 ` Henning Schild
2017-09-13 14:40 ` Claudius Heine
0 siblings, 1 reply; 25+ messages in thread
From: Henning Schild @ 2017-09-13 13:41 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users, Claudius Heine
Am Wed, 13 Sep 2017 15:44:00 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> Hi,
>
> On 09/12/2017 06:58 PM, Henning Schild wrote:
> > Issue:
> > The 'do_build' task in dpkg does more than just building, it also
> > prepares the build environment and cleans it up after building.
> > Other classes building debian packages might need the same steps
> > while implementing the actual build step in a different way.
> >
> > Change:
> > Pull the actual building out into a function that gets called from
> > 'do_build' between the pre and post stuff.
> >
> > Impact:
> > This patch does not change the behaviour of Isar. It addresses the
> > issue and prepares for another patch.
> >
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> > meta/classes/dpkg.bbclass | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> > index abd4cef..5c3c1f8 100644
> > --- a/meta/classes/dpkg.bbclass
> > +++ b/meta/classes/dpkg.bbclass
> > @@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
> > do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> >
> > # Build package from sources using build script
> > +dpkg_runbuild() {
> > + sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> > +}
>
> That's one of the weak places in Isar (also there are several others
> with the same issue). If chroot failed - we will have some folders
> mounted. Can we somehow track return value and perform clean-up if
> build failed?
I found that issue as well. But i decided to ignore it for now, because
i did not introduce it.
It would be easy to deal with it. i.e.
mkdir
touch
mount
do
umount
rm
rmdir
would become
ret=0
mkdir
touch
mount
do || ret=$?
umount
rm
rmdir
return ret
Henning
> I do not mean to rework this patch, this could be done later. The
> question is if it's possible in general with such splitting approach.
>
> Alex
>
> > +
> > +# Wrap the function dpkg_runbuild with the bind mount for buildroot
> > do_build() {
> > mkdir -p ${BUILDROOT}
> > sudo mount --bind ${WORKDIR} ${BUILDROOT}
> > - sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> > + dpkg_runbuild
> > sudo umount ${BUILDROOT}
> > rm -rf ${BUILDROOT}
> > }
> >
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build'
2017-09-13 13:41 ` Henning Schild
@ 2017-09-13 14:40 ` Claudius Heine
2017-09-13 15:27 ` Henning Schild
0 siblings, 1 reply; 25+ messages in thread
From: Claudius Heine @ 2017-09-13 14:40 UTC (permalink / raw)
To: Henning Schild, Alexander Smirnov; +Cc: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 2562 bytes --]
Hi,
On 13.09.2017 15:41, Henning Schild wrote:
> Am Wed, 13 Sep 2017 15:44:00 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>
>> Hi,
>>
>> On 09/12/2017 06:58 PM, Henning Schild wrote:
>>> Issue:
>>> The 'do_build' task in dpkg does more than just building, it also
>>> prepares the build environment and cleans it up after building.
>>> Other classes building debian packages might need the same steps
>>> while implementing the actual build step in a different way.
>>>
>>> Change:
>>> Pull the actual building out into a function that gets called from
>>> 'do_build' between the pre and post stuff.
>>>
>>> Impact:
>>> This patch does not change the behaviour of Isar. It addresses the
>>> issue and prepares for another patch.
>>>
>>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
>>> ---
>>> meta/classes/dpkg.bbclass | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
>>> index abd4cef..5c3c1f8 100644
>>> --- a/meta/classes/dpkg.bbclass
>>> +++ b/meta/classes/dpkg.bbclass
>>> @@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
>>> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
>>>
>>> # Build package from sources using build script
>>> +dpkg_runbuild() {
>>> + sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
>>> +}
>>
>> That's one of the weak places in Isar (also there are several others
>> with the same issue). If chroot failed - we will have some folders
>> mounted. Can we somehow track return value and perform clean-up if
>> build failed?
>
> I found that issue as well. But i decided to ignore it for now, because
> i did not introduce it.
>
> It would be easy to deal with it. i.e.
>
> mkdir
> touch
> mount
> do
> umount
> rm
> rmdir
>
> would become
>
> ret=0
> mkdir
> touch
> mount
> do || ret=$?
> umount
> rm
> rmdir
> return ret
Another solution might be to look into events and write some cleanup
code there [1].
Cheers,
Claudius
[1]
https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#events
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de
PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
Keyserver: hkp://pool.sks-keyservers.net
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build'
2017-09-13 14:40 ` Claudius Heine
@ 2017-09-13 15:27 ` Henning Schild
0 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-13 15:27 UTC (permalink / raw)
To: Claudius Heine; +Cc: Alexander Smirnov, isar-users
Am Wed, 13 Sep 2017 16:40:50 +0200
schrieb Claudius Heine <ch@denx.de>:
> Hi,
>
> On 13.09.2017 15:41, Henning Schild wrote:
> > Am Wed, 13 Sep 2017 15:44:00 +0300
> > schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> >
> >> Hi,
> >>
> >> On 09/12/2017 06:58 PM, Henning Schild wrote:
> >>> Issue:
> >>> The 'do_build' task in dpkg does more than just building, it also
> >>> prepares the build environment and cleans it up after building.
> >>> Other classes building debian packages might need the same steps
> >>> while implementing the actual build step in a different way.
> >>>
> >>> Change:
> >>> Pull the actual building out into a function that gets called from
> >>> 'do_build' between the pre and post stuff.
> >>>
> >>> Impact:
> >>> This patch does not change the behaviour of Isar. It addresses the
> >>> issue and prepares for another patch.
> >>>
> >>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> >>> ---
> >>> meta/classes/dpkg.bbclass | 7 ++++++-
> >>> 1 file changed, 6 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> >>> index abd4cef..5c3c1f8 100644
> >>> --- a/meta/classes/dpkg.bbclass
> >>> +++ b/meta/classes/dpkg.bbclass
> >>> @@ -15,10 +15,15 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
> >>> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> >>>
> >>> # Build package from sources using build script
> >>> +dpkg_runbuild() {
> >>> + sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> >>> +}
> >>
> >> That's one of the weak places in Isar (also there are several
> >> others with the same issue). If chroot failed - we will have some
> >> folders mounted. Can we somehow track return value and perform
> >> clean-up if build failed?
> >
> > I found that issue as well. But i decided to ignore it for now,
> > because i did not introduce it.
> >
> > It would be easy to deal with it. i.e.
> >
> > mkdir
> > touch
> > mount
> > do
> > umount
> > rm
> > rmdir
> >
> > would become
> >
> > ret=0
> > mkdir
> > touch
> > mount
> > do || ret=$?
> > umount
> > rm
> > rmdir
> > return ret
>
> Another solution might be to look into events and write some cleanup
> code there [1].
Sounds like a good idea. It is basic error/exception handling. I am
sure bitbake has some mechanism for that, my example above was just
made up without any research in existing mechanism.
Henning
> Cheers,
> Claudius
>
> [1]
> https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#events
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 4/6] meta/dpkg: Move 'do_build' and buildchroot stuff to dpkg-base.bbclass
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (2 preceding siblings ...)
2017-09-12 15:58 ` [PATCH v2 3/6] meta/dpkg: pull out actual build command from 'do_build' Henning Schild
@ 2017-09-12 15:58 ` Henning Schild
2017-09-12 15:58 ` [PATCH v2 5/6] meta/dpkg: add dpkg-raw class Henning Schild
` (4 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-12 15:58 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Henning Schild, Claudius Heine
Issue:
'do_build' contains the steps we need to "enter" and "exit" BUILDCHROOT
to build packages in there. Other classes that build debian packages
might need that as well but can not use it as long as it is in
dkpg.bbclass.
Change:
Pull 'do_build' and all the buildchroot related stuff out of
dpkg.bbclass and into dpkg-base.bbclass. All that remains is the
implementation of the function dpkg_build().
Impact:
This patch does not change the behaviour of Isar. It addresses the issue
and prepares for another patch.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg-base.bbclass | 25 +++++++++++++++++++++++++
meta/classes/dpkg.bbclass | 20 --------------------
2 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 64fd0e8..2402858 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -1,6 +1,31 @@
# This software is a part of ISAR.
# Copyright (C) 2017 Siemens AG
+# Add dependency from buildchroot creation
+DEPENDS += "buildchroot"
+do_build[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}"
+do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+
+# default to "emtpy" implementation
+dpkg_runbuild() {
+ die "This should never be called, overwrite it in your derived class"
+}
+
+# Wrap the function dpkg_runbuild with the bind mount for buildroot
+do_build() {
+ mkdir -p ${BUILDROOT}
+ sudo mount --bind ${WORKDIR} ${BUILDROOT}
+ dpkg_runbuild
+ sudo umount ${BUILDROOT}
+ rm -rf ${BUILDROOT}
+}
+
# Install package to dedicated deploy directory
do_install() {
install -m 644 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 5c3c1f8..c10f5ba 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -3,27 +3,7 @@
inherit dpkg-base
-# Add dependency from buildchroot creation
-DEPENDS += "buildchroot"
-do_build[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}"
-do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-
# Build package from sources using build script
dpkg_runbuild() {
sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
}
-
-# Wrap the function dpkg_runbuild with the bind mount for buildroot
-do_build() {
- mkdir -p ${BUILDROOT}
- sudo mount --bind ${WORKDIR} ${BUILDROOT}
- dpkg_runbuild
- sudo umount ${BUILDROOT}
- rm -rf ${BUILDROOT}
-}
--
2.13.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 5/6] meta/dpkg: add dpkg-raw class
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (3 preceding siblings ...)
2017-09-12 15:58 ` [PATCH v2 4/6] meta/dpkg: Move 'do_build' and buildchroot stuff to dpkg-base.bbclass Henning Schild
@ 2017-09-12 15:58 ` Henning Schild
2017-09-12 15:58 ` [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Henning Schild
` (3 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-12 15:58 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Henning Schild, Claudius Heine
Issues:
1. full customizations of the images is hard to impossible to
realize in a layer without touching Isar
1.1. there is no easy way to just copy a file into the image
1.2. configuration (passwords, groups, cfg-files changes) can not be
done in a layer, there is no way too hook into multistrap or the
configure-script
Change:
Introduce a class that lets users create custom debian packages on the
fly, without having to create a /debian directory and actually building.
That allows you to pull in debian-dependencies, you could have a
package that has no content and is just there to install what you need
for a feature of your product.
Using package hooks (preinst, postinst ..) you can configure pretty much
all you want when installing the package.
The package can contain actual payload as well, basically any files that
come from "somewhere else". Say binary data like wallpapers, sound files
or application binaries.
Impact:
This patch addresses the metioned issue in a way that uses debian
mechanism. All the customizations will enjoy features like
- collission protection (multiple packages providing the same file)
- config file protection
- versioning and the ability to deploy your changes in an updateable way
This patch introduces a major new feature to Isar.
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-raw.bbclass | 55 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 meta/classes/dpkg-raw.bbclass
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
new file mode 100644
index 0000000..f9a7411
--- /dev/null
+++ b/meta/classes/dpkg-raw.bbclass
@@ -0,0 +1,55 @@
+# This software is a part of ISAR.
+# Copyright (C) 2017 Siemens AG
+
+inherit dpkg-base
+
+DEBIAN_DEPENDS ?= ""
+MAINTAINER ?= "FIXME Unknown maintainer"
+
+D = "${WORKDIR}/image/"
+
+# Populate folder that will be picked up as package
+# TODO this should be called 'do_install'
+do_populate_package() {
+ bbnote "Put your files for this package in ${D}"
+}
+
+addtask populate_package after do_unpack before do_deb_package_prepare
+
+# so we can put hooks etc. in there already
+do_populate_package[dirs] = "${D}/DEBIAN"
+
+do_deb_package_prepare() {
+ cat<<-__EOF__ > ${D}/DEBIAN/control
+ Package: ${PN}
+ Architecture: ${DISTRO_ARCH}
+ 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_populate_package 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_build
+
+dpkg_runbuild() {
+ sudo chown -R root:root ${D}/DEBIAN/
+ sudo chroot ${BUILDCHROOT_DIR} dpkg-deb --build ${PP}/image ${PP}
+}
--
2.13.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (4 preceding siblings ...)
2017-09-12 15:58 ` [PATCH v2 5/6] meta/dpkg: add dpkg-raw class Henning Schild
@ 2017-09-12 15:58 ` Henning Schild
2017-09-13 11:39 ` Andreas Reichel
2017-09-13 13:13 ` Alexander Smirnov
2017-09-12 17:07 ` [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (2 subsequent siblings)
8 siblings, 2 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-12 15:58 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Henning Schild, Claudius Heine
Issue:
It might not be clear to a user how to make use of the class
dpkg-raw.
Change:
Add an example that demonstrates some features.
Impact:
This patch does not change the behaviour of Isar. It addresses the issue
partially, documentation would also be useful.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
.../recipes-app/example-raw/example-raw_0.1.bb | 35 ++++++++++++++++++++++
meta-isar/recipes-app/example-raw/files/README | 1 +
meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
3 files changed, 52 insertions(+)
create mode 100644 meta-isar/recipes-app/example-raw/example-raw_0.1.bb
create mode 100644 meta-isar/recipes-app/example-raw/files/README
create mode 100644 meta-isar/recipes-app/example-raw/files/postinst
diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
new file mode 100644
index 0000000..d548465
--- /dev/null
+++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
@@ -0,0 +1,35 @@
+# Sample application using dpkg-raw, which turns a folder (${D}) of
+# files into a .deb
+#
+# This software is a part of ISAR.
+
+DESCRIPTION = "Sample application for ISAR"
+MAINTAINER = "Your name here <you@domain.com>"
+DEBIAN_DEPENDS = "apt"
+
+SRC_URI = "file://README \
+ file://postinst"
+
+inherit dpkg-raw
+
+do_populate_package() {
+ bbnote "Creating ${PN} binary"
+ echo "#!/bin/sh" > ${WORKDIR}/${PN}
+ echo "echo Hello ISAR! ${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 fake 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
+}
diff --git a/meta-isar/recipes-app/example-raw/files/README b/meta-isar/recipes-app/example-raw/files/README
new file mode 100644
index 0000000..6e2ce0f
--- /dev/null
+++ b/meta-isar/recipes-app/example-raw/files/README
@@ -0,0 +1 @@
+This is an example file that we get from FILESDIR in recipe.
diff --git a/meta-isar/recipes-app/example-raw/files/postinst b/meta-isar/recipes-app/example-raw/files/postinst
new file mode 100644
index 0000000..a28afa3
--- /dev/null
+++ b/meta-isar/recipes-app/example-raw/files/postinst
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+if ! getent group isar >/dev/null; then
+ addgroup --quiet --system isar
+fi
+
+if ! getent passwd isar >/dev/null; then
+ useradd --system --gid isar --create-home \
+ --home /var/lib/isar --no-user-group \
+ --comment "My isar user" \
+ isar
+fi
+
+chown -R isar:isar /var/lib/isar
--
2.13.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-12 15:58 ` [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Henning Schild
@ 2017-09-13 11:39 ` Andreas Reichel
2017-09-14 7:28 ` Alexander Smirnov
2017-09-13 13:13 ` Alexander Smirnov
1 sibling, 1 reply; 25+ messages in thread
From: Andreas Reichel @ 2017-09-13 11:39 UTC (permalink / raw)
To: [ext] Henning Schild; +Cc: isar-users, Alexander Smirnov, Claudius Heine
On Tue, Sep 12, 2017 at 05:58:10PM +0200, [ext] Henning Schild wrote:
> Issue:
> It might not be clear to a user how to make use of the class
> dpkg-raw.
>
> Change:
> Add an example that demonstrates some features.
>
> Impact:
> This patch does not change the behaviour of Isar. It addresses the issue
> partially, documentation would also be useful.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> .../recipes-app/example-raw/example-raw_0.1.bb | 35 ++++++++++++++++++++++
> meta-isar/recipes-app/example-raw/files/README | 1 +
> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
> 3 files changed, 52 insertions(+)
> create mode 100644 meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> create mode 100644 meta-isar/recipes-app/example-raw/files/README
> create mode 100644 meta-isar/recipes-app/example-raw/files/postinst
>
> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> new file mode 100644
> index 0000000..d548465
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> @@ -0,0 +1,35 @@
> +# Sample application using dpkg-raw, which turns a folder (${D}) of
> +# files into a .deb
> +#
> +# This software is a part of ISAR.
> +
> +DESCRIPTION = "Sample application for ISAR"
> +MAINTAINER = "Your name here <you@domain.com>"
> +DEBIAN_DEPENDS = "apt"
> +
> +SRC_URI = "file://README \
> + file://postinst"
> +
> +inherit dpkg-raw
> +
> +do_populate_package() {
> + bbnote "Creating ${PN} binary"
> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> + echo "echo Hello ISAR! ${PN}_${PV}" >> ${WORKDIR}/${PN}
Maybe "Creating executable content"? Nowhere a binary is created...
> +
> + bbnote "Putting ${PN} into package"
> + install -v -d ${D}/usr/local/bin/
> + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
> +
Maybe "Packaging ${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 fake config file"
Maybe "Generating config file"
Kind regards
Andreas
> + 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
> +}
> diff --git a/meta-isar/recipes-app/example-raw/files/README b/meta-isar/recipes-app/example-raw/files/README
> new file mode 100644
> index 0000000..6e2ce0f
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/files/README
> @@ -0,0 +1 @@
> +This is an example file that we get from FILESDIR in recipe.
> diff --git a/meta-isar/recipes-app/example-raw/files/postinst b/meta-isar/recipes-app/example-raw/files/postinst
> new file mode 100644
> index 0000000..a28afa3
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/files/postinst
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +
> +set -e
> +
> +if ! getent group isar >/dev/null; then
> + addgroup --quiet --system isar
> +fi
> +
> +if ! getent passwd isar >/dev/null; then
> + useradd --system --gid isar --create-home \
> + --home /var/lib/isar --no-user-group \
> + --comment "My isar user" \
> + isar
> +fi
> +
> +chown -R isar:isar /var/lib/isar
> --
> 2.13.5
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To post to this group, send email to isar-users@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20170912155810.9434-7-henning.schild%40siemens.com.
> For more options, visit https://groups.google.com/d/optout.
--
Andreas Reichel
Dipl.-Phys. (Univ.)
Software Consultant
Andreas.Reichel@tngtech.com, +49-174-3180074
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterfoehring
Geschaeftsfuehrer: Henrik Klagges, Dr. Robert Dahlke, Gerhard Mueller
Sitz: Unterfoehring * Amtsgericht Muenchen * HRB 135082
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-13 11:39 ` Andreas Reichel
@ 2017-09-14 7:28 ` Alexander Smirnov
2017-09-14 8:11 ` Henning Schild
0 siblings, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-14 7:28 UTC (permalink / raw)
To: Andreas Reichel, [ext] Henning Schild; +Cc: isar-users, Claudius Heine
On 09/13/2017 02:39 PM, Andreas Reichel wrote:
> On Tue, Sep 12, 2017 at 05:58:10PM +0200, [ext] Henning Schild wrote:
>> Issue:
>> It might not be clear to a user how to make use of the class
>> dpkg-raw.
>>
>> Change:
>> Add an example that demonstrates some features.
>>
>> Impact:
>> This patch does not change the behaviour of Isar. It addresses the issue
>> partially, documentation would also be useful.
>>
>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
>> ---
>> .../recipes-app/example-raw/example-raw_0.1.bb | 35 ++++++++++++++++++++++
>> meta-isar/recipes-app/example-raw/files/README | 1 +
>> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
>> 3 files changed, 52 insertions(+)
>> create mode 100644 meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>> create mode 100644 meta-isar/recipes-app/example-raw/files/README
>> create mode 100644 meta-isar/recipes-app/example-raw/files/postinst
>>
>> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>> new file mode 100644
>> index 0000000..d548465
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>> @@ -0,0 +1,35 @@
>> +# Sample application using dpkg-raw, which turns a folder (${D}) of
>> +# files into a .deb
>> +#
>> +# This software is a part of ISAR.
>> +
>> +DESCRIPTION = "Sample application for ISAR"
>> +MAINTAINER = "Your name here <you@domain.com>"
>> +DEBIAN_DEPENDS = "apt"
>> +
>> +SRC_URI = "file://README \
>> + file://postinst"
>> +
>> +inherit dpkg-raw
>> +
>> +do_populate_package() {
>> + bbnote "Creating ${PN} binary"
>> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
>> + echo "echo Hello ISAR! ${PN}_${PV}" >> ${WORKDIR}/${PN}
>
> Maybe "Creating executable content"? Nowhere a binary is created...
>
Any other comments?
>> +
>> + bbnote "Putting ${PN} into package"
>> + install -v -d ${D}/usr/local/bin/
>> + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
>> +
> Maybe "Packaging ${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 fake config file"
>
> Maybe "Generating config file"
And here...
Alex
>
> Kind regards
> Andreas
>> + 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
>> +}
>> diff --git a/meta-isar/recipes-app/example-raw/files/README b/meta-isar/recipes-app/example-raw/files/README
>> new file mode 100644
>> index 0000000..6e2ce0f
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/example-raw/files/README
>> @@ -0,0 +1 @@
>> +This is an example file that we get from FILESDIR in recipe.
>> diff --git a/meta-isar/recipes-app/example-raw/files/postinst b/meta-isar/recipes-app/example-raw/files/postinst
>> new file mode 100644
>> index 0000000..a28afa3
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/example-raw/files/postinst
>> @@ -0,0 +1,16 @@
>> +#!/bin/sh
>> +
>> +set -e
>> +
>> +if ! getent group isar >/dev/null; then
>> + addgroup --quiet --system isar
>> +fi
>> +
>> +if ! getent passwd isar >/dev/null; then
>> + useradd --system --gid isar --create-home \
>> + --home /var/lib/isar --no-user-group \
>> + --comment "My isar user" \
>> + isar
>> +fi
>> +
>> +chown -R isar:isar /var/lib/isar
>> --
>> 2.13.5
>>
>> --
>> You received this message because you are subscribed to the Google Groups "isar-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
>> To post to this group, send email to isar-users@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20170912155810.9434-7-henning.schild%40siemens.com.
>> For more options, visit https://groups.google.com/d/optout.
>
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-14 7:28 ` Alexander Smirnov
@ 2017-09-14 8:11 ` Henning Schild
0 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-14 8:11 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: Andreas Reichel, isar-users, Claudius Heine
Am Thu, 14 Sep 2017 10:28:36 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> On 09/13/2017 02:39 PM, Andreas Reichel wrote:
> > On Tue, Sep 12, 2017 at 05:58:10PM +0200, [ext] Henning Schild
> > wrote:
> >> Issue:
> >> It might not be clear to a user how to make use of the class
> >> dpkg-raw.
> >>
> >> Change:
> >> Add an example that demonstrates some features.
> >>
> >> Impact:
> >> This patch does not change the behaviour of Isar. It addresses the
> >> issue partially, documentation would also be useful.
> >>
> >> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> >> ---
> >> .../recipes-app/example-raw/example-raw_0.1.bb | 35
> >> ++++++++++++++++++++++
> >> meta-isar/recipes-app/example-raw/files/README | 1 +
> >> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
> >> 3 files changed, 52 insertions(+) create mode 100644
> >> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
> >> 100644 meta-isar/recipes-app/example-raw/files/README create mode
> >> 100644 meta-isar/recipes-app/example-raw/files/postinst
> >>
> >> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> >> b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file
> >> mode 100644 index 0000000..d548465
> >> --- /dev/null
> >> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> >> @@ -0,0 +1,35 @@
> >> +# Sample application using dpkg-raw, which turns a folder (${D})
> >> of +# files into a .deb
> >> +#
> >> +# This software is a part of ISAR.
> >> +
> >> +DESCRIPTION = "Sample application for ISAR"
> >> +MAINTAINER = "Your name here <you@domain.com>"
> >> +DEBIAN_DEPENDS = "apt"
> >> +
> >> +SRC_URI = "file://README \
> >> + file://postinst"
> >> +
> >> +inherit dpkg-raw
> >> +
> >> +do_populate_package() {
> >> + bbnote "Creating ${PN} binary"
> >> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> >> + echo "echo Hello ISAR! ${PN}_${PV}" >> ${WORKDIR}/${PN}
> >
> > Maybe "Creating executable content"? Nowhere a binary is created...
> >
>
> Any other comments?
>
> >> +
> >> + bbnote "Putting ${PN} into package"
> >> + install -v -d ${D}/usr/local/bin/
> >> + install -v -m 755 ${WORKDIR}/${PN}
> >> ${D}/usr/local/bin/${PN}
> >> +
> > Maybe "Packaging ${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 fake config file"
> >
> > Maybe "Generating config file"
>
> And here...
These comments are mostly a matter of taste. I did not react because i
did not want such tiny changes to hold up the series. I would be ok
with the strings as they are. Alex please tell me what you think and
Andreas please tell me if you are stricly against the current strings.
Henning
> Alex
>
> >
> > Kind regards
> > Andreas
> >> + 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 +}
> >> diff --git a/meta-isar/recipes-app/example-raw/files/README
> >> b/meta-isar/recipes-app/example-raw/files/README new file mode
> >> 100644 index 0000000..6e2ce0f
> >> --- /dev/null
> >> +++ b/meta-isar/recipes-app/example-raw/files/README
> >> @@ -0,0 +1 @@
> >> +This is an example file that we get from FILESDIR in recipe.
> >> diff --git a/meta-isar/recipes-app/example-raw/files/postinst
> >> b/meta-isar/recipes-app/example-raw/files/postinst new file mode
> >> 100644 index 0000000..a28afa3
> >> --- /dev/null
> >> +++ b/meta-isar/recipes-app/example-raw/files/postinst
> >> @@ -0,0 +1,16 @@
> >> +#!/bin/sh
> >> +
> >> +set -e
> >> +
> >> +if ! getent group isar >/dev/null; then
> >> + addgroup --quiet --system isar
> >> +fi
> >> +
> >> +if ! getent passwd isar >/dev/null; then
> >> + useradd --system --gid isar --create-home \
> >> + --home /var/lib/isar --no-user-group \
> >> + --comment "My isar user" \
> >> + isar
> >> +fi
> >> +
> >> +chown -R isar:isar /var/lib/isar
> >> --
> >> 2.13.5
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "isar-users" group. To unsubscribe from this group and stop
> >> receiving emails from it, send an email to
> >> isar-users+unsubscribe@googlegroups.com. To post to this group,
> >> send email to isar-users@googlegroups.com. To view this discussion
> >> on the web visit
> >> https://groups.google.com/d/msgid/isar-users/20170912155810.9434-7-henning.schild%40siemens.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-12 15:58 ` [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Henning Schild
2017-09-13 11:39 ` Andreas Reichel
@ 2017-09-13 13:13 ` Alexander Smirnov
2017-09-13 14:15 ` Henning Schild
1 sibling, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-13 13:13 UTC (permalink / raw)
To: Henning Schild, isar-users; +Cc: Claudius Heine
On 09/12/2017 06:58 PM, Henning Schild wrote:
> Issue:
> It might not be clear to a user how to make use of the class
> dpkg-raw.
>
> Change:
> Add an example that demonstrates some features.
>
> Impact:
> This patch does not change the behaviour of Isar. It addresses the issue
> partially, documentation would also be useful.
>
I'd like to ask for another extra patch which adds example-raw to
default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for easy
testing. Now for testing I have to add it manually.
Again this could be done later in next series.
Alex
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> .../recipes-app/example-raw/example-raw_0.1.bb | 35 ++++++++++++++++++++++
> meta-isar/recipes-app/example-raw/files/README | 1 +
> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
> 3 files changed, 52 insertions(+)
> create mode 100644 meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> create mode 100644 meta-isar/recipes-app/example-raw/files/README
> create mode 100644 meta-isar/recipes-app/example-raw/files/postinst
>
> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> new file mode 100644
> index 0000000..d548465
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> @@ -0,0 +1,35 @@
> +# Sample application using dpkg-raw, which turns a folder (${D}) of
> +# files into a .deb
> +#
> +# This software is a part of ISAR.
> +
> +DESCRIPTION = "Sample application for ISAR"
> +MAINTAINER = "Your name here <you@domain.com>"
> +DEBIAN_DEPENDS = "apt"
> +
> +SRC_URI = "file://README \
> + file://postinst"
> +
> +inherit dpkg-raw
> +
> +do_populate_package() {
> + bbnote "Creating ${PN} binary"
> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> + echo "echo Hello ISAR! ${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 fake 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
> +}
> diff --git a/meta-isar/recipes-app/example-raw/files/README b/meta-isar/recipes-app/example-raw/files/README
> new file mode 100644
> index 0000000..6e2ce0f
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/files/README
> @@ -0,0 +1 @@
> +This is an example file that we get from FILESDIR in recipe.
> diff --git a/meta-isar/recipes-app/example-raw/files/postinst b/meta-isar/recipes-app/example-raw/files/postinst
> new file mode 100644
> index 0000000..a28afa3
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/files/postinst
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +
> +set -e
> +
> +if ! getent group isar >/dev/null; then
> + addgroup --quiet --system isar
> +fi
> +
> +if ! getent passwd isar >/dev/null; then
> + useradd --system --gid isar --create-home \
> + --home /var/lib/isar --no-user-group \
> + --comment "My isar user" \
> + isar
> +fi
> +
> +chown -R isar:isar /var/lib/isar
>
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-13 13:13 ` Alexander Smirnov
@ 2017-09-13 14:15 ` Henning Schild
2017-09-13 15:06 ` Alexander Smirnov
0 siblings, 1 reply; 25+ messages in thread
From: Henning Schild @ 2017-09-13 14:15 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users, Claudius Heine
Am Wed, 13 Sep 2017 16:13:42 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> On 09/12/2017 06:58 PM, Henning Schild wrote:
> > Issue:
> > It might not be clear to a user how to make use of the class
> > dpkg-raw.
> >
> > Change:
> > Add an example that demonstrates some features.
> >
> > Impact:
> > This patch does not change the behaviour of Isar. It addresses the
> > issue partially, documentation would also be useful.
> >
>
> I'd like to ask for another extra patch which adds example-raw to
> default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for easy
> testing. Now for testing I have to add it manually.
See, i do that in my layer ;). But if you think the example should be
part of the default image i can prepare such a patch.
> Again this could be done later in next series.
Ok, waiting for feedback.
Henning
> Alex
>
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> > .../recipes-app/example-raw/example-raw_0.1.bb | 35
> > ++++++++++++++++++++++
> > meta-isar/recipes-app/example-raw/files/README | 1 +
> > meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
> > 3 files changed, 52 insertions(+) create mode 100644
> > meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
> > 100644 meta-isar/recipes-app/example-raw/files/README create mode
> > 100644 meta-isar/recipes-app/example-raw/files/postinst
> >
> > diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> > b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file
> > mode 100644 index 0000000..d548465
> > --- /dev/null
> > +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> > @@ -0,0 +1,35 @@
> > +# Sample application using dpkg-raw, which turns a folder (${D}) of
> > +# files into a .deb
> > +#
> > +# This software is a part of ISAR.
> > +
> > +DESCRIPTION = "Sample application for ISAR"
> > +MAINTAINER = "Your name here <you@domain.com>"
> > +DEBIAN_DEPENDS = "apt"
> > +
> > +SRC_URI = "file://README \
> > + file://postinst"
> > +
> > +inherit dpkg-raw
> > +
> > +do_populate_package() {
> > + bbnote "Creating ${PN} binary"
> > + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> > + echo "echo Hello ISAR! ${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 fake 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 +}
> > diff --git a/meta-isar/recipes-app/example-raw/files/README
> > b/meta-isar/recipes-app/example-raw/files/README new file mode
> > 100644 index 0000000..6e2ce0f
> > --- /dev/null
> > +++ b/meta-isar/recipes-app/example-raw/files/README
> > @@ -0,0 +1 @@
> > +This is an example file that we get from FILESDIR in recipe.
> > diff --git a/meta-isar/recipes-app/example-raw/files/postinst
> > b/meta-isar/recipes-app/example-raw/files/postinst new file mode
> > 100644 index 0000000..a28afa3
> > --- /dev/null
> > +++ b/meta-isar/recipes-app/example-raw/files/postinst
> > @@ -0,0 +1,16 @@
> > +#!/bin/sh
> > +
> > +set -e
> > +
> > +if ! getent group isar >/dev/null; then
> > + addgroup --quiet --system isar
> > +fi
> > +
> > +if ! getent passwd isar >/dev/null; then
> > + useradd --system --gid isar --create-home \
> > + --home /var/lib/isar --no-user-group \
> > + --comment "My isar user" \
> > + isar
> > +fi
> > +
> > +chown -R isar:isar /var/lib/isar
> >
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-13 14:15 ` Henning Schild
@ 2017-09-13 15:06 ` Alexander Smirnov
2017-09-13 15:28 ` Henning Schild
0 siblings, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-13 15:06 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users, Claudius Heine
On 09/13/2017 05:15 PM, Henning Schild wrote:
> Am Wed, 13 Sep 2017 16:13:42 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>
>> On 09/12/2017 06:58 PM, Henning Schild wrote:
>>> Issue:
>>> It might not be clear to a user how to make use of the class
>>> dpkg-raw.
>>>
>>> Change:
>>> Add an example that demonstrates some features.
>>>
>>> Impact:
>>> This patch does not change the behaviour of Isar. It addresses the
>>> issue partially, documentation would also be useful.
>>>
>>
>> I'd like to ask for another extra patch which adds example-raw to
>> default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for easy
>> testing. Now for testing I have to add it manually.
>
> See, i do that in my layer ;). But if you think the example should be
> part of the default image i can prepare such a patch.
There is the default build instructions in ./README.md ->
doc/user_manual.md, so it would be nice if all the Isar features and
examples will be included to this build.
>
>> Again this could be done later in next series.
>
> Ok, waiting for feedback.
As I said, let's keep this series as it is.
Alex
>
> Henning
>
>> Alex
>>
>>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
>>> ---
>>> .../recipes-app/example-raw/example-raw_0.1.bb | 35
>>> ++++++++++++++++++++++
>>> meta-isar/recipes-app/example-raw/files/README | 1 +
>>> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
>>> 3 files changed, 52 insertions(+) create mode 100644
>>> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
>>> 100644 meta-isar/recipes-app/example-raw/files/README create mode
>>> 100644 meta-isar/recipes-app/example-raw/files/postinst
>>>
>>> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>>> b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file
>>> mode 100644 index 0000000..d548465
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>>> @@ -0,0 +1,35 @@
>>> +# Sample application using dpkg-raw, which turns a folder (${D}) of
>>> +# files into a .deb
>>> +#
>>> +# This software is a part of ISAR.
>>> +
>>> +DESCRIPTION = "Sample application for ISAR"
>>> +MAINTAINER = "Your name here <you@domain.com>"
>>> +DEBIAN_DEPENDS = "apt"
>>> +
>>> +SRC_URI = "file://README \
>>> + file://postinst"
>>> +
>>> +inherit dpkg-raw
>>> +
>>> +do_populate_package() {
>>> + bbnote "Creating ${PN} binary"
>>> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
>>> + echo "echo Hello ISAR! ${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 fake 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 +}
>>> diff --git a/meta-isar/recipes-app/example-raw/files/README
>>> b/meta-isar/recipes-app/example-raw/files/README new file mode
>>> 100644 index 0000000..6e2ce0f
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/example-raw/files/README
>>> @@ -0,0 +1 @@
>>> +This is an example file that we get from FILESDIR in recipe.
>>> diff --git a/meta-isar/recipes-app/example-raw/files/postinst
>>> b/meta-isar/recipes-app/example-raw/files/postinst new file mode
>>> 100644 index 0000000..a28afa3
>>> --- /dev/null
>>> +++ b/meta-isar/recipes-app/example-raw/files/postinst
>>> @@ -0,0 +1,16 @@
>>> +#!/bin/sh
>>> +
>>> +set -e
>>> +
>>> +if ! getent group isar >/dev/null; then
>>> + addgroup --quiet --system isar
>>> +fi
>>> +
>>> +if ! getent passwd isar >/dev/null; then
>>> + useradd --system --gid isar --create-home \
>>> + --home /var/lib/isar --no-user-group \
>>> + --comment "My isar user" \
>>> + isar
>>> +fi
>>> +
>>> +chown -R isar:isar /var/lib/isar
>>>
>>
>
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-13 15:06 ` Alexander Smirnov
@ 2017-09-13 15:28 ` Henning Schild
2017-09-13 15:38 ` Alexander Smirnov
0 siblings, 1 reply; 25+ messages in thread
From: Henning Schild @ 2017-09-13 15:28 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users, Claudius Heine
Am Wed, 13 Sep 2017 18:06:16 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> On 09/13/2017 05:15 PM, Henning Schild wrote:
> > Am Wed, 13 Sep 2017 16:13:42 +0300
> > schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> >
> >> On 09/12/2017 06:58 PM, Henning Schild wrote:
> >>> Issue:
> >>> It might not be clear to a user how to make use of the class
> >>> dpkg-raw.
> >>>
> >>> Change:
> >>> Add an example that demonstrates some features.
> >>>
> >>> Impact:
> >>> This patch does not change the behaviour of Isar. It addresses the
> >>> issue partially, documentation would also be useful.
> >>>
> >>
> >> I'd like to ask for another extra patch which adds example-raw to
> >> default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for
> >> easy testing. Now for testing I have to add it manually.
> >
> > See, i do that in my layer ;). But if you think the example should
> > be part of the default image i can prepare such a patch.
>
> There is the default build instructions in ./README.md ->
> doc/user_manual.md, so it would be nice if all the Isar features and
> examples will be included to this build.
>
> >
> >> Again this could be done later in next series.
> >
> > Ok, waiting for feedback.
>
> As I said, let's keep this series as it is.
Ok, i guess "next series" means whatever comes after this one. Not next
iteration of this one. I am reading this almost as a "will merge to
next", am i correct?
Henning
> Alex
>
> >
> > Henning
> >
> >> Alex
> >>
> >>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> >>> ---
> >>> .../recipes-app/example-raw/example-raw_0.1.bb | 35
> >>> ++++++++++++++++++++++
> >>> meta-isar/recipes-app/example-raw/files/README | 1 +
> >>> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
> >>> 3 files changed, 52 insertions(+) create mode 100644
> >>> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
> >>> 100644 meta-isar/recipes-app/example-raw/files/README create mode
> >>> 100644 meta-isar/recipes-app/example-raw/files/postinst
> >>>
> >>> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> >>> b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file
> >>> mode 100644 index 0000000..d548465
> >>> --- /dev/null
> >>> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> >>> @@ -0,0 +1,35 @@
> >>> +# Sample application using dpkg-raw, which turns a folder (${D})
> >>> of +# files into a .deb
> >>> +#
> >>> +# This software is a part of ISAR.
> >>> +
> >>> +DESCRIPTION = "Sample application for ISAR"
> >>> +MAINTAINER = "Your name here <you@domain.com>"
> >>> +DEBIAN_DEPENDS = "apt"
> >>> +
> >>> +SRC_URI = "file://README \
> >>> + file://postinst"
> >>> +
> >>> +inherit dpkg-raw
> >>> +
> >>> +do_populate_package() {
> >>> + bbnote "Creating ${PN} binary"
> >>> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> >>> + echo "echo Hello ISAR! ${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 fake 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 +}
> >>> diff --git a/meta-isar/recipes-app/example-raw/files/README
> >>> b/meta-isar/recipes-app/example-raw/files/README new file mode
> >>> 100644 index 0000000..6e2ce0f
> >>> --- /dev/null
> >>> +++ b/meta-isar/recipes-app/example-raw/files/README
> >>> @@ -0,0 +1 @@
> >>> +This is an example file that we get from FILESDIR in recipe.
> >>> diff --git a/meta-isar/recipes-app/example-raw/files/postinst
> >>> b/meta-isar/recipes-app/example-raw/files/postinst new file mode
> >>> 100644 index 0000000..a28afa3
> >>> --- /dev/null
> >>> +++ b/meta-isar/recipes-app/example-raw/files/postinst
> >>> @@ -0,0 +1,16 @@
> >>> +#!/bin/sh
> >>> +
> >>> +set -e
> >>> +
> >>> +if ! getent group isar >/dev/null; then
> >>> + addgroup --quiet --system isar
> >>> +fi
> >>> +
> >>> +if ! getent passwd isar >/dev/null; then
> >>> + useradd --system --gid isar --create-home \
> >>> + --home /var/lib/isar --no-user-group \
> >>> + --comment "My isar user" \
> >>> + isar
> >>> +fi
> >>> +
> >>> +chown -R isar:isar /var/lib/isar
> >>>
> >>
> >
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-13 15:28 ` Henning Schild
@ 2017-09-13 15:38 ` Alexander Smirnov
2017-09-14 8:33 ` Henning Schild
0 siblings, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-13 15:38 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users, Claudius Heine
On 09/13/2017 06:28 PM, Henning Schild wrote:
> Am Wed, 13 Sep 2017 18:06:16 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>
>> On 09/13/2017 05:15 PM, Henning Schild wrote:
>>> Am Wed, 13 Sep 2017 16:13:42 +0300
>>> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
>>>
>>>> On 09/12/2017 06:58 PM, Henning Schild wrote:
>>>>> Issue:
>>>>> It might not be clear to a user how to make use of the class
>>>>> dpkg-raw.
>>>>>
>>>>> Change:
>>>>> Add an example that demonstrates some features.
>>>>>
>>>>> Impact:
>>>>> This patch does not change the behaviour of Isar. It addresses the
>>>>> issue partially, documentation would also be useful.
>>>>>
>>>>
>>>> I'd like to ask for another extra patch which adds example-raw to
>>>> default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for
>>>> easy testing. Now for testing I have to add it manually.
>>>
>>> See, i do that in my layer ;). But if you think the example should
>>> be part of the default image i can prepare such a patch.
>>
>> There is the default build instructions in ./README.md ->
>> doc/user_manual.md, so it would be nice if all the Isar features and
>> examples will be included to this build.
>>
>>>
>>>> Again this could be done later in next series.
>>>
>>> Ok, waiting for feedback.
>>
>> As I said, let's keep this series as it is.
>
> Ok, i guess "next series" means whatever comes after this one. Not next
> iteration of this one. I am reading this almost as a "will merge to
> next", am i correct?
Yes :-). If no other comments appear soon, will merge it to next. Also
please add chapter to technical overview.
Alex.
>
> Henning
>
>> Alex
>>
>>>
>>> Henning
>>>
>>>> Alex
>>>>
>>>>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
>>>>> ---
>>>>> .../recipes-app/example-raw/example-raw_0.1.bb | 35
>>>>> ++++++++++++++++++++++
>>>>> meta-isar/recipes-app/example-raw/files/README | 1 +
>>>>> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++++++
>>>>> 3 files changed, 52 insertions(+) create mode 100644
>>>>> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
>>>>> 100644 meta-isar/recipes-app/example-raw/files/README create mode
>>>>> 100644 meta-isar/recipes-app/example-raw/files/postinst
>>>>>
>>>>> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>>>>> b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file
>>>>> mode 100644 index 0000000..d548465
>>>>> --- /dev/null
>>>>> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
>>>>> @@ -0,0 +1,35 @@
>>>>> +# Sample application using dpkg-raw, which turns a folder (${D})
>>>>> of +# files into a .deb
>>>>> +#
>>>>> +# This software is a part of ISAR.
>>>>> +
>>>>> +DESCRIPTION = "Sample application for ISAR"
>>>>> +MAINTAINER = "Your name here <you@domain.com>"
>>>>> +DEBIAN_DEPENDS = "apt"
>>>>> +
>>>>> +SRC_URI = "file://README \
>>>>> + file://postinst"
>>>>> +
>>>>> +inherit dpkg-raw
>>>>> +
>>>>> +do_populate_package() {
>>>>> + bbnote "Creating ${PN} binary"
>>>>> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
>>>>> + echo "echo Hello ISAR! ${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 fake 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 +}
>>>>> diff --git a/meta-isar/recipes-app/example-raw/files/README
>>>>> b/meta-isar/recipes-app/example-raw/files/README new file mode
>>>>> 100644 index 0000000..6e2ce0f
>>>>> --- /dev/null
>>>>> +++ b/meta-isar/recipes-app/example-raw/files/README
>>>>> @@ -0,0 +1 @@
>>>>> +This is an example file that we get from FILESDIR in recipe.
>>>>> diff --git a/meta-isar/recipes-app/example-raw/files/postinst
>>>>> b/meta-isar/recipes-app/example-raw/files/postinst new file mode
>>>>> 100644 index 0000000..a28afa3
>>>>> --- /dev/null
>>>>> +++ b/meta-isar/recipes-app/example-raw/files/postinst
>>>>> @@ -0,0 +1,16 @@
>>>>> +#!/bin/sh
>>>>> +
>>>>> +set -e
>>>>> +
>>>>> +if ! getent group isar >/dev/null; then
>>>>> + addgroup --quiet --system isar
>>>>> +fi
>>>>> +
>>>>> +if ! getent passwd isar >/dev/null; then
>>>>> + useradd --system --gid isar --create-home \
>>>>> + --home /var/lib/isar --no-user-group \
>>>>> + --comment "My isar user" \
>>>>> + isar
>>>>> +fi
>>>>> +
>>>>> +chown -R isar:isar /var/lib/isar
>>>>>
>>>>
>>>
>>
>
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw
2017-09-13 15:38 ` Alexander Smirnov
@ 2017-09-14 8:33 ` Henning Schild
0 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-14 8:33 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users, Claudius Heine
Am Wed, 13 Sep 2017 18:38:10 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> On 09/13/2017 06:28 PM, Henning Schild wrote:
> > Am Wed, 13 Sep 2017 18:06:16 +0300
> > schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> >
> >> On 09/13/2017 05:15 PM, Henning Schild wrote:
> >>> Am Wed, 13 Sep 2017 16:13:42 +0300
> >>> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> >>>
> >>>> On 09/12/2017 06:58 PM, Henning Schild wrote:
> >>>>> Issue:
> >>>>> It might not be clear to a user how to make use of the class
> >>>>> dpkg-raw.
> >>>>>
> >>>>> Change:
> >>>>> Add an example that demonstrates some features.
> >>>>>
> >>>>> Impact:
> >>>>> This patch does not change the behaviour of Isar. It addresses
> >>>>> the issue partially, documentation would also be useful.
> >>>>>
> >>>>
> >>>> I'd like to ask for another extra patch which adds example-raw to
> >>>> default IMAGE_INSTALL in "meta-isar/conf/local.conf.sample" for
> >>>> easy testing. Now for testing I have to add it manually.
> >>>
> >>> See, i do that in my layer ;). But if you think the example should
> >>> be part of the default image i can prepare such a patch.
> >>
> >> There is the default build instructions in ./README.md ->
> >> doc/user_manual.md, so it would be nice if all the Isar features
> >> and examples will be included to this build.
> >>
> >>>
> >>>> Again this could be done later in next series.
> >>>
> >>> Ok, waiting for feedback.
> >>
> >> As I said, let's keep this series as it is.
> >
> > Ok, i guess "next series" means whatever comes after this one. Not
> > next iteration of this one. I am reading this almost as a "will
> > merge to next", am i correct?
>
> Yes :-). If no other comments appear soon, will merge it to next.
> Also please add chapter to technical overview.
Nice, Thanks! I will wait for "next" to appear and propose a
documentation patch on top of it. Or should i look at "asmirnov/next"?
Henning
> Alex.
>
> >
> > Henning
> >
> >> Alex
> >>
> >>>
> >>> Henning
> >>>
> >>>> Alex
> >>>>
> >>>>> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> >>>>> ---
> >>>>> .../recipes-app/example-raw/example-raw_0.1.bb | 35
> >>>>> ++++++++++++++++++++++
> >>>>> meta-isar/recipes-app/example-raw/files/README | 1 +
> >>>>> meta-isar/recipes-app/example-raw/files/postinst | 16
> >>>>> ++++++++++ 3 files changed, 52 insertions(+) create mode 100644
> >>>>> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
> >>>>> 100644 meta-isar/recipes-app/example-raw/files/README create
> >>>>> mode 100644 meta-isar/recipes-app/example-raw/files/postinst
> >>>>>
> >>>>> diff --git
> >>>>> a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> >>>>> b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb new file
> >>>>> mode 100644 index 0000000..d548465 --- /dev/null
> >>>>> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> >>>>> @@ -0,0 +1,35 @@
> >>>>> +# Sample application using dpkg-raw, which turns a folder
> >>>>> (${D}) of +# files into a .deb
> >>>>> +#
> >>>>> +# This software is a part of ISAR.
> >>>>> +
> >>>>> +DESCRIPTION = "Sample application for ISAR"
> >>>>> +MAINTAINER = "Your name here <you@domain.com>"
> >>>>> +DEBIAN_DEPENDS = "apt"
> >>>>> +
> >>>>> +SRC_URI = "file://README \
> >>>>> + file://postinst"
> >>>>> +
> >>>>> +inherit dpkg-raw
> >>>>> +
> >>>>> +do_populate_package() {
> >>>>> + bbnote "Creating ${PN} binary"
> >>>>> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> >>>>> + echo "echo Hello ISAR! ${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 fake 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 +}
> >>>>> diff --git a/meta-isar/recipes-app/example-raw/files/README
> >>>>> b/meta-isar/recipes-app/example-raw/files/README new file mode
> >>>>> 100644 index 0000000..6e2ce0f
> >>>>> --- /dev/null
> >>>>> +++ b/meta-isar/recipes-app/example-raw/files/README
> >>>>> @@ -0,0 +1 @@
> >>>>> +This is an example file that we get from FILESDIR in recipe.
> >>>>> diff --git a/meta-isar/recipes-app/example-raw/files/postinst
> >>>>> b/meta-isar/recipes-app/example-raw/files/postinst new file mode
> >>>>> 100644 index 0000000..a28afa3
> >>>>> --- /dev/null
> >>>>> +++ b/meta-isar/recipes-app/example-raw/files/postinst
> >>>>> @@ -0,0 +1,16 @@
> >>>>> +#!/bin/sh
> >>>>> +
> >>>>> +set -e
> >>>>> +
> >>>>> +if ! getent group isar >/dev/null; then
> >>>>> + addgroup --quiet --system isar
> >>>>> +fi
> >>>>> +
> >>>>> +if ! getent passwd isar >/dev/null; then
> >>>>> + useradd --system --gid isar --create-home \
> >>>>> + --home /var/lib/isar --no-user-group \
> >>>>> + --comment "My isar user" \
> >>>>> + isar
> >>>>> +fi
> >>>>> +
> >>>>> +chown -R isar:isar /var/lib/isar
> >>>>>
> >>>>
> >>>
> >>
> >
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 0/6] v4 of the custom debian package
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (5 preceding siblings ...)
2017-09-12 15:58 ` [PATCH v2 6/6] recipes-app/example-raw: add an example on how to use dpkg-raw Henning Schild
@ 2017-09-12 17:07 ` Henning Schild
2017-09-13 15:00 ` [PATCH][FYI] dpkg-raw: Allow multiconfig build Alexander Smirnov
2017-09-14 17:18 ` [PATCH v2 0/6] v4 of the custom debian package Alexander Smirnov
8 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-12 17:07 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov, Claudius Heine
Can also be found here:
https://github.com/henning-schild-work/isar/tree/henning/next
Henning
Am Tue, 12 Sep 2017 17:58:04 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> Patch 5 is _the_ patch that matters. Anything done before it is
> somehow required to work towards it. That is at least the idea.
> Please consider that during review.
>
> I did not test whether all individual commits actually work, i would
> like to assign that task to CI and repair whatever is broken.
>
> Changes since last time:
> - change class names:
> - dpkg simply stays dpkg but we have a new dpkg-base
> - name of new class is dpkg-raw
> - building is done in chroot
> - reason for patches 3 and 4
> - DISTRO_ARCH is used in do_deb_package_prepare
> - rebase on "[PATCH v3 0/5] Unify work space for packages"
>
>
> Henning Schild (6):
> meta: Move 'do_fetch' and 'do_unpack' to base-class
> meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass
> meta/dpkg: pull out actual build command from 'do_build'
> meta/dpkg: Move 'do_build' and buildchroot stuff to
> dpkg-base.bbclass meta/dpkg: add dpkg-raw class
> recipes-app/example-raw: add an example on how to use dpkg-raw
>
> .../recipes-app/example-raw/example-raw_0.1.bb | 35 ++++++++++++
> meta-isar/recipes-app/example-raw/files/README | 1 +
> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++
> meta/classes/base.bbclass | 37 +++++++++++++
> meta/classes/dpkg-base.bbclass | 36 ++++++++++++
> meta/classes/dpkg-raw.bbclass | 55
> +++++++++++++++++++
> meta/classes/dpkg.bbclass | 64
> +--------------------- 7 files changed, 182 insertions(+), 62
> deletions(-) create mode 100644
> meta-isar/recipes-app/example-raw/example-raw_0.1.bb create mode
> 100644 meta-isar/recipes-app/example-raw/files/README create mode
> 100644 meta-isar/recipes-app/example-raw/files/postinst create mode
> 100644 meta/classes/dpkg-base.bbclass create mode 100644
> meta/classes/dpkg-raw.bbclass
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH][FYI] dpkg-raw: Allow multiconfig build
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (6 preceding siblings ...)
2017-09-12 17:07 ` [PATCH v2 0/6] v4 of the custom debian package Henning Schild
@ 2017-09-13 15:00 ` Alexander Smirnov
2017-09-13 15:09 ` Alexander Smirnov
2017-09-14 17:18 ` [PATCH v2 0/6] v4 of the custom debian package Alexander Smirnov
8 siblings, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-13 15:00 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
Add suffixes to stamps for tasks defined in dpkg-raw class. This allows
to use multiconfig.
8<--
If I build Isar using command:
$ bitbake multiconfig:qemuarm-wheezy:isar-image-base multiconfig:qemuarm-jessie:isar-image-base
There will be the following stamps created:
1. Without this patch:
$ ls -1 tmp/stamps
...
example-raw-0.1-r0.do_build.raspbian-jessie-armhf
example-raw-0.1-r0.do_deb_package_conffiles
example-raw-0.1-r0.do_deb_package_prepare
example-raw-0.1-r0.do_fetch
example-raw-0.1-r0.do_populate_package
...
[example for hello package]:
hello-1.0-r0.do_build.debian-jessie-armhf
hello-1.0-r0.do_build.debian-wheezy-armhf
hello-1.0-r0.do_fetch
hello-1.0-r0.do_unpack.debian-jessie-armhf
hello-1.0-r0.do_unpack.debian-wheezy-armhf
...
In this case, the "example-raw" package will be processed only once, so for
all the other architectures bitbake will ignore tasks execution.
2. With this patch:
...
example-raw-0.1-r0.do_build.debian-jessie-armhf
example-raw-0.1-r0.do_build.debian-wheezy-armhf
example-raw-0.1-r0.do_deb_package_conffiles.debian-jessie-armhf
example-raw-0.1-r0.do_deb_package_conffiles.debian-wheezy-armhf
example-raw-0.1-r0.do_deb_package_prepare.debian-jessie-armhf
example-raw-0.1-r0.do_deb_package_prepare.debian-wheezy-armhf
example-raw-0.1-r0.do_fetch
example-raw-0.1-r0.do_populate_package.debian-jessie-armhf
example-raw-0.1-r0.do_populate_package.debian-wheezy-armhf
example-raw-0.1-r0.do_unpack.debian-jessie-armhf
example-raw-0.1-r0.do_unpack.debian-wheezy-armhf
...
So all the new tasks added to Isar, that are distro and/or architecture
specific, should have suffixes in stamps.
8<--
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
meta/classes/dpkg-raw.bbclass | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index f9a7411..6c6a89c 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -14,6 +14,7 @@ do_populate_package() {
bbnote "Put your files for this package in ${D}"
}
+do_populate_package[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
addtask populate_package after do_unpack before do_deb_package_prepare
# so we can put hooks etc. in there already
@@ -39,6 +40,7 @@ do_deb_package_prepare() {
done
}
+do_deb_package_prepare[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
addtask deb_package_prepare after do_populate_package before do_deb_package_conffiles
do_deb_package_conffiles() {
@@ -47,6 +49,7 @@ do_deb_package_conffiles() {
test -s $CONFFILES || rm $CONFFILES
}
+do_deb_package_conffiles[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
addtask deb_package_conffiles after do_deb_package_prepare before do_build
dpkg_runbuild() {
--
2.1.4
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH][FYI] dpkg-raw: Allow multiconfig build
2017-09-13 15:00 ` [PATCH][FYI] dpkg-raw: Allow multiconfig build Alexander Smirnov
@ 2017-09-13 15:09 ` Alexander Smirnov
2017-09-14 8:31 ` Henning Schild
0 siblings, 1 reply; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-13 15:09 UTC (permalink / raw)
To: isar-users
P.S. all the multiconfig builds have been completed, no more issues found.
On 09/13/2017 06:00 PM, Alexander Smirnov wrote:
> Add suffixes to stamps for tasks defined in dpkg-raw class. This allows
> to use multiconfig.
>
> 8<--
>
> If I build Isar using command:
>
> $ bitbake multiconfig:qemuarm-wheezy:isar-image-base multiconfig:qemuarm-jessie:isar-image-base
>
> There will be the following stamps created:
>
> 1. Without this patch:
>
> $ ls -1 tmp/stamps
>
> ...
> example-raw-0.1-r0.do_build.raspbian-jessie-armhf
> example-raw-0.1-r0.do_deb_package_conffiles
> example-raw-0.1-r0.do_deb_package_prepare
> example-raw-0.1-r0.do_fetch
> example-raw-0.1-r0.do_populate_package
> ...
> [example for hello package]:
> hello-1.0-r0.do_build.debian-jessie-armhf
> hello-1.0-r0.do_build.debian-wheezy-armhf
> hello-1.0-r0.do_fetch
> hello-1.0-r0.do_unpack.debian-jessie-armhf
> hello-1.0-r0.do_unpack.debian-wheezy-armhf
> ...
>
> In this case, the "example-raw" package will be processed only once, so for
> all the other architectures bitbake will ignore tasks execution.
>
> 2. With this patch:
>
> ...
> example-raw-0.1-r0.do_build.debian-jessie-armhf
> example-raw-0.1-r0.do_build.debian-wheezy-armhf
> example-raw-0.1-r0.do_deb_package_conffiles.debian-jessie-armhf
> example-raw-0.1-r0.do_deb_package_conffiles.debian-wheezy-armhf
> example-raw-0.1-r0.do_deb_package_prepare.debian-jessie-armhf
> example-raw-0.1-r0.do_deb_package_prepare.debian-wheezy-armhf
> example-raw-0.1-r0.do_fetch
> example-raw-0.1-r0.do_populate_package.debian-jessie-armhf
> example-raw-0.1-r0.do_populate_package.debian-wheezy-armhf
> example-raw-0.1-r0.do_unpack.debian-jessie-armhf
> example-raw-0.1-r0.do_unpack.debian-wheezy-armhf
> ...
>
> So all the new tasks added to Isar, that are distro and/or architecture
> specific, should have suffixes in stamps.
>
> 8<--
>
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> ---
> meta/classes/dpkg-raw.bbclass | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
> index f9a7411..6c6a89c 100644
> --- a/meta/classes/dpkg-raw.bbclass
> +++ b/meta/classes/dpkg-raw.bbclass
> @@ -14,6 +14,7 @@ do_populate_package() {
> bbnote "Put your files for this package in ${D}"
> }
>
> +do_populate_package[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> addtask populate_package after do_unpack before do_deb_package_prepare
>
> # so we can put hooks etc. in there already
> @@ -39,6 +40,7 @@ do_deb_package_prepare() {
> done
> }
>
> +do_deb_package_prepare[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> addtask deb_package_prepare after do_populate_package before do_deb_package_conffiles
>
> do_deb_package_conffiles() {
> @@ -47,6 +49,7 @@ do_deb_package_conffiles() {
> test -s $CONFFILES || rm $CONFFILES
> }
>
> +do_deb_package_conffiles[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> addtask deb_package_conffiles after do_deb_package_prepare before do_build
>
> dpkg_runbuild() {
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH][FYI] dpkg-raw: Allow multiconfig build
2017-09-13 15:09 ` Alexander Smirnov
@ 2017-09-14 8:31 ` Henning Schild
0 siblings, 0 replies; 25+ messages in thread
From: Henning Schild @ 2017-09-14 8:31 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
Am Wed, 13 Sep 2017 18:09:32 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> P.S. all the multiconfig builds have been completed, no more issues
> found.
Sweet, thanks for finding and fixing these issues. I will look into the
whole multiconfig story and test future changes on more than one config.
Henning
> On 09/13/2017 06:00 PM, Alexander Smirnov wrote:
> > Add suffixes to stamps for tasks defined in dpkg-raw class. This
> > allows to use multiconfig.
> >
> > 8<--
> >
> > If I build Isar using command:
> >
> > $ bitbake multiconfig:qemuarm-wheezy:isar-image-base
> > multiconfig:qemuarm-jessie:isar-image-base
> >
> > There will be the following stamps created:
> >
> > 1. Without this patch:
> >
> > $ ls -1 tmp/stamps
> >
> > ...
> > example-raw-0.1-r0.do_build.raspbian-jessie-armhf
> > example-raw-0.1-r0.do_deb_package_conffiles
> > example-raw-0.1-r0.do_deb_package_prepare
> > example-raw-0.1-r0.do_fetch
> > example-raw-0.1-r0.do_populate_package
> > ...
> > [example for hello package]:
> > hello-1.0-r0.do_build.debian-jessie-armhf
> > hello-1.0-r0.do_build.debian-wheezy-armhf
> > hello-1.0-r0.do_fetch
> > hello-1.0-r0.do_unpack.debian-jessie-armhf
> > hello-1.0-r0.do_unpack.debian-wheezy-armhf
> > ...
> >
> > In this case, the "example-raw" package will be processed only
> > once, so for all the other architectures bitbake will ignore tasks
> > execution.
> >
> > 2. With this patch:
> >
> > ...
> > example-raw-0.1-r0.do_build.debian-jessie-armhf
> > example-raw-0.1-r0.do_build.debian-wheezy-armhf
> > example-raw-0.1-r0.do_deb_package_conffiles.debian-jessie-armhf
> > example-raw-0.1-r0.do_deb_package_conffiles.debian-wheezy-armhf
> > example-raw-0.1-r0.do_deb_package_prepare.debian-jessie-armhf
> > example-raw-0.1-r0.do_deb_package_prepare.debian-wheezy-armhf
> > example-raw-0.1-r0.do_fetch
> > example-raw-0.1-r0.do_populate_package.debian-jessie-armhf
> > example-raw-0.1-r0.do_populate_package.debian-wheezy-armhf
> > example-raw-0.1-r0.do_unpack.debian-jessie-armhf
> > example-raw-0.1-r0.do_unpack.debian-wheezy-armhf
> > ...
> >
> > So all the new tasks added to Isar, that are distro and/or
> > architecture specific, should have suffixes in stamps.
> >
> > 8<--
> >
> > Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> > ---
> > meta/classes/dpkg-raw.bbclass | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/classes/dpkg-raw.bbclass
> > b/meta/classes/dpkg-raw.bbclass index f9a7411..6c6a89c 100644
> > --- a/meta/classes/dpkg-raw.bbclass
> > +++ b/meta/classes/dpkg-raw.bbclass
> > @@ -14,6 +14,7 @@ do_populate_package() {
> > bbnote "Put your files for this package in ${D}"
> > }
> >
> > +do_populate_package[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> > addtask populate_package after do_unpack before
> > do_deb_package_prepare
> > # so we can put hooks etc. in there already
> > @@ -39,6 +40,7 @@ do_deb_package_prepare() {
> > done
> > }
> >
> > +do_deb_package_prepare[stamp-extra-info] =
> > "${DISTRO}-${DISTRO_ARCH}" addtask deb_package_prepare after
> > do_populate_package before do_deb_package_conffiles
> > do_deb_package_conffiles() {
> > @@ -47,6 +49,7 @@ do_deb_package_conffiles() {
> > test -s $CONFFILES || rm $CONFFILES
> > }
> >
> > +do_deb_package_conffiles[stamp-extra-info] =
> > "${DISTRO}-${DISTRO_ARCH}" addtask deb_package_conffiles after
> > do_deb_package_prepare before do_build
> > dpkg_runbuild() {
> >
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 0/6] v4 of the custom debian package
2017-09-12 15:58 [PATCH v2 0/6] v4 of the custom debian package Henning Schild
` (7 preceding siblings ...)
2017-09-13 15:00 ` [PATCH][FYI] dpkg-raw: Allow multiconfig build Alexander Smirnov
@ 2017-09-14 17:18 ` Alexander Smirnov
8 siblings, 0 replies; 25+ messages in thread
From: Alexander Smirnov @ 2017-09-14 17:18 UTC (permalink / raw)
To: Henning Schild, isar-users
Applied to next.
On 09/12/2017 06:58 PM, Henning Schild wrote:
> Patch 5 is _the_ patch that matters. Anything done before it is somehow
> required to work towards it. That is at least the idea. Please consider
> that during review.
>
> I did not test whether all individual commits actually work, i would like
> to assign that task to CI and repair whatever is broken.
>
> Changes since last time:
> - change class names:
> - dpkg simply stays dpkg but we have a new dpkg-base
> - name of new class is dpkg-raw
> - building is done in chroot
> - reason for patches 3 and 4
> - DISTRO_ARCH is used in do_deb_package_prepare
> - rebase on "[PATCH v3 0/5] Unify work space for packages"
>
>
> Henning Schild (6):
> meta: Move 'do_fetch' and 'do_unpack' to base-class
> meta/dpkg-debian: Move 'do_install' to new dpkg-base.bbclass
> meta/dpkg: pull out actual build command from 'do_build'
> meta/dpkg: Move 'do_build' and buildchroot stuff to dpkg-base.bbclass
> meta/dpkg: add dpkg-raw class
> recipes-app/example-raw: add an example on how to use dpkg-raw
>
> .../recipes-app/example-raw/example-raw_0.1.bb | 35 ++++++++++++
> meta-isar/recipes-app/example-raw/files/README | 1 +
> meta-isar/recipes-app/example-raw/files/postinst | 16 ++++++
> meta/classes/base.bbclass | 37 +++++++++++++
> meta/classes/dpkg-base.bbclass | 36 ++++++++++++
> meta/classes/dpkg-raw.bbclass | 55 +++++++++++++++++++
> meta/classes/dpkg.bbclass | 64 +---------------------
> 7 files changed, 182 insertions(+), 62 deletions(-)
> create mode 100644 meta-isar/recipes-app/example-raw/example-raw_0.1.bb
> create mode 100644 meta-isar/recipes-app/example-raw/files/README
> create mode 100644 meta-isar/recipes-app/example-raw/files/postinst
> create mode 100644 meta/classes/dpkg-base.bbclass
> create mode 100644 meta/classes/dpkg-raw.bbclass
>
^ permalink raw reply [flat|nested] 25+ messages in thread