From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6460145511220379648 X-Received: by 10.223.166.105 with SMTP id k96mr289629wrc.2.1504174880594; Thu, 31 Aug 2017 03:21:20 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.19.133 with SMTP id 127ls1240699wmt.23.gmail; Thu, 31 Aug 2017 03:21:20 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7/jvfPM9zSrmmpge3IhRuSy9PiD5MAKMi3Bz6V8E0kwmPHXA0FBRUzUOu8YoPNiCOr0QSD X-Received: by 10.28.0.212 with SMTP id 203mr461557wma.24.1504174880292; Thu, 31 Aug 2017 03:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504174880; cv=none; d=google.com; s=arc-20160816; b=avn5tEzmT3V5lULy956UiuIDb98Q6q9ruuIb38DL27/pc8DFMmpXsAnbowS0IVcfgQ 6SkBJ6WLYMHKaFcBL8jbF2C46ykzTrYCpRckRn+vJIbuubjPbJGimTXAc+GFanO7Pvqm QdBJEuqLVBhIii7tJwo2dPnQXKZmO9owPaB6+MXcLLK3Ky/O9i6hxk/uVLN3J9I/Bemj Crzk7xF4FJoDQ4eHw6ml00JwKV23hrzTHX93VP670Mi+qJoXp+qsvtsFxVM7lf8TPbpY 8lqGYoYfbrE0+afd0urrN+6Ty4C/saNlmLenquvA53muYOZvnOIoaHGGtPcFhxXQyUUL gZ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=5OIiuReJ2Ht7YXd/JO6McjszzVawB+FOaQ23Ep7iE4s=; b=rqfZpO5UM+ReRAyUuUthtZHSrF0X74LpNbMR90WiRUlowv+gdQ7k625CKqO946OVSe ZSt9MibM4PO8Cf3B/SCuvyfdzo/GBm82FTLUcEUlK4oF7gUUUD9lAl91tX4uGVVWuqo1 dDEorjFygQq68kdDJ2hxWD6BWO/8xsNFEdYmJjktsKjOaFEGSQa33PnxMml6N/mm1DLZ oYxXk9D3iKSrJIMK+LyXLyL7zClWLLt0s0mLkMbXEJJS57ln5vOMf2nyMmNJvrVP9kiR I7+1xdgJdV3FdKCP34VJIjwuj1/TkwCK9KwgnG60OHea27P9syit8L706zusMAwmo2YS /I+w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id v7si161397wmb.3.2017.08.31.03.21.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Aug 2017 03:21:20 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id v7VALJvs023232 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Aug 2017 12:21:19 +0200 Received: from md1em3qc ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v7VALIod020658; Thu, 31 Aug 2017 12:21:18 +0200 Date: Thu, 31 Aug 2017 12:21:22 +0200 From: Henning Schild To: Claudius Heine Cc: , Alexander Smirnov , Christian Storm , Claudius Heine Subject: Re: [PATCH 5/6] meta/dpkg: add dpkg-custom class Message-ID: <20170831122122.6404e7cc@md1em3qc> In-Reply-To: References: <356cb2c3f7dfead49d75580fdff10dfa8c41232e.1504119538.git.henning.schild@siemens.com> <75fe7dd9-7cf0-9f10-7060-64b69fa38194@siemens.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: k1DSSl4kTJ/4 Am Thu, 31 Aug 2017 10:53:10 +0200 schrieb Claudius Heine : > Hi agani, was a bit to fast sending the mail before, > > On 08/31/2017 10:38 AM, [ext] Claudius Heine wrote: > > Hi > > > > On 08/30/2017 09:03 PM, [ext] Henning Schild wrote: > >> Issues: > >> 1. full customizations of the images is hard to impossible to > >> realize in a layer without touching Isar > >> 1.1. there is no easy way to just copy a file into the image > >> 1.2. configuration (passwords, groups, cfg-files changes) can not > >> be done in a layer, there is no way too hook into multistrap or the > >> configure-script > >> > >> Change: > >> Introduce a class that lets users create custom debian packages on > >> the fly, without having to create a /debian directory and actually > >> building. That allows you to pull in debian-dependencies, you > >> could have a package that has no content and is just there to > >> install what you need for a feature of your product. > >> Using package hooks (preinst, postinst ..) you can configure > >> pretty much all you want when installing the package. > >> The package can contain actual payload as well, basically any > >> files that come from "somewhere else". Say binary data like > >> wallpapers, sound files or application binaries. > >> > >> Impact: > >> This patch addresses the metioned issue in a way that uses debian > >> mechanism. All the customizations will enjoy features like > >> - collission protection (multiple packages providing the same file) > >> - config file protection > >> - versioning and the ability to deploy your changes in an > >> updateable way > >> > >> This patch introduces a major new feature to Isar. > >> > >> This class introduces a new class for building debian packages on > >> the fly. They can basically contain anything from random sources, > >> where building happens outside of Isar. It also allows to create > >> meta-packages that contain nothing but pull in dependencies, once > >> all our packets come in via multistrap that will come in handy. > >> For rootfs configuration you would use post- and pre- scripts just > >> like regular debian packages do. > >> > >> Signed-off-by: Henning Schild > >> --- > >> meta/classes/dpkg-custom.bbclass | 57 > >> ++++++++++++++++++++++++++++++++++++++++ > >> 1 file changed, 57 insertions(+) > >> create mode 100644 meta/classes/dpkg-custom.bbclass > > > > Also not a big fan of this name. 'custom' is a bit too unspecific > > for what it does. I get that your idea that those packages are > > *custom* made, but at the same time, so are all the packages that > > are directly created within isar. > > > > I liked the old 'dpkg-bin' name more, but maybe even this is a bit > > to unspecific. How about 'dpkg-plain'? That describes better that > > those packages are very simple, created impromptu without much to > > it, IMO. > > > > Cheers, > > Claudius > > > >> > >> diff --git a/meta/classes/dpkg-custom.bbclass > >> b/meta/classes/dpkg-custom.bbclass > >> new file mode 100644 > >> index 0000000..e4e743f > >> --- /dev/null > >> +++ b/meta/classes/dpkg-custom.bbclass > >> @@ -0,0 +1,57 @@ > >> +# This software is a part of ISAR. > >> +# Copyright (C) 2017 Siemens AG > >> + > >> +inherit dpkg > >> + > >> +DEBIAN_DEPENDS ?= "" > >> +MAINTAINER ?= "FIXME Unknown maintainer" > >> + > >> +D = "${WORKDIR}/image/" > >> + > >> +# Populate folder that will be picked up as package > >> +# TODO this should be called 'do_install' > >> +do_populate_package() { > >> + bbnote "Put your files for this package in ${D}" > >> +} > >> + > >> +addtask populate_package after do_unpack before > >> do_deb_package_prepare + > >> +# so we can put hooks etc. in there already > >> +do_populate_package[dirs] = "${D}/DEBIAN" > >> + > >> +do_deb_package_prepare() { > > OE has a slightly different naming scheme for these tasks. They would > call them 'do_package_deb_prepare' or similar [1]. Might cause > confusion if we have different naming schemes between those two > projects. I have given up the naming discussions for now, especially comparison to OE. These discsussions have held up important features for way too long. I will probably accept any name chosen by others, unless it contains implementation details and other things that do not belong there. > >> + cat<<-__EOF__ > ${D}/DEBIAN/control > >> + Package: ${PN} > >> + Architecture: `dpkg --print-architecture` > > Are you sure that this works when cross building? Wouldn't dpkg print > the architecture of the host system instead of the target system? I > think this kind of information has to come from the machine variables. Yes, will look into that. Henning > Cheers, > Claudius > > >> + Section: misc > >> + Priority: optional > >> + Maintainer: ${MAINTAINER} > >> + Depends: `echo ${DEBIAN_DEPENDS} | tr '[:blank:]' ','` > >> + Version: ${PV}+isar > >> + Description: ${DESCRIPTION} > >> + __EOF__ > >> + for t in pre post > >> + do > >> + for a in inst rm > >> + do > >> + chmod -f +x ${D}/DEBIAN/${t}${a} || true > >> + done > >> + done > >> +} > >> + > >> +addtask deb_package_prepare after do_populate_package before > >> do_deb_package_conffiles > >> + > >> +do_deb_package_conffiles() { > >> + CONFFILES=${D}/DEBIAN/conffiles > >> + find ${D} -type f -path '*/etc/*' | sed -e 's|^${D}|/|' >> > >> $CONFFILES > >> + test -s $CONFFILES || rm $CONFFILES > >> +} > >> + > >> +addtask deb_package_conffiles after do_deb_package_prepare before > >> do_deb_package > >> + > >> +do_deb_package() { > >> + sudo chown -R root:root ${D}/DEBIAN/ > >> + sudo dpkg-deb --build ${D} ${WORKDIR} > >> +} > >> + > >> +addtask deb_package after do_deb_package_conffiles before > >> do_install > > > > [1] > http://git.openembedded.org/openembedded-core/tree/meta/classes/package_deb.bbclass#n43 >