[PATCH 07/16] classes: use WORKDIR and get rid of BUILDROOT

45 views
Skip to first unread message

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg.bbclass | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 3d7aafb..1d0132b 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -10,9 +10,7 @@ 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}"
-
-do_fetch[dirs] = "${DL_DIR}"
+WORKDIR = "${BUILDCHROOT_DIR}/${PP}"

# Fetch package from the source link
python do_fetch() {
@@ -28,10 +26,10 @@ python do_fetch() {
}

addtask fetch before do_build
+do_fetch[dirs] = "${DL_DIR}"

-do_unpack[dirs] = "${BUILDROOT}"
do_unpack[stamp-extra-info] = "${DISTRO}"
-S ?= "${BUILDROOT}"
+S ?= "${WORKDIR}"

# Unpack package and put it into working directory in buildchroot
python do_unpack() {
@@ -39,16 +37,15 @@ python do_unpack() {
if len(src_uri) == 0:
return

- rootdir = d.getVar('BUILDROOT', True)
-
try:
fetcher = bb.fetch2.Fetch(src_uri, d)
- fetcher.unpack(rootdir)
+ fetcher.unpack(d.getVar('WORKDIR', True))
except bb.fetch2.BBFetchException as e:
raise bb.build.FuncFailed(e)
}

addtask unpack after do_fetch before do_build
+do_unpack[dirs] = "${WORKDIR}"

do_build[stamp-extra-info] = "${DISTRO}"

@@ -62,7 +59,7 @@ do_install[stamp-extra-info] = "${MACHINE}"
# Install package to dedicated deploy directory
do_install() {
install -d ${DEPLOY_DIR_DEB}
- install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
+ install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
}

addtask do_install after do_build
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Some security enhancing packages can cause our initrd to be not readable
by a normal user. So we need to copy with sudo.
Also regular cp would destroy ownership and other attributes of files,
possibly creating problems in the future.

Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/ext4-img.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 65d4c11..6dc2039 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -21,16 +21,16 @@ do_ext4_image() {

mkdir -p ${WORKDIR}/mnt
sudo mount -o loop ${EXT4_IMAGE_FILE} ${WORKDIR}/mnt
- sudo cp -r ${S}/* ${WORKDIR}/mnt
+ sudo cp -a ${S}/* ${WORKDIR}/mnt
sudo umount ${WORKDIR}/mnt
rm -r ${WORKDIR}/mnt

if [ -n "${KERNEL_IMAGE}" ]; then
- cp ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
+ sudo cp -a ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
fi

if [ -n "${INITRD_IMAGE}" ]; then
- cp ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
+ sudo cp -a ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
fi
}

--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
This series includes several basic fixes to isar. It replaces all the
previously posted patches by me, since it includes updated versions of
those.

I did some restructuring moving tasks to the class isar-base. Some of that
is to give structure and some to introduce dpdk-bin. dpdk-bin is a class
that packages random files on the fly, this way you can also run hooks
when installing the packages, see example in last commit.


Henning Schild (16):
meta: ext4-img: copy and keep attributes, always copy with sudo
meta: classes: use base.bbclass from bitbake
meta: isar-base: remove unused function
remove redundant variable THISDIR
meta: conf: use bitbake.conf from bitbake and apply local changes
meta: conf: clean up local bitbake config
classes: use WORKDIR and get rid of BUILDROOT
classes: move fetch and unpack into isar-base
meta: dpdk use [dirs] directive instead of mkdir
meta: dpkg: reorder and rename do_install to install in addtask
meta: classes: make do_build always the end of the task-chain
meta: dpkg rename install to install_package
meta: classes: move install_package to isar-base
meta: classes: rename dpkg to dpkg-src
meta: add dpkg-bin class
recipes-app/hello-bin: add example on how to use dpkg-bin

.../bitbake-user-manual-execution.xml | 2 +-
meta-isar/recipes-app/hello-bin/files/README | 1 +
meta-isar/recipes-app/hello-bin/files/postinst | 14 ++++
meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 26 +++++++
meta-isar/recipes-app/hello/hello.bb | 2 +-
meta-isar/recipes-core/images/isar-image-base.bb | 8 +--
meta/classes/base.bbclass | 81 +---------------------
meta/classes/dpkg-bin.bbclass | 47 +++++++++++++
meta/classes/dpkg-src.bbclass | 22 ++++++
meta/classes/ext4-img.bbclass | 8 ++-
meta/classes/image.bbclass | 2 +-
meta/classes/isar-base-image.bbclass | 1 +
meta/classes/{dpkg.bbclass => isar-base.bbclass} | 42 +++--------
meta/conf/bitbake.conf.sample | 68 ------------------
meta/conf/isar-bitbake.conf | 11 +++
meta/recipes-devtools/buildchroot/buildchroot.bb | 10 +--
scripts/isar-setup-builddir | 33 +++++++--
17 files changed, 179 insertions(+), 199 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
mode change 100644 => 120000 meta/classes/base.bbclass
create mode 100644 meta/classes/dpkg-bin.bbclass
create mode 100644 meta/classes/dpkg-src.bbclass
create mode 100644 meta/classes/isar-base-image.bbclass
rename meta/classes/{dpkg.bbclass => isar-base.bbclass} (51%)
delete mode 100644 meta/conf/bitbake.conf.sample
create mode 100644 meta/conf/isar-bitbake.conf

--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@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

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
create a new base-class for images

Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg.bbclass | 34 ----------------------------------
meta/classes/ext4-img.bbclass | 2 +-
meta/classes/isar-base-image.bbclass | 1 +
meta/classes/isar-base.bbclass | 33 +++++++++++++++++++++++++++++++++
4 files changed, 35 insertions(+), 35 deletions(-)
create mode 100644 meta/classes/isar-base-image.bbclass

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 1d0132b..58cee6e 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -11,42 +11,8 @@ do_unpack[deptask] = "do_build"
# recipe name as identifier
PP = "/home/builder/${PN}"
WORKDIR = "${BUILDCHROOT_DIR}/${PP}"
-
-# 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_fetch[dirs] = "${DL_DIR}"
-
-do_unpack[stamp-extra-info] = "${DISTRO}"
S ?= "${WORKDIR}"

-# Unpack package and put it into working directory in buildchroot
-python do_unpack() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- try:
- fetcher = bb.fetch2.Fetch(src_uri, d)
- fetcher.unpack(d.getVar('WORKDIR', True))
- except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
-}
-
-addtask unpack after do_fetch before do_build
-do_unpack[dirs] = "${WORKDIR}"
-
do_build[stamp-extra-info] = "${DISTRO}"

# Build package from sources using build script
diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index eb23d06..5125d8e 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -1,7 +1,7 @@
# This software is a part of ISAR.
# Copyright (C) 2015-2016 ilbers GmbH

-inherit isar-base
+inherit isar-base-image

# Extra space for rootfs in MB
ROOTFS_EXTRA ?= "64"
diff --git a/meta/classes/isar-base-image.bbclass b/meta/classes/isar-base-image.bbclass
new file mode 100644
index 0000000..33b0369
--- /dev/null
+++ b/meta/classes/isar-base-image.bbclass
@@ -0,0 +1 @@
+do_build[nostamp] = "0"
diff --git a/meta/classes/isar-base.bbclass b/meta/classes/isar-base.bbclass
index 33b0369..3df6572 100644
--- a/meta/classes/isar-base.bbclass
+++ b/meta/classes/isar-base.bbclass
@@ -1 +1,34 @@
do_build[nostamp] = "0"
+
+# 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_fetch[dirs] = "${DL_DIR}"
+
+# Unpack package and put it into working directory in buildchroot
+python do_unpack() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.unpack(d.getVar('WORKDIR', True))
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask unpack after do_fetch before do_build
+do_unpack[dirs] = "${WORKDIR}"
+do_unpack[stamp-extra-info] = "${DISTRO}"
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild, Dr . Johann Pfefferl
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg-bin.bbclass | 47 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 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..1e96bd1
--- /dev/null
+++ b/meta/classes/dpkg-bin.bbclass
@@ -0,0 +1,47 @@
+inherit isar-base
+
+DEBIAN_DEPENDS ?= ""
+DEBIAN_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 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: ${DEBIAN_MAINTAINER}
+ Depends: `echo ${DEBIAN_DEPENDS} | tr '[:blank:]' ','`
+ Version: ${PV}+isar
+ Description: ${DESCRIPTION}
+ __EOF__
+ CONFFILES=${D}/DEBIAN/conffiles
+ find ${D} -path '*/etc/*' | sed -e 's|^${D}||' > $CONFFILES
+ test -s $CONFFILES || rm $CONFFILES
+ 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_install_package
+
+do_deb_package() {
+ sudo chown -R root:root ${D}/DEBIAN/
+ sudo dpkg-deb --build ${D} ${WORKDIR}
+}
+
+addtask deb_package after do_deb_package_prepare before do_install_package
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@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 58cee6e..b20a54e 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -24,8 +24,8 @@ do_install[stamp-extra-info] = "${MACHINE}"

# Install package to dedicated deploy directory
do_install() {
- install -d ${DEPLOY_DIR_DEB}
install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
}

addtask do_install after do_build
+do_install[dirs] = "${DEPLOY_DIR_DEB}"
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
install will be used by later patches to actually populate debian
packages

Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg.bbclass | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 71c7122..2a1b85c 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -18,14 +18,14 @@ do_compile() {
sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
}

-addtask compile after do_unpack before do_install
+addtask compile after do_unpack before do_install_package
do_compile[stamp-extra-info] = "${DISTRO}"

# Install package to dedicated deploy directory
-do_install() {
+do_install_package() {
install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
}

-addtask install after do_compile before do_build
-do_install[dirs] = "${DEPLOY_DIR_DEB}"
-do_install[stamp-extra-info] = "${MACHINE}"
+addtask install_package after do_compile before do_build
+do_install_package[dirs] = "${DEPLOY_DIR_DEB}"
+do_install_package[stamp-extra-info] = "${MACHINE}"
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg.bbclass | 9 ---------
meta/classes/isar-base.bbclass | 10 ++++++++++
2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 2a1b85c..37b2c8d 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -20,12 +20,3 @@ do_compile() {

addtask compile after do_unpack before do_install_package
do_compile[stamp-extra-info] = "${DISTRO}"
-
-# Install package to dedicated deploy directory
-do_install_package() {
- install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
-}
-
-addtask install_package after do_compile before do_build
-do_install_package[dirs] = "${DEPLOY_DIR_DEB}"
-do_install_package[stamp-extra-info] = "${MACHINE}"
diff --git a/meta/classes/isar-base.bbclass b/meta/classes/isar-base.bbclass
index 3df6572..68e2aed 100644
--- a/meta/classes/isar-base.bbclass
+++ b/meta/classes/isar-base.bbclass
@@ -32,3 +32,13 @@ python do_unpack() {
addtask unpack after do_fetch before do_build
do_unpack[dirs] = "${WORKDIR}"
do_unpack[stamp-extra-info] = "${DISTRO}"
+
+
+# Install package to dedicated deploy directory
+do_install_package() {
+ install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
+}
+
+addtask install_package before do_build

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
force isar to always use a bitbake.conf from its bitbake
the diff went into a file that needs to be looked at later

Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/conf/bitbake.conf.sample | 68 -------------------------------------------
meta/conf/isar-bitbake.conf | 20 +++++++++++++
scripts/isar-setup-builddir | 33 ++++++++++++++++++---
3 files changed, 49 insertions(+), 72 deletions(-)
delete mode 100644 meta/conf/bitbake.conf.sample
create mode 100644 meta/conf/isar-bitbake.conf

diff --git a/meta/conf/bitbake.conf.sample b/meta/conf/bitbake.conf.sample
deleted file mode 100644
index 9d7c1f4..0000000
--- a/meta/conf/bitbake.conf.sample
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) 2003 Chris Larson
-#
-# 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.
-
-B = "${S}"
-CVSDIR = "${DL_DIR}/cvs"
-DEPENDS = ""
-DEPLOY_DIR = "${TMPDIR}/deploy"
-DEPLOY_DIR_DEB = "${TMPDIR}/deploy/deb/${MACHINE}"
-DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images"
-DL_DIR = "${TMPDIR}/downloads"
-SSTATE_DIR ?= "${TMPDIR}/sstate-cache"
-FILESDIR = "${@bb.which(bb.data.getVar('FILESPATH', d, 1), '.')}"
-FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
-FILE_DIRNAME = "${@os.path.dirname(bb.data.getVar('FILE', d))}"
-GITDIR = "${DL_DIR}/git"
-IMAGE_CMD = "_NO_DEFINED_IMAGE_TYPES_"
-IMAGE_ROOTFS = "${TMPDIR}/rootfs"
-MKTEMPCMD = "mktemp -q ${TMPBASE}"
-MKTEMPDIRCMD = "mktemp -d -q ${TMPBASE}"
-OVERRIDES = "local:${MACHINE}:${TARGET_OS}:${TARGET_ARCH}"
-P = "${PN}-${PV}"
-PERSISTENT_DIR = "${TMPDIR}/cache"
-PF = "${PN}-${PV}-${PR}"
-PN = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[0] or 'defaultpkgname'}"
-PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0'}"
-PROVIDES = ""
-PV = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[1] or '1.0'}"
-RESUMECOMMAND = ""
-RESUMECOMMAND_wget = "/usr/bin/env wget -c -t 5 --passive-ftp -P ${DL_DIR} ${URI}"
-S = "${WORKDIR}/${P}"
-SRC_URI = "file://${FILE}"
-STAMPS_DIR ?= "${TMPDIR}/stamps"
-STAMP = "${TMPDIR}/stamps/${PF}"
-SVNDIR = "${DL_DIR}/svn"
-T = "${WORKDIR}/temp"
-TARGET_ARCH = "${BUILD_ARCH}"
-TMPDIR = "${TOPDIR}/tmp"
-UPDATECOMMAND = ""
-UPDATECOMMAND_cvs = "/usr/bin/env cvs -d${CVSROOT} update ${CVSCOOPTS}"
-UPDATECOMMAND_svn = "/usr/bin/env svn update ${SVNCOOPTS}"
-WORKDIR = "${TMPDIR}/work/${PF}"
-PERSISTENT_DIR = "${TMPDIR}/cache"
-BUILDCHROOT_DIR = "${TOPDIR}/tmp/work/buildchroot/${DISTRO}/rootfs"
-CACHE = "${TMPDIR}/cache"
-
-# Setup our default hash policy
-BB_SIGNATURE_HANDLER ?= "noop"
-
-include conf/local.conf
-include conf/machine/${MACHINE}.conf
-include conf/distro/${DISTRO}.conf
diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf
new file mode 100644
index 0000000..d56f3da
--- /dev/null
+++ b/meta/conf/isar-bitbake.conf
@@ -0,0 +1,20 @@
+DEPLOY_DIR_DEB = "${TMPDIR}/deploy/deb/${MACHINE}"
+SSTATE_DIR ?= "${TMPDIR}/sstate-cache"
+MKTEMPCMD = "mktemp -q ${TMPBASE}"
+MKTEMPDIRCMD = "mktemp -d -q ${TMPBASE}"
+RESUMECOMMAND = ""
+RESUMECOMMAND_wget = "/usr/bin/env wget -c -t 5 --passive-ftp -P ${DL_DIR} ${URI}"
+STAMPS_DIR ?= "${TMPDIR}/stamps"
+UPDATECOMMAND = ""
+UPDATECOMMAND_cvs = "/usr/bin/env cvs -d${CVSROOT} update ${CVSCOOPTS}"
+UPDATECOMMAND_svn = "/usr/bin/env svn update ${SVNCOOPTS}"
+BUILDCHROOT_DIR = "${TOPDIR}/tmp/work/buildchroot/${DISTRO}/rootfs"
+CROSSBUILDCHROOT_DIR = "${TOPDIR}/tmp/work/crossbuildchroot/${DISTRO_ARCH}/${DISTRO}/rootfs"
+CACHE = "${TMPDIR}/cache"
+
+# Setup our default hash policy
+BB_SIGNATURE_HANDLER ?= "noop"
+
+include conf/local.conf
+include conf/machine/${MACHINE}.conf
+include conf/distro/${DISTRO}.conf
diff --git a/scripts/isar-setup-builddir b/scripts/isar-setup-builddir
index 070a316..d400694 100755
--- a/scripts/isar-setup-builddir
+++ b/scripts/isar-setup-builddir
@@ -106,10 +106,35 @@ EOM
SHOWYPDOC=yes
fi

-if [ ! -f "$BUILDDIR/conf/bitbake.conf" ]; then
- cp "$ISARROOT/meta/conf/bitbake.conf.sample" \
- "$BUILDDIR/conf/bitbake.conf"
-fi
+cat <<EOF > $BUILDDIR/conf/bitbake.conf
+# ********************************************
+# THIS FILE IS GENERATED! DO NOT MESS WITH IT!
+# ********************************************
+
+# ---------
+# begin original bitbake.conf
+# ---------
+
+EOF
+cat "$ISARROOT/bitbake/conf/bitbake.conf" >> \
+ "$BUILDDIR/conf/bitbake.conf"
+cat <<EOF >> $BUILDDIR/conf/bitbake.conf
+# ---------
+# end original bitbake.conf
+# ---------
+
+# ---------
+# begin isar-bitbake.conf
+# ---------
+
+EOF
+cat "$ISARROOT/meta/conf/isar-bitbake.conf" >> \
+ "$BUILDDIR/conf/bitbake.conf"
+cat <<EOF >> $BUILDDIR/conf/bitbake.conf
+# ---------
+# end isar-bitbake.conf
+# ---------
+EOF

# Ending the first-time run message. Show the no documentation banner.
if [ ! -z "$SHOWYPDOC" ]; then
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
.../doc/bitbake-user-manual/bitbake-user-manual-execution.xml | 2 +-
meta-isar/recipes-core/images/isar-image-base.bb | 8 ++++----
meta/classes/isar-base.bbclass | 2 --
meta/recipes-devtools/buildchroot/buildchroot.bb | 10 +++++-----
4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
index ec75893..b9aafd1 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
@@ -765,7 +765,7 @@
the concept:
<literallayout class='monospaced'>
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
- SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
+ SSTATE_DIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX"
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 337c329..0810de0 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -27,10 +27,10 @@ do_rootfs() {
install -d -m 755 ${WORKDIR}/hooks_multistrap

# Copy config file
- install -m 644 ${THISDIR}/files/multistrap.conf.in ${WORKDIR}/multistrap.conf
- install -m 755 ${THISDIR}/files/${DISTRO_CONFIG_SCRIPT} ${WORKDIR}/configscript.sh
- install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
- install -m 755 ${THISDIR}/files/download_dev-random ${WORKDIR}/hooks_multistrap/
+ install -m 644 ${FILESDIR}/multistrap.conf.in ${WORKDIR}/multistrap.conf
+ install -m 755 ${FILESDIR}/${DISTRO_CONFIG_SCRIPT} ${WORKDIR}/configscript.sh
+ install -m 755 ${FILESDIR}/setup.sh ${WORKDIR}
+ install -m 755 ${FILESDIR}/download_dev-random ${WORKDIR}/hooks_multistrap/

# Adjust multistrap config
sed -i 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|' ${WORKDIR}/multistrap.conf
diff --git a/meta/classes/isar-base.bbclass b/meta/classes/isar-base.bbclass
index 25809fa..33b0369 100644
--- a/meta/classes/isar-base.bbclass
+++ b/meta/classes/isar-base.bbclass
@@ -1,3 +1 @@
-THISDIR = "${@os.path.dirname(d.getVar('FILE', True))}"
-
do_build[nostamp] = "0"
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index ba1bc66..f471f5e 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -29,10 +29,10 @@ do_build() {
install -d -m 755 ${WORKDIR}/hooks_multistrap

# Copy config files
- install -m 644 ${THISDIR}/files/multistrap.conf.in ${WORKDIR}/multistrap.conf
- install -m 755 ${THISDIR}/files/configscript.sh ${WORKDIR}
- install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
- install -m 755 ${THISDIR}/files/download_dev-random ${WORKDIR}/hooks_multistrap/
+ install -m 644 ${FILESDIR}/multistrap.conf.in ${WORKDIR}/multistrap.conf
+ install -m 755 ${FILESDIR}/configscript.sh ${WORKDIR}
+ install -m 755 ${FILESDIR}/setup.sh ${WORKDIR}
+ install -m 755 ${FILESDIR}/download_dev-random ${WORKDIR}/hooks_multistrap/

# Adjust multistrap config
sed -i 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|' ${WORKDIR}/multistrap.conf
@@ -51,7 +51,7 @@ do_build() {
sudo multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f "${WORKDIR}/multistrap.conf" || true

# Install package builder script
- sudo install -m 755 ${THISDIR}/files/build.sh ${BUILDCHROOT_DIR}
+ sudo install -m 755 ${FILESDIR}/build.sh ${BUILDCHROOT_DIR}

# Configure root filesystem
sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:00 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/conf/isar-bitbake.conf | 9 ---------
1 file changed, 9 deletions(-)

diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf
index d56f3da..426da7f 100644
--- a/meta/conf/isar-bitbake.conf
+++ b/meta/conf/isar-bitbake.conf
@@ -1,16 +1,7 @@
DEPLOY_DIR_DEB = "${TMPDIR}/deploy/deb/${MACHINE}"
SSTATE_DIR ?= "${TMPDIR}/sstate-cache"
-MKTEMPCMD = "mktemp -q ${TMPBASE}"
-MKTEMPDIRCMD = "mktemp -d -q ${TMPBASE}"
-RESUMECOMMAND = ""
-RESUMECOMMAND_wget = "/usr/bin/env wget -c -t 5 --passive-ftp -P ${DL_DIR} ${URI}"
-STAMPS_DIR ?= "${TMPDIR}/stamps"
-UPDATECOMMAND = ""
-UPDATECOMMAND_cvs = "/usr/bin/env cvs -d${CVSROOT} update ${CVSCOOPTS}"
-UPDATECOMMAND_svn = "/usr/bin/env svn update ${SVNCOOPTS}"
BUILDCHROOT_DIR = "${TOPDIR}/tmp/work/buildchroot/${DISTRO}/rootfs"
CROSSBUILDCHROOT_DIR = "${TOPDIR}/tmp/work/crossbuildchroot/${DISTRO_ARCH}/${DISTRO}/rootfs"
-CACHE = "${TMPDIR}/cache"

# Setup our default hash policy
BB_SIGNATURE_HANDLER ?= "noop"
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:01 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta-isar/recipes-app/hello-bin/files/README | 1 +
meta-isar/recipes-app/hello-bin/files/postinst | 14 +++++++++++++
meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 26 ++++++++++++++++++++++++
3 files changed, 41 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..2a9eab6
--- /dev/null
+++ b/meta-isar/recipes-app/hello-bin/files/postinst
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if ! getent group hello >/dev/null; then
+ addgroup --quiet --system hello
+fi
+
+if ! getent passwd hello >/dev/null; then
+ adduser --system --ingroup hello --home /var/lib/hello hello \
+ --gecos "My hello user"
+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..5ff12d3
--- /dev/null
+++ b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb
@@ -0,0 +1,26 @@
+# 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"
+DEBIAN_MAINTAINER = "Your name here <y...@domain.com>"
+
+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 overlay"
+ install -v -d ${D}/usr/local/bin/
+ install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
+
+ bbnote "Now copy ${FILESDIR}/README to overlay"
+ install -v -d ${D}/usr/local/doc/
+ install -v -m 644 ${FILESDIR}/README ${D}/usr/local/doc/README-${P}
+
+ bbnote "Now for a debian hook, see dpkg-deb"
+ install -v -m 755 ${FILESDIR}/postinst ${D}/DEBIAN/postinst
+}
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:01 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
build is bitbakes default target and queing tasks behind it is asking
for trouble
Introduce do_compile where we "build" the debian packages.

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

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 4228b0d..71c7122 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -13,19 +13,19 @@ PP = "/home/builder/${PN}"
WORKDIR = "${BUILDCHROOT_DIR}/${PP}"
S ?= "${WORKDIR}"

-do_build[stamp-extra-info] = "${DISTRO}"
-
# Build package from sources using build script
-do_build() {
+do_compile() {
sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
}

+addtask compile after do_unpack before do_install
+do_compile[stamp-extra-info] = "${DISTRO}"

# Install package to dedicated deploy directory
do_install() {
install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
}

-addtask install after do_build
+addtask install after do_compile before do_build
do_install[dirs] = "${DEPLOY_DIR_DEB}"
do_install[stamp-extra-info] = "${MACHINE}"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3e4877c..8db3352 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_build"
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:16:01 AM8/1/17
to isar-...@googlegroups.com, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index b20a54e..4228b0d 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -20,12 +20,12 @@ do_build() {
sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
}

-do_install[stamp-extra-info] = "${MACHINE}"

# Install package to dedicated deploy directory
do_install() {
install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
}

-addtask do_install after do_build
+addtask install after do_build
do_install[dirs] = "${DEPLOY_DIR_DEB}"
+do_install[stamp-extra-info] = "${MACHINE}"
--
2.13.0

Henning Schild

unread,
Aug 1, 2017, 6:21:09 AM8/1/17
to isar-...@googlegroups.com
The q is also available here:

https://github.com/henning-schild/isar/tree/henning/staging_on_master

Henning

Am Tue, 1 Aug 2017 12:17:18 +0200
schrieb Henning Schild <henning...@siemens.com>:

Claudius Heine

unread,
Aug 1, 2017, 7:24:16 AM8/1/17
to [ext] Henning Schild, isar-...@googlegroups.com
Hi,

On 08/01/2017 12:17 PM, [ext] Henning Schild wrote:
> This series includes several basic fixes to isar. It replaces all the
> previously posted patches by me, since it includes updated versions of
> those.
>
> I did some restructuring moving tasks to the class isar-base. Some of that
> is to give structure and some to introduce dpdk-bin. dpdk-bin is a class
> that packages random files on the fly, this way you can also run hooks
> when installing the packages, see example in last commit.

Patchset looks good. I will now convert my project to this and test it.

Thanks,
Claudius

Claudius Heine

unread,
Aug 1, 2017, 7:48:53 AM8/1/17
to [ext] Henning Schild, isar-...@googlegroups.com
On 08/01/2017 12:17 PM, [ext] Henning Schild wrote:
Add "after do_unpack" here.

Claudius Heine

unread,
Aug 1, 2017, 10:00:04 AM8/1/17
to [ext] Henning Schild, isar-...@googlegroups.com


On 08/01/2017 12:17 PM, [ext] Henning Schild wrote:
Since I like to use the fetcher tasks for a image recipe, I inherit from
this class, but the image recipe does not have any 'deb' files, so
building failes here.

So it might be more modular if this task moves into an own class.

Claudius Heine

unread,
Aug 1, 2017, 10:25:09 AM8/1/17
to [ext] Henning Schild, isar-...@googlegroups.com, Dr . Johann Pfefferl


On 08/01/2017 12:17 PM, [ext] Henning Schild wrote:
I package a container root file system and now the files in the etc
directory of this rfs is mentioned in the conffiles file.

Maybe add an option to disable this here?

Henning Schild

unread,
Aug 1, 2017, 10:59:32 AM8/1/17
to Claudius Heine, isar-...@googlegroups.com
Am Tue, 1 Aug 2017 16:00:03 +0200
schrieb Claudius Heine <claudius....@siemens.com>:
Sure, makes sense. I just started looking into the image side of isar.
Will be addressed in a V2.

Henning

Claudius Heine

unread,
Aug 1, 2017, 11:10:02 AM8/1/17
to [ext] Henning Schild, isar-...@googlegroups.com, Dr . Johann Pfefferl
It also adds directories into the conffiles file. dpkg does not like this.

Jan Kiszka

unread,
Aug 2, 2017, 2:33:34 AM8/2/17
to [ext] Henning Schild, isar-...@googlegroups.com
Nice.

> 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..5ff12d3
> --- /dev/null
> +++ b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb
> @@ -0,0 +1,26 @@
> +# 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"
> +DEBIAN_MAINTAINER = "Your name here <y...@domain.com>"
> +
> +inherit dpkg-bin
> +

In contrast to OE/Yocto, we don't need to specify the files we want to
install later on here via SRC_URI? I'm not sure right now that we do not
lose some features when skipping this local fetching steps.

> +do_install() {
> + bbnote "Creating ${PN} binary"
> + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> + echo "echo Hello World! ${PN}_${PV}" >> ${WORKDIR}/${PN}
> +
> + bbnote "Putting ${PN} into overlay"

Nit: Is overlay the right term here?

> + install -v -d ${D}/usr/local/bin/
> + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
> +
> + bbnote "Now copy ${FILESDIR}/README to overlay"

In OE, FILESDIR is deprecated and has been removed already. Probably not
a good idea to introduce it here. FILESPATH is now the standard.

However:

"Usage of FILESPATH is discouraged, since it can make recipes harder
to bbappend. Instead FILESEXTRAPATHS should be used to extend the path."

> + install -v -d ${D}/usr/local/doc/
> + install -v -m 644 ${FILESDIR}/README ${D}/usr/local/doc/README-${P}
> +
> + bbnote "Now for a debian hook, see dpkg-deb"
> + install -v -m 755 ${FILESDIR}/postinst ${D}/DEBIAN/postinst

Maybe this could be automated - to avoid boilerplate logic - by defining
some DEBIAN_POSTINST var. dpkg-bin could evaluate that var and install
everything mentioned in it without requiring the user to do this here
manually.

> +}
>

Jan

--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

Claudius Heine

unread,
Aug 2, 2017, 2:55:21 AM8/2/17
to [ext] Jan Kiszka, [ext] Henning Schild, isar-...@googlegroups.com
The fetch step is still there, but it doesn't do anything because
SRC_URI is empty.

>
>> + install -v -d ${D}/usr/local/bin/
>> + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
>> +
>> + bbnote "Now copy ${FILESDIR}/README to overlay"
>
> In OE, FILESDIR is deprecated and has been removed already. Probably not
> a good idea to introduce it here. FILESPATH is now the standard.

The README should be put into the SRC_URI and then fetched via the
do_fetch step from the FILESDIR/FILESPATH into the WORKDIR.

> However:
>
> "Usage of FILESPATH is discouraged, since it can make recipes harder
> to bbappend. Instead FILESEXTRAPATHS should be used to extend the path."
>
>> + install -v -d ${D}/usr/local/doc/
>> + install -v -m 644 ${FILESDIR}/README ${D}/usr/local/doc/README-${P}
>> +
>> + bbnote "Now for a debian hook, see dpkg-deb"
>> + install -v -m 755 ${FILESDIR}/postinst ${D}/DEBIAN/postinst
>
> Maybe this could be automated - to avoid boilerplate logic - by defining
> some DEBIAN_POSTINST var. dpkg-bin could evaluate that var and install
> everything mentioned in it without requiring the user to do this here
> manually.

Here is another idea, simpler but then you can put the additional steps
easily into the recipe. Provide a variable to
"${D}/DEBIAN/[postinst,...]" so you can simply do something like this:

cat >${DEBIAN_POSTINST_FILE} <<EOF
#!/bin/sh

set -e

if ! getent group hello >/dev/null; then
addgroup --quiet --system hello
fi

if ! getent passwd hello >/dev/null; then
adduser --system --ingroup hello --home /var/lib/hello hello \
--gecos "My hello user"
fi

chown -R hello:hello /var/lib/hello
EOF

in the do_install step. This way you would have every step to setup the
package and rootfs neatly in a single file and if this becomes to long,
just add a file to the SRC_URI, fetch it to the workdir and copy/install
it to this path in the do_install step.

Cheers,
Claudius

Alexander Smirnov

unread,
Aug 2, 2017, 3:48:14 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
Hi, 

2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
Some security enhancing packages can cause our initrd to be not readable
by a normal user. So we need to copy with sudo.

Please be more explicit which packages, it'd be nice to have examples here in the commit message.
In general Isar follows the way to reduce usage of 'sudo' as much as possible, so every new entry should have good reasons.
 
Also regular cp would destroy ownership and other attributes of files,
possibly creating problems in the future.

Also an example is highly appreciated.
 

Signed-off-by: Henning Schild <henning...@siemens.com>
---
 meta/classes/ext4-img.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 65d4c11..6dc2039 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -21,16 +21,16 @@ do_ext4_image() {

     mkdir -p ${WORKDIR}/mnt
     sudo mount -o loop ${EXT4_IMAGE_FILE} ${WORKDIR}/mnt
-    sudo cp -r ${S}/* ${WORKDIR}/mnt
+    sudo cp -a ${S}/* ${WORKDIR}/mnt
     sudo umount ${WORKDIR}/mnt
     rm -r ${WORKDIR}/mnt

     if [ -n "${KERNEL_IMAGE}" ]; then
-        cp ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
+        sudo cp -a ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}

1. Ideally DEPLOY_DIR_IMAGE should not contain files with root permissions, the only multistrap filesystems should require them. Any spread of sudo significantly increases the probability to damage host system. Also I don't see the reason to keep kernel image undo supervisor permissions.
2. If KERNEL_IMAGE is symbolic link, 'cp -a' will copy symlink only.
 
     fi

     if [ -n "${INITRD_IMAGE}" ]; then
-        cp ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
+        sudo cp -a ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
     fi

I think that closed initrd is more private case than mainstream. Can we cosider possibility to implement this as optional security feature?
 
 }

--
2.13.0

--
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-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/5e98880f61dba959ada0c9bc8feca65b0a5760e5.1501582237.git.henning.schild%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Smirnov

unread,
Aug 2, 2017, 4:25:15 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
Signed-off-by: Henning Schild <henning...@siemens.com>
---
 .../doc/bitbake-user-manual/bitbake-user-manual-execution.xml  |  2 +-
 meta-isar/recipes-core/images/isar-image-base.bb               |  8 ++++----
 meta/classes/isar-base.bbclass                                 |  2 --
 meta/recipes-devtools/buildchroot/buildchroot.bb               | 10 +++++-----
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
index ec75893..b9aafd1 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
@@ -765,7 +765,7 @@
             the concept:
             <literallayout class='monospaced'>
      BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
-         SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
+         SSTATE_DIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \

Does this change have any reference in upstream? We are trying to keep bitbake tree unmodified to simplify migration to newer versions. If not, probably we can drop this modification and apply the rest of the patch.
 
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 4:34:04 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
This line is something new, should be intorduced in separate patch.
 
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 4:35:23 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
Merge with previous patch?
 
 # Setup our default hash policy
 BB_SIGNATURE_HANDLER ?= "noop"
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 5:24:30 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
Signed-off-by: Henning Schild <henning...@siemens.com>
---
 meta/classes/dpkg.bbclass | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 3d7aafb..1d0132b 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -10,9 +10,7 @@ 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}"
-

-do_fetch[dirs] = "${DL_DIR}"
+WORKDIR = "${BUILDCHROOT_DIR}/${PP}"

WORKDIR is no the only folder to fetch sources to. This folder represents workspace for all operation with folder, for example $WORKDIR/temp contails log files.

Initially Isar designed to follow OE/Yocto style where it's possible. Traditionally tmp/work folder contains all the packages workspaces with: build atifacts, patches, bitbake logs etc... So in general it looks like (roughly speaking):

  tmp/work/toolchain/package/*

This conception ideally works with cross-compilation, when you can compile packages out of the rootfs tree. Isar implements native compilation, so we can't build package within current workspace. So the decision was to keep workspace as it is but relocate build folder to buildchroot. The main benefit of this approach, that there is a single package workspace for bitbake metadata, while there may be many buildchroots (different Debian distros and machines/architectures).

In my opinion this change is another step away from OE/Yocto style.

@Henning: could you please describe the motivation of this change?
@All: any opinions are highly appreciated.
 

 # Fetch package from the source link
 python do_fetch() {
@@ -28,10 +26,10 @@ python do_fetch() {

 }

 addtask fetch before do_build
+do_fetch[dirs] = "${DL_DIR}"

-do_unpack[dirs] = "${BUILDROOT}"

 do_unpack[stamp-extra-info] = "${DISTRO}"
-S ?= "${BUILDROOT}"
+S ?= "${WORKDIR}"

S folder is used for unpacking sources. WORKDIR - is whole package workspace. S should not equal to WORKDIR, otherwise this will lead to mess between package sources and bitbake metadata. For example Also artifacts from FILESDIR are usually installed to the root of WORKDIR.

 

 # Unpack package and put it into working directory in buildchroot
 python do_unpack() {
@@ -39,16 +37,15 @@ python do_unpack() {
     if len(src_uri) == 0:
         return

-    rootdir = d.getVar('BUILDROOT', True)
-
     try:
         fetcher = bb.fetch2.Fetch(src_uri, d)
-        fetcher.unpack(rootdir)

+        fetcher.unpack(d.getVar('WORKDIR', True))
     except bb.fetch2.BBFetchException as e:
         raise bb.build.FuncFailed(e)

 }

 addtask unpack after do_fetch before do_build
+do_unpack[dirs] = "${WORKDIR}"

 do_build[stamp-extra-info] = "${DISTRO}"

@@ -62,7 +59,7 @@ do_install[stamp-extra-info] = "${MACHINE}"

 # Install package to dedicated deploy directory
 do_install() {
     install -d ${DEPLOY_DIR_DEB}
-    install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
+    install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
 }

 addtask do_install after do_build
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 5:47:10 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
From patch description it's not clear, why we need separate empty class here with *-image name.
 
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 5:54:47 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
build is bitbakes default target and queing tasks behind it is asking
for trouble

Could you please specify more details about this.
 
Introduce do_compile where we "build" the debian packages.

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

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 4228b0d..71c7122 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -13,19 +13,19 @@ PP = "/home/builder/${PN}"
 WORKDIR = "${BUILDCHROOT_DIR}/${PP}"
 S ?= "${WORKDIR}"

-do_build[stamp-extra-info] = "${DISTRO}"
-
 # Build package from sources using build script
-do_build() {
+do_compile() {
     sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
 }


Probably it makes sense to use more evident task name like do_dpkg-buildpackage or short version - do_buildpackage. 'dpkg-buildpackage' is exactly what is executed in this task, it's not only about compiling.
 
+addtask compile after do_unpack before do_install
+do_compile[stamp-extra-info] = "${DISTRO}"

 # Install package to dedicated deploy directory
 do_install() {
     install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
 }

-addtask install after do_build
+addtask install after do_compile before do_build
 do_install[dirs] = "${DEPLOY_DIR_DEB}"
 do_install[stamp-extra-info] = "${MACHINE}"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3e4877c..8db3352 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_build"
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 5:59:22 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
install will be used by later patches to actually populate debian
packages

Signed-off-by: Henning Schild <henning...@siemens.com>
---
 meta/classes/dpkg.bbclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 71c7122..2a1b85c 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -18,14 +18,14 @@ do_compile() {
     sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
 }

-addtask compile after do_unpack before do_install
+addtask compile after do_unpack before do_install_package
 do_compile[stamp-extra-info] = "${DISTRO}"

 # Install package to dedicated deploy directory
-do_install() {
+do_install_package() {
     install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
 }

Keeping in mind possible integartion to OE/Yocto, probably rename task to do_install_deb_package? Just to avoid possible user confusion with OE internals.

In general I like the idea to rename tasks in deb building chain to some unique names, to avoid mess with "classical" OE tasks.
 

-addtask install after do_compile before do_build
-do_install[dirs] = "${DEPLOY_DIR_DEB}"
-do_install[stamp-extra-info] = "${MACHINE}"
+addtask install_package after do_compile before do_build
+do_install_package[dirs] = "${DEPLOY_DIR_DEB}"
+do_install_package[stamp-extra-info] = "${MACHINE}"
--
2.13.0

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 6:02:11 AM8/2/17
to Henning Schild, isar-...@googlegroups.com
2017-08-01 13:17 GMT+03:00 Henning Schild <henning...@siemens.com>:
Signed-off-by: Henning Schild <henning...@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%)

What was your idea to do so? Why not 'dpkg-buildpackage.bbclass'?
 

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

--
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-...@googlegroups.com.

Alexander Smirnov

unread,
Aug 2, 2017, 6:11:49 AM8/2/17
to Claudius Heine, [ext] Henning Schild, isar-...@googlegroups.com, Dr . Johann Pfefferl
Hi colleagues,

from the patch description it's not clear what this patch stays for, seems that I'm out of you communcation loop. Could you please annotate the patches with more detailed description, at least with the following information:
 - Change proposal
 - Why this change is needed. It's not about arguments to push your change, it's more about your ideas and motivation. That's the most imporant information which is missed.
 - Change impact to Isar, who will be affected

--
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-...@googlegroups.com.

Henning Schild

unread,
Aug 2, 2017, 6:24:05 AM8/2/17
to Alexander Smirnov, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
Am Wed, 2 Aug 2017 13:11:47 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> Hi colleagues,
>
> from the patch description it's not clear what this patch stays for,
> seems that I'm out of you communcation loop. Could you please
> annotate the patches with more detailed description, at least with
> the following information:
> - Change proposal
> - Why this change is needed. It's not about arguments to push your
> change, it's more about your ideas and motivation. That's the most
> imporant information which is missed.
> - Change impact to Isar, who will be affected

Some of that information is in the cover letter and some other things
have been discussed in threads on the list. The example patch behind
it might make it clear. But you are right that information should go
into the patches.

Thanks for the review, i will repost the series with comments
addressed.

Henning
> > send an email to isar-users+...@googlegroups.com.

Claudius Heine

unread,
Aug 2, 2017, 7:11:46 AM8/2/17
to [ext] Henning Schild, isar-...@googlegroups.com, Dr . Johann Pfefferl


On 08/01/2017 12:17 PM, [ext] Henning Schild wrote:
> Signed-off-by: Henning Schild <henning...@siemens.com>
> ---
> meta/classes/dpkg-bin.bbclass | 47 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 47 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..1e96bd1
> --- /dev/null
> +++ b/meta/classes/dpkg-bin.bbclass
> @@ -0,0 +1,47 @@
> +inherit isar-base
> +
> +DEBIAN_DEPENDS ?= ""
> +DEBIAN_MAINTAINER ?= "FIXME Unknown maintainer"

I would rather prefer:

DEBIAN_MAINTAINER ?= "${MAINTAINER}"

MAINTAINER is a variable from openembedded.

Henning Schild

unread,
Aug 2, 2017, 7:16:59 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 10:48:13 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> Hi,
>
> 2017-08-01 13:17 GMT+03:00 Henning Schild
> <henning...@siemens.com>:
>
> > Some security enhancing packages can cause our initrd to be not
> > readable by a normal user. So we need to copy with sudo.
> >
>
> Please be more explicit which packages, it'd be nice to have examples
> here in the commit message.

It is one of there packages
IMAGE_PREINSTALL += "acl adduser apparmor apt attr babeltrace
base-files base-passwd bash bridge-utils busybox bzip2 cdebconf
console-setup coreutils cpio cron cryptsetup dash dbus debconf
debian-archive-keyring debianutils debootstrap dh-python dhcpcd5
diffutils dns-root-data dnsmasq dpkg dropbear e2fsprogs ebtables
elfutils ethtool expat file findutils fuse gcc-6 gdb gettext gnupg2
grep grub2 gzip hostname init-system-helpers initramfs-tools iproute2
iptables kbd keyutils kmod less libcap2 libgcrypt20
liblocale-gettext-perl libtasn1-6 libtext-charwidth-perl
libtext-iconv-perl libtext-wrapi18n-perl libxml2 linux-base lsb lsof
ltrace lvm2 mawk mime-support netbase netcat openssl os-prober p11-kit
parted patch pciutils perl procps python2.7 python3.5 rename rsync sed
sensible-utils setserial sgml-base shared-mime-info sqlite3
squashfs-tools strace systemd tar tcpdump trace-cmd tzdata ucf usbutils
util-linux vim wget xauth xdg-user-dirs xml-core xz-utils"

I did not investigate a lot which one, because it is a waste of time.

> In general Isar follows the way to reduce usage of 'sudo' as much as
> possible, so every new entry should have good reasons.

As Andreas reported last week we have libpseudo in the making and almost
ready, so the sudo problem will go away.

>
> > Also regular cp would destroy ownership and other attributes of
> > files, possibly creating problems in the future.
> >
>
> Also an example is highly appreciated.

cd /tmp
touch foobar
chgrp cron foobar
chown mail foobar
chmod 600 foobar
cp foobar bla
cp -a foobar bla2

If any debian package brings files not owned by root, plain cp will
destroy the ownership. I do not have a concrete example at hand.

Henning
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/5e98880f61dba959ada0c9bc8feca65b0a5760e5.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Claudius Heine

unread,
Aug 2, 2017, 7:17:28 AM8/2/17
to [ext] Henning Schild, isar-...@googlegroups.com, Dr . Johann Pfefferl
On 08/02/2017 01:11 PM, [ext] Claudius Heine wrote:
>
>
> On 08/01/2017 12:17 PM, [ext] Henning Schild wrote:
>> Signed-off-by: Henning Schild <henning...@siemens.com>
>> ---
>> meta/classes/dpkg-bin.bbclass | 47
>> +++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 47 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..1e96bd1
>> --- /dev/null
>> +++ b/meta/classes/dpkg-bin.bbclass
>> @@ -0,0 +1,47 @@
>> +inherit isar-base
>> +
>> +DEBIAN_DEPENDS ?= ""
>> +DEBIAN_MAINTAINER ?= "FIXME Unknown maintainer"
>
> I would rather prefer:
>
> DEBIAN_MAINTAINER ?= "${MAINTAINER}"
>
> MAINTAINER is a variable from openembedded.

Sorry I am mistaken. 'MAINTAINER' is for machine configurations.

Maybe RECIPE_MAINTAINER, but I am not sure now.

Henning Schild

unread,
Aug 2, 2017, 7:18:59 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 11:25:14 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
Thanks, that was a mistake and will be removed from the patch.

Henning
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/5ac96edda9115c2d1e7fd7b8c9aec563fbd07c05.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Henning Schild

unread,
Aug 2, 2017, 7:20:10 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 11:34:03 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
Thanks, that slipped in because the patches where developed on another
branch ... Will remove it.
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/87b84dd21dce51befba81e7c2214fd62d7817899.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Henning Schild

unread,
Aug 2, 2017, 7:21:38 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 11:35:22 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
One patch is changing structure and the other is chaning logic, i think
it should stay 2.

Henning

>
> > # Setup our default hash policy
> > BB_SIGNATURE_HANDLER ?= "noop"
> > --
> > 2.13.0
> >
> > --
> > 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+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/0450af95b41e6b31b881b961e21d424df34e10ba.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Claudius Heine

unread,
Aug 2, 2017, 7:26:08 AM8/2/17
to [ext] Henning Schild, isar-...@googlegroups.com, Dr . Johann Pfefferl
I took a look at how openembedded does it, they use the MAINTAINER variable:

https://github.com/openembedded/openembedded/blob/master/classes/package_deb.bbclass#L160

Henning Schild

unread,
Aug 2, 2017, 7:28:24 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 12:24:29 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
I did not understand all that of Isar when i applied that change. The
motivation was to use well-known names instead of inventing new ones. I
will drop that patch from the q.

Henning
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/048e88d5072fc038c8bd6207334e9967d5a29e0c.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Henning Schild

unread,
Aug 2, 2017, 7:32:07 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 12:47:09 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
I do not know what this line acutally does. It is there to keep the
semantics because this line always was part of images. As Claudio
suggested i will introduce a class isar-base with the fetcher and
unpacker, from that isar-package-base and isar-image-base could be
derived. Still not clear about the names, any suggestions?

Henning

>
> > diff --git a/meta/classes/isar-base.bbclass
> > b/meta/classes/isar-base. bbclass
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/ef97842f18e67eb7140790542c0d88a04490421f.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Henning Schild

unread,
Aug 2, 2017, 8:03:49 AM8/2/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 12:54:46 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> 2017-08-01 13:17 GMT+03:00 Henning Schild
> <henning...@siemens.com>:
>
> > build is bitbakes default target and queing tasks behind it is
> > asking for trouble
> >
>
> Could you please specify more details about this.

If you run "bitbake <component>" what actually happens is "bitbake
<component> -c build". So keeping all the tasks before a possibly empty
do_build makes sure that manual invokations of bitbake always run all
tasks. I am not sure whether [deptask] defaults to build as well.
I would see it like the "all" target of a Makefile.

But thinking about it the "cp *.dep ..." could be seen like "make
install" and could be allowed to happen after the default task.

It is a matter of taste i guess. How should we proceed? Put
do_install_package after do_build or keep it in front?

Henning

>
> > Introduce do_compile where we "build" the debian packages.
> >
> > Signed-off-by: Henning Schild <henning...@siemens.com>
> > ---
> > meta/classes/dpkg.bbclass | 8 ++++----
> > meta/classes/image.bbclass | 2 +-
> > 2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> > index 4228b0d..71c7122 100644
> > --- a/meta/classes/dpkg.bbclass
> > +++ b/meta/classes/dpkg.bbclass
> > @@ -13,19 +13,19 @@ PP = "/home/builder/${PN}"
> > WORKDIR = "${BUILDCHROOT_DIR}/${PP}"
> > S ?= "${WORKDIR}"
> >
> > -do_build[stamp-extra-info] = "${DISTRO}"
> > -
> > # Build package from sources using build script
> > -do_build() {
> > +do_compile() {
> > sudo chroot ${BUILDCHROOT_DIR} /build.sh ${PP}/${SRC_DIR}
> > }
> >
> >
> Probably it makes sense to use more evident task name like
> do_dpkg-buildpackage or short version - do_buildpackage.
> 'dpkg-buildpackage' is exactly what is executed in this task, it's
> not only about compiling.

I wanted to choose names that can be reused in other contexts, classes
later and stay close to gentoo/OE. But i do not care much about names
and will apply your suggestion.

Henning

>
> > +addtask compile after do_unpack before do_install
> > +do_compile[stamp-extra-info] = "${DISTRO}"
> >
> > # Install package to dedicated deploy directory
> > do_install() {
> > install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
> > }
> >
> > -addtask install after do_build
> > +addtask install after do_compile before do_build
> > do_install[dirs] = "${DEPLOY_DIR_DEB}"
> > do_install[stamp-extra-info] = "${MACHINE}"
> > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > index 3e4877c..8db3352 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_build"
> > --
> > 2.13.0
> >
> > --
> > 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+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/32e4ef6d06af30a76fdb645a4108f817301d3007.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Henning Schild

unread,
Aug 2, 2017, 8:29:46 AM8/2/17
to Alexander Smirnov, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
Am Wed, 2 Aug 2017 13:11:47 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> Hi colleagues,
>
> from the patch description it's not clear what this patch stays for,
> seems that I'm out of you communcation loop. Could you please
> annotate the patches with more detailed description, at least with
> the following information:
> - Change proposal

This patch introduces a way to turn any file-collection into a debian
package on the fly.
It further enables executing scripts in the rootfs for configuration
purposes.
It allows recipes to pull in debian packages as deps, allowing the
creation of "meta-packages" (empty packages which just carry deps)

> - Why this change is needed. It's not about arguments to push your
> change, it's more about your ideas and motivation. That's the most
> imporant information which is missed.

Customization of the image.
Configuration of the rootfs on a per package basis.
dep installation on a per package basis.
no IMAGE_PREINSTALL += in image.bb anymore, just IMAGE_INSTALL and the
packages take care of pulling their deps.

eventually replace the configure.sh with packages that
- replace fstab
- set rootpw ...


> - Change impact to Isar, who will be affected

Improve Isar and enable better customization using Debian-tooling, for
everyone ;).

Henning
> > send an email to isar-users+...@googlegroups.com.

Jan Kiszka

unread,
Aug 2, 2017, 8:50:11 AM8/2/17
to [ext] Henning Schild, Alexander Smirnov, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
Yeah! :D

Henning Schild

unread,
Aug 2, 2017, 9:38:31 AM8/2/17
to Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
Am Tue, 1 Aug 2017 17:10:00 +0200
schrieb Claudius Heine <claudius....@siemens.com>:
Ok, maybe we should require the author of the recipe to create a valid
conffiles instead of using magic guessing. But in that case they might
forget to mark the files as config.

Directories are not acceptable, are configs inside your container not a
feature? Say you change that file with vim and install
container-2.0.deb later. I would expect debian magic asking you to
merge the config, would that not be nice?

I guess the find just needs a -type .

Henning

Claudius Heine

unread,
Aug 2, 2017, 11:03:05 AM8/2/17
to Henning Schild, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
I would change it to something like this:

find ${D} -path '${D}/etc/*' -type f

Claudius
--
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: c...@denx.de

PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
Keyserver: hkp://pool.sks-keyservers.net
signature.asc

Henning Schild

unread,
Aug 3, 2017, 3:55:44 AM8/3/17
to Claudius Heine, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
Am Wed, 2 Aug 2017 17:03:02 +0200
schrieb Claudius Heine <c...@denx.de>:
You did not answer this question, i still do not understand why that is
problematic.

> > I guess the find just needs a -type .
>
> I would change it to something like this:
>
> find ${D} -path '${D}/etc/*' -type f

You might also want to catch /usr/local/etc/, /opt/etc/ ...

And it should use >> to write to the file, allowing people to add
custom files in do_install before find applies its guessing.

Henning

>
> Claudius

Claudius Heine

unread,
Aug 3, 2017, 6:39:45 AM8/3/17
to Henning Schild, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
When installing dpkg complained:

Unpacking container (0.0.1+isar) ...
dpkg: error processing archive /deb/container_0.0.1+isar_amd64.deb
(--install):
unable to create
'/var/lib/lxc/container/rootfs/etc/alternatives/README.dpkg-new' (while
processing './var/lib/lxc/container/rootfs/etc/alternatives/README'): No
such file or directory
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

>>> I guess the find just needs a -type .
>>
>> I would change it to something like this:
>>
>> find ${D} -path '${D}/etc/*' -type f
>
> You might also want to catch /usr/local/etc/, /opt/etc/ ...
>
> And it should use >> to write to the file, allowing people to add
> custom files in do_install before find applies its guessing.

Maybe also a flag to disable it.

Cheers,
Claudius


Henning Schild

unread,
Aug 3, 2017, 7:22:33 AM8/3/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 12:24:29 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> 2017-08-01 13:17 GMT+03:00 Henning Schild
> <henning...@siemens.com>:
>
> > Signed-off-by: Henning Schild <henning...@siemens.com>
> > ---
> > meta/classes/dpkg.bbclass | 15 ++++++---------
> > 1 file changed, 6 insertions(+), 9 deletions(-)
> >
> > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
> > index 3d7aafb..1d0132b 100644
> > --- a/meta/classes/dpkg.bbclass
> > +++ b/meta/classes/dpkg.bbclass
> > @@ -10,9 +10,7 @@ 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}"
> > -
> > -do_fetch[dirs] = "${DL_DIR}"
> > +WORKDIR = "${BUILDCHROOT_DIR}/${PP}"
> >

Initially i wanted to drop that patch from the q because i did not
really understand all of your points. But now i think i can not drop it
and we need to clarify. The next version i send will contain a
workaround where the unpacker will unpack to BUILDROOT, so we can
progress with merging the patches while we still talk concepts.

First off the motivation behind the change:
The fetcher and unpacker are required for all sorts of classes, my
queue introduces fetch/unpack in the new dpkg-bin package and Claudius
is already using the fetcher in other classes to solve different
issues. Each basic image and package class should provide
fetch/unpack, not just dpkg.


> WORKDIR is no the only folder to fetch sources to. This folder
> represents workspace for all operation with folder, for example
> $WORKDIR/temp contails log files.

The files are fetched to DL_DIR just like before.

> Initially Isar designed to follow OE/Yocto style where it's possible.
> Traditionally tmp/work folder contains all the packages workspaces
> with: build atifacts, patches, bitbake logs etc... So in general it
> looks like (roughly speaking):
>
> tmp/work/toolchain/package/*

Yes bitbake.conf says
WORKDIR = "${TMPDIR}/work/${PF}"
PF = "${PN}-${PV}-${PR}"

Looks like toolchain is missing in the default WORKDIR

> This conception ideally works with cross-compilation, when you can
> compile packages out of the rootfs tree. Isar implements native
> compilation, so we can't build package within current workspace. So
> the decision was to keep workspace as it is but relocate build folder
> to buildchroot. The main benefit of this approach, that there is a
> single package workspace for bitbake metadata, while there may be
> many buildchroots (different Debian distros and
> machines/architectures).

I guess i understand now. In that case i would suggest to have

MY_WORKDIR = WORKDIR/ARCH/DISTRO/... and keep the multiple versions
still under the original WORKDIR. Because as the name suggests, that is
where work should be done.

> In my opinion this change is another step away from OE/Yocto style.

I do not know OE too much but it is supposed to be a clone of gentoo.
And in gentoo you do all your work in WORKDIR and do not break out.

Henning
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/048e88d5072fc038c8bd6207334e9967d5a29e0c.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Henning Schild

unread,
Aug 3, 2017, 7:54:05 AM8/3/17
to isar-...@googlegroups.com, Alexander Smirnov, Henning Schild
Signed-off-by: Henning Schild <henning...@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 e334dda..36e047a 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -27,8 +27,8 @@ do_install[stamp-extra-info] = "${MACHINE}"

# Install package to dedicated deploy directory
do_install() {
- install -d ${DEPLOY_DIR_DEB}
install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
}

addtask do_install after do_build
+do_install[dirs] = "${DEPLOY_DIR_DEB}"
--
2.13.0

Henning Schild

unread,
Aug 3, 2017, 7:54:05 AM8/3/17
to isar-...@googlegroups.com, Alexander Smirnov, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta-isar/recipes-core/images/isar-image-base.bb | 8 ++++----
meta/classes/isar-base.bbclass | 2 --
meta/recipes-devtools/buildchroot/buildchroot.bb | 10 +++++-----
3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 337c329..0810de0 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -27,10 +27,10 @@ do_rootfs() {
install -d -m 755 ${WORKDIR}/hooks_multistrap

# Copy config file
- install -m 644 ${THISDIR}/files/multistrap.conf.in ${WORKDIR}/multistrap.conf
- install -m 755 ${THISDIR}/files/${DISTRO_CONFIG_SCRIPT} ${WORKDIR}/configscript.sh
- install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
- install -m 755 ${THISDIR}/files/download_dev-random ${WORKDIR}/hooks_multistrap/
+ install -m 644 ${FILESDIR}/multistrap.conf.in ${WORKDIR}/multistrap.conf
+ install -m 755 ${FILESDIR}/${DISTRO_CONFIG_SCRIPT} ${WORKDIR}/configscript.sh
+ install -m 755 ${FILESDIR}/setup.sh ${WORKDIR}
+ install -m 755 ${FILESDIR}/download_dev-random ${WORKDIR}/hooks_multistrap/

# Adjust multistrap config
sed -i 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|' ${WORKDIR}/multistrap.conf
diff --git a/meta/classes/isar-base.bbclass b/meta/classes/isar-base.bbclass
index efd4223..d860937 100644
--- a/meta/classes/isar-base.bbclass
+++ b/meta/classes/isar-base.bbclass
@@ -19,6 +19,4 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

-THISDIR = "${@os.path.dirname(d.getVar('FILE', True))}"
-
do_build[nostamp] = "0"
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index ba1bc66..f471f5e 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -29,10 +29,10 @@ do_build() {
install -d -m 755 ${WORKDIR}/hooks_multistrap

# Copy config files
- install -m 644 ${THISDIR}/files/multistrap.conf.in ${WORKDIR}/multistrap.conf
- install -m 755 ${THISDIR}/files/configscript.sh ${WORKDIR}
- install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
- install -m 755 ${THISDIR}/files/download_dev-random ${WORKDIR}/hooks_multistrap/
+ install -m 644 ${FILESDIR}/multistrap.conf.in ${WORKDIR}/multistrap.conf

Henning Schild

unread,
Aug 3, 2017, 7:54:05 AM8/3/17
to isar-...@googlegroups.com, Alexander Smirnov, Henning Schild
Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/conf/isar-bitbake.conf | 9 ---------
1 file changed, 9 deletions(-)

diff --git a/meta/conf/isar-bitbake.conf b/meta/conf/isar-bitbake.conf
index 7469ea7..ce35a22 100644
--- a/meta/conf/isar-bitbake.conf
+++ b/meta/conf/isar-bitbake.conf
@@ -21,16 +21,7 @@

DEPLOY_DIR_DEB = "${TMPDIR}/deploy/deb/${MACHINE}"
SSTATE_DIR ?= "${TMPDIR}/sstate-cache"
-MKTEMPCMD = "mktemp -q ${TMPBASE}"
-MKTEMPDIRCMD = "mktemp -d -q ${TMPBASE}"
-RESUMECOMMAND = ""
-RESUMECOMMAND_wget = "/usr/bin/env wget -c -t 5 --passive-ftp -P ${DL_DIR} ${URI}"
-STAMPS_DIR ?= "${TMPDIR}/stamps"
-UPDATECOMMAND = ""
-UPDATECOMMAND_cvs = "/usr/bin/env cvs -d${CVSROOT} update ${CVSCOOPTS}"
-UPDATECOMMAND_svn = "/usr/bin/env svn update ${SVNCOOPTS}"
BUILDCHROOT_DIR = "${TOPDIR}/tmp/work/buildchroot/${DISTRO}/rootfs"
-CACHE = "${TMPDIR}/cache"

Henning Schild

unread,
Aug 3, 2017, 7:54:06 AM8/3/17
to isar-...@googlegroups.com, Alexander Smirnov, Henning Schild
That way we can use the fetchers in images and future classes/recipes
without having to "inherit dpdk".

Signed-off-by: Henning Schild <henning...@siemens.com>
---
meta/classes/dpkg.bbclass | 38 ++------------------------------------
meta/classes/isar-base.bbclass | 33 +++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 3d7aafb..e334dda 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -11,44 +11,10 @@ do_unpack[deptask] = "do_build"
# recipe name as identifier
PP = "/home/builder/${PN}"
BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
-
-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] = "${BUILDROOT}"
-do_unpack[stamp-extra-info] = "${DISTRO}"
S ?= "${BUILDROOT}"

-# Unpack package and put it into working directory in buildchroot
-python do_unpack() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- rootdir = d.getVar('BUILDROOT', 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
+# make the unpacker extract to BUILDROOT
+WORKDIR_task-unpack = "${BUILDROOT}"

do_build[stamp-extra-info] = "${DISTRO}"

diff --git a/meta/classes/isar-base.bbclass b/meta/classes/isar-base.bbclass
index d860937..ec4272f 100644
--- a/meta/classes/isar-base.bbclass
+++ b/meta/classes/isar-base.bbclass
@@ -20,3 +20,36 @@
# OTHER DEALINGS IN THE SOFTWARE.

do_build[nostamp] = "0"
+
+# 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_fetch[dirs] = "${DL_DIR}"
+
+# Unpack package and put it into working directory in buildchroot
+python do_unpack() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.unpack(d.getVar('WORKDIR', True))
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+addtask unpack after do_fetch before do_build
+do_unpack[dirs] = "${WORKDIR}"

Henning Schild

unread,
Aug 3, 2017, 10:15:45 AM8/3/17
to Claudius Heine, Claudius Heine, isar-...@googlegroups.com, Dr . Johann Pfefferl
Am Thu, 3 Aug 2017 12:39:44 +0200
I am not sure what that means. The updated version will allow you to
overwrite the automatic configfiles generation. And disable it that
way. I would not want to take it out because it seems to have value,
but the heuristic should probably be tuned later.

Henning

Henning Schild

unread,
Aug 3, 2017, 11:35:35 AM8/3/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 13:02:10 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> 2017-08-01 13:17 GMT+03:00 Henning Schild
> <henning...@siemens.com>:
>
> > Signed-off-by: Henning Schild <henning...@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%)
> >
>
> What was your idea to do so? Why not 'dpkg-buildpackage.bbclass'?

The idea is to have source and binary packages at the end. How they are
constructed should not be in the name of the class. That way you could
switch the tooling in the future.

Maybe we will never switch the tools but the names should be used to
abstract from implementation.

Henning

> >
> > 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
> >
> > --
> > 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+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/f3b8fd43828bf124f4125fb0ba4853cb8a795571.1501582237.git.
> > henning.schild%40siemens.com. For more options, visit
> > https://groups.google.com/d/optout.

Jan Kiszka

unread,
Aug 3, 2017, 11:45:26 AM8/3/17
to [ext] Henning Schild, Alexander Smirnov, isar-...@googlegroups.com
On 2017-08-03 17:37, [ext] Henning Schild wrote:
> Am Wed, 2 Aug 2017 13:02:10 +0300
> schrieb Alexander Smirnov <alex.blues...@gmail.com>:
>
>> 2017-08-01 13:17 GMT+03:00 Henning Schild
>> <henning...@siemens.com>:
>>
>>> Signed-off-by: Henning Schild <henning...@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%)
>>>
>>
>> What was your idea to do so? Why not 'dpkg-buildpackage.bbclass'?
>
> The idea is to have source and binary packages at the end. How they are
> constructed should not be in the name of the class. That way you could
> switch the tooling in the future.
>
> Maybe we will never switch the tools but the names should be used to
> abstract from implementation.

Sounds reasonable to me.

Henning Schild

unread,
Aug 3, 2017, 2:46:56 PM8/3/17
to Jan Kiszka, isar-...@googlegroups.com
Am Wed, 2 Aug 2017 08:33:33 +0200
schrieb Jan Kiszka <jan.k...@siemens.com>:

> On 2017-08-01 12:17, [ext] Henning Schild wrote:
> > Signed-off-by: Henning Schild <henning...@siemens.com>
> > ---
> > meta-isar/recipes-app/hello-bin/files/README | 1 +
> > meta-isar/recipes-app/hello-bin/files/postinst | 14 +++++++++++++
> > meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 26
> > ++++++++++++++++++++++++ 3 files changed, 41 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..2a9eab6
> > --- /dev/null
> > +++ b/meta-isar/recipes-app/hello-bin/files/postinst
> > @@ -0,0 +1,14 @@
> > +#!/bin/sh
> > +
> > +set -e
> > +
> > +if ! getent group hello >/dev/null; then
> > + addgroup --quiet --system hello
> > +fi
> > +
> > +if ! getent passwd hello >/dev/null; then
> > + adduser --system --ingroup hello --home /var/lib/hello
> > hello \
> > + --gecos "My hello user"
> > +fi
> > +
> > +chown -R hello:hello /var/lib/hello
>
> Nice.
>
> > 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..5ff12d3
> > --- /dev/null
> > +++ b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb
> > @@ -0,0 +1,26 @@
> > +# 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"
> > +DEBIAN_MAINTAINER = "Your name here <y...@domain.com>"
> > +
> > +inherit dpkg-bin
> > +
>
> In contrast to OE/Yocto, we don't need to specify the files we want to
> install later on here via SRC_URI? I'm not sure right now that we do
> not lose some features when skipping this local fetching steps.

We lose caching cleaning and dep-tracking, you are right. Changed that.

> > +do_install() {
> > + bbnote "Creating ${PN} binary"
> > + echo "#!/bin/sh" > ${WORKDIR}/${PN}
> > + echo "echo Hello World! ${PN}_${PV}" >> ${WORKDIR}/${PN}
> > +
> > + bbnote "Putting ${PN} into overlay"
>
> Nit: Is overlay the right term here?

Corrected!

> > + install -v -d ${D}/usr/local/bin/
> > + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN}
> > +
> > + bbnote "Now copy ${FILESDIR}/README to overlay"
>
> In OE, FILESDIR is deprecated and has been removed already. Probably
> not a good idea to introduce it here. FILESPATH is now the standard.
>
> However:
>
> "Usage of FILESPATH is discouraged, since it can make recipes harder
> to bbappend. Instead FILESEXTRAPATHS should be used to extend the
> path."

All that is done by SRC_URI now.

> > + install -v -d ${D}/usr/local/doc/
> > + install -v -m 644 ${FILESDIR}/README
> > ${D}/usr/local/doc/README-${P} +
> > + bbnote "Now for a debian hook, see dpkg-deb"
> > + install -v -m 755 ${FILESDIR}/postinst
> > ${D}/DEBIAN/postinst
>
> Maybe this could be automated - to avoid boilerplate logic - by
> defining some DEBIAN_POSTINST var. dpkg-bin could evaluate that var
> and install everything mentioned in it without requiring the user to
> do this here manually.

Sure, but now we are talking improvements on something that i would
like to see getting merged in a first version. So lets hold that for
later.

Henning

> > +}
> >
>
> Jan
>

Alexander Smirnov

unread,
Aug 7, 2017, 3:30:49 PM8/7/17
to Henning Schild, isar-...@googlegroups.com
As I already mentioned, there is a build problem, need further investigation about python version.

Alexander Smirnov

unread,
Aug 7, 2017, 3:37:45 PM8/7/17
to Henning Schild, isar-...@googlegroups.com
2017-08-03 14:55 GMT+03:00 Henning Schild <henning...@siemens.com>:
Merged to asmirnov/next 

Alexander Smirnov

unread,
Aug 7, 2017, 3:40:56 PM8/7/17
to Henning Schild, isar-...@googlegroups.com
2017-08-03 14:55 GMT+03:00 Henning Schild <henning...@siemens.com>:
--
2.13.0

--
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-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


This patch doesn't really do the things mentioned in commit message, because you change the variables, for example: do_unpack[dirs] = "${WORKDIR}", so it's not only about moving, but also some reworking which is unclear for me.

I've partially apply it (only fetch) to asmirnov/next

Alexander Smirnov

unread,
Aug 7, 2017, 3:41:31 PM8/7/17
to Henning Schild, isar-...@googlegroups.com
2017-08-03 14:55 GMT+03:00 Henning Schild <henning...@siemens.com>:

Applied to asmirnov/next

Henning Schild

unread,
Aug 8, 2017, 3:58:30 AM8/8/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Mon, 7 Aug 2017 22:40:55 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
This is where we force the unpacker to use BUILDROOT instead of
WORKDIR. We did not finish the discussion on why we need to break out
of WORKDIR in the first place.

Henning
> > send an email to isar-users+...@googlegroups.com.
> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/7c03d914f33ef0563cb7af2951f56e8cd5fd20bc.1501760818.git.
> > henning.schild%40siemens.com. For more options, visit

Henning Schild

unread,
Aug 8, 2017, 4:00:26 AM8/8/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Mon, 7 Aug 2017 22:30:48 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:
I do not remember that remark and do not see how it influences the
validity of this patch. Does the patch introduce the build-problem?

Henning

Alexander Smirnov

unread,
Aug 8, 2017, 5:30:47 AM8/8/17
to Henning Schild, isar-...@googlegroups.com
2017-08-08 11:00 GMT+03:00 Henning Schild <henning...@siemens.com>:
Am Mon, 7 Aug 2017 22:40:55 +0300
schrieb Alexander Smirnov <alex.bluesman.smirnov@gmail.com>:

I only mean, that in patch you mention "move", by move I understand "copy-paste". This this should be done in two steps: 1. modify, 2. move.

Alex 

> > To post to this group, send email to isar-...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/
> > msgid/isar-users/7c03d914f33ef0563cb7af2951f56e8cd5fd20bc.1501760818.git.

Henning Schild

unread,
Aug 8, 2017, 7:59:54 AM8/8/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Tue, 8 Aug 2017 12:30:46 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> 2017-08-08 11:00 GMT+03:00 Henning Schild
> <henning...@siemens.com>:
>
> > Am Mon, 7 Aug 2017 22:40:55 +0300
> > schrieb Alexander Smirnov <alex.blues...@gmail.com>:
Ok. If you want me to turn it into two commits i will do so. But please
tell me what to do.
Especially since i would not know which branch to rebase on now that
you even split my patches.

Henning
> > > > it, send an email to isar-users+...@googlegroups.com.

Alexander Smirnov

unread,
Aug 11, 2017, 5:15:20 AM8/11/17
to Henning Schild, isar-...@googlegroups.com
Hello,

here is brief summary:

Applied with minor changes:
 - meta: isar-base: remove unused function
 - meta: conf: use bitbake.conf from bitbake and apply local changes
 - meta: conf: clean up local bitbake config
 - classes: move fetch and unpack into isar-base (only unpack)
 - meta: dpdk use [dirs] directive instead of mkdir
 - meta: dpkg: reorder and rename do_install to install in addtask
 - package_write_deb: change access rights on .debs

Dropped:
 - meta: classes: use base.bbclass from bitbake
 - meta: dpkg rename install to package_write_deb

Need further investigation:
 - remove redundant variable THISDIR
 - 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

Alex

Henning Schild

unread,
Aug 11, 2017, 6:33:18 AM8/11/17
to Alexander Smirnov, isar-...@googlegroups.com
Am Fri, 11 Aug 2017 12:15:19 +0300
schrieb Alexander Smirnov <alex.blues...@gmail.com>:

> Hello,
>
> here is brief summary:
>
> Applied with minor changes:
> - meta: isar-base: remove unused function
> - meta: conf: use bitbake.conf from bitbake and apply local changes
> - meta: conf: clean up local bitbake config
> - classes: move fetch and unpack into isar-base (only unpack)

Nobody needs to unpack if they can not fetch and the other way around,
please drop or remove me as author.

> - meta: dpdk use [dirs] directive instead of mkdir
> - meta: dpkg: reorder and rename do_install to install in addtask
> - package_write_deb: change access rights on .debs
>
> Dropped:
> - meta: classes: use base.bbclass from bitbake
> - meta: dpkg rename install to package_write_deb
>
> Need further investigation:
> - remove redundant variable THISDIR
> - meta: classes: move package_write_deb to new class isar-base-dpkg
> - meta: classes: rename dpkg to dpkg-src
> - meta: add dpkg-bin class

This is the one that matters!

Henning

Baurzhan Ismagulov

unread,
Aug 21, 2017, 3:56:01 PM8/21/17
to isar-...@googlegroups.com
On Thu, Aug 03, 2017 at 01:55:54PM +0200, Henning Schild wrote:
> Signed-off-by: Henning Schild <henning...@siemens.com>

Applied with comment amendments, thanks.

Your title was also correct; still, Alex has dropped "local" to avoid potential
confusion with local.conf.

With kind regards,
Baurzhan.

Baurzhan Ismagulov

unread,
Aug 21, 2017, 4:27:47 PM8/21/17
to isar-...@googlegroups.com
On Tue, Aug 08, 2017 at 02:01:50PM +0200, Henning Schild wrote:
> Ok. If you want me to turn it into two commits i will do so. But please
> tell me what to do.

Applied partially, thanks.

The baseline for rebase is master. It will eventually include asmirnov/next, so
right now, you could start rebasing on that.


> Especially since i would not know which branch to rebase on now that
> you even split my patches.

This allows us to take low-hanging fruits and avoid reviewing the stuff again,
especially since this series consists of unrelated bits -- please avoid in the
future. A binary all-or-nothing approach would block all patches. If you prefer
that way, I'd suggest to talk offline so that we can understand the reasons for
that.


With kind regards,
Baurzhan.

Baurzhan Ismagulov

unread,
Aug 21, 2017, 4:33:38 PM8/21/17
to isar-...@googlegroups.com
On Thu, Aug 03, 2017 at 01:55:56PM +0200, Henning Schild wrote:
> Signed-off-by: Henning Schild <henning...@siemens.com>

Applied with comment amendments, thanks.

With kind regards,
Baurzhan.

Henning Schild

unread,
Aug 22, 2017, 4:18:59 AM8/22/17
to Baurzhan Ismagulov, isar-...@googlegroups.com
Am Mon, 21 Aug 2017 22:27:38 +0200
schrieb Baurzhan Ismagulov <i...@radix50.net>:

> On Tue, Aug 08, 2017 at 02:01:50PM +0200, Henning Schild wrote:
> > Ok. If you want me to turn it into two commits i will do so. But
> > please tell me what to do.
>
> Applied partially, thanks.

Please revert or remove me as author, thanks.

Henning

Baurzhan Ismagulov

unread,
Aug 22, 2017, 6:18:47 AM8/22/17
to isar-...@googlegroups.com
On Tue, Aug 22, 2017 at 10:19:09AM +0200, Henning Schild wrote:
> > On Tue, Aug 08, 2017 at 02:01:50PM +0200, Henning Schild wrote:
> > > Ok. If you want me to turn it into two commits i will do so. But
> > > please tell me what to do.
> >
> > Applied partially, thanks.
>
> Please revert or remove me as author, thanks.

Hmm, you had agreed to splitting it into two parts... Reverted.

With kind regards,
Baurzhan.

Henning Schild

unread,
Aug 22, 2017, 6:43:53 AM8/22/17
to Baurzhan Ismagulov, isar-...@googlegroups.com
Am Tue, 22 Aug 2017 12:18:44 +0200
schrieb Baurzhan Ismagulov <i...@radix50.net>:
The split i agreed to was a totally different one.

Henning

> With kind regards,
> Baurzhan.
>

Henning Schild

unread,
Oct 19, 2017, 2:04:53 PM10/19/17
to isar-...@googlegroups.com, Alexander Smirnov, Baurzhan Ismagulov
I just wasted another hour on that guy ... again. Now i found an easy
way to reproduce the issue

on amd64
IMAGE_PREINSTALL += "dropbear"

Probably something in the package hooks, update-initramfs ... But who
cares, that could have been fixed months ago.

Since my original patch touches code that Alex is currently moving
around i hope he will fix the issue that has been ignored for too long.

Henning

On Tue, 1 Aug 2017 12:17:19 +0200
Henning Schild <henning...@siemens.com> wrote:

> Some security enhancing packages can cause our initrd to be not
> readable by a normal user. So we need to copy with sudo.
> Also regular cp would destroy ownership and other attributes of files,
> possibly creating problems in the future.
>
> Signed-off-by: Henning Schild <henning...@siemens.com>
> ---
> meta/classes/ext4-img.bbclass | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/ext4-img.bbclass
> b/meta/classes/ext4-img.bbclass index 65d4c11..6dc2039 100644
> --- a/meta/classes/ext4-img.bbclass
> +++ b/meta/classes/ext4-img.bbclass
> @@ -21,16 +21,16 @@ do_ext4_image() {
>
> mkdir -p ${WORKDIR}/mnt
> sudo mount -o loop ${EXT4_IMAGE_FILE} ${WORKDIR}/mnt
> - sudo cp -r ${S}/* ${WORKDIR}/mnt
> + sudo cp -a ${S}/* ${WORKDIR}/mnt
> sudo umount ${WORKDIR}/mnt
> rm -r ${WORKDIR}/mnt
>
> if [ -n "${KERNEL_IMAGE}" ]; then
> - cp ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
> + sudo cp -a ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
> fi
>
> if [ -n "${INITRD_IMAGE}" ]; then
> - cp ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
> + sudo cp -a ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
> fi
> }
>

Alexander Smirnov

unread,
Oct 19, 2017, 3:41:33 PM10/19/17
to Henning Schild, isar-...@googlegroups.com
On 10/19/2017 09:04 PM, Henning Schild wrote:
> I just wasted another hour on that guy ... again. Now i found an easy
> way to reproduce the issue
>
> on amd64
> IMAGE_PREINSTALL += "dropbear"
>
> Probably something in the package hooks, update-initramfs ... But who
> cares, that could have been fixed months ago.

Which file this does this problem affect: kernel or initrd?

> > Since my original patch touches code that Alex is currently moving

The information you've provided above is very important, so I'd like to
apply this as separate patch with respective commit message. Could do
this tomorrow's morning.

> around i hope he will fix the issue that has been ignored for too long.
>

According to the last our agreement in Aug, each issue should have
usecase, so you've provided it only now.

Alex
--
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
Reply all
Reply to author
Forward
0 new messages