From: Jan Kiszka <jan.kiszka@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH v2 1/2] meta-isar: Add simple example for injecting prebuilt deb packages
Date: Mon, 15 Feb 2021 10:25:26 +0100 [thread overview]
Message-ID: <22c70697-d075-bba2-d170-09eb392e1453@siemens.com> (raw)
In-Reply-To: <20210215084544.3b3af71d@md1za8fc.ad001.siemens.net>
On 15.02.21 08:45, Henning Schild wrote:
> Am Sat, 13 Feb 2021 13:46:20 +0100
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> While it's definitely nicer and more convenient to pull deb packages
>> from repos, this may not always be the case. This recipe demonstrates
>> how to implement such a pattern.
>>
>> The example embeds the deb as local artifact which is clearly an
>> anti-pattern. That path was only chosen here because it's hard to
>> find a stable URL to a prebuilt arch-independent deb file in the
>> wild. The procedure for creating the deb is also included as README.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> meta-isar/conf/local.conf.sample | 2 +-
>> .../prebuilt-deb/files/README-create-deb.txt | 14 ++++++++++++
>> .../files/example-prebuilt_1.0.0-0_all.deb | Bin 0 -> 776 bytes
>> .../recipes-app/prebuilt-deb/prebuilt-deb.bb | 20
>> ++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-)
>> create mode 100644
>> meta-isar/recipes-app/prebuilt-deb/files/README-create-deb.txt create
>> mode 100644
>> meta-isar/recipes-app/prebuilt-deb/files/example-prebuilt_1.0.0-0_all.deb
>> create mode 100644 meta-isar/recipes-app/prebuilt-deb/prebuilt-deb.bb
>>
>> diff --git a/meta-isar/conf/local.conf.sample
>> b/meta-isar/conf/local.conf.sample index 107496c1..cc0b5c66 100644
>> --- a/meta-isar/conf/local.conf.sample
>> +++ b/meta-isar/conf/local.conf.sample
>> @@ -172,7 +172,7 @@ CONF_VERSION = "1"
>>
>> #
>> # The default list of extra packages to be installed.
>> -IMAGE_INSTALL = "hello-isar example-raw
>> example-module-${KERNEL_NAME} enable-fsck isar-exclude-docs samefile
>> hello isar-disable-apt-cache cowsay" +IMAGE_INSTALL = "hello-isar
>> example-raw example-module-${KERNEL_NAME} enable-fsck
>> isar-exclude-docs samefile hello isar-disable-apt-cache cowsay
>> example-prebuilt" # # Enable cross-compilation support diff --git
>> a/meta-isar/recipes-app/prebuilt-deb/files/README-create-deb.txt
>> b/meta-isar/recipes-app/prebuilt-deb/files/README-create-deb.txt new
>> file mode 100644 index 00000000..e2dc35dc --- /dev/null
>> +++ b/meta-isar/recipes-app/prebuilt-deb/files/README-create-deb.txt
>> @@ -0,0 +1,14 @@
>> +Create test deb package:
>> +
>> +mkdir -p example-prebuilt/DEBIAN example-prebuilt/opt
>> +cat << EOF > example-prebuilt/DEBIAN/control
>> +Section: misc
>> +Priority: optional
>> +Package: example-prebuilt
>> +Version: 1.0.0
>> +Maintainer: Who Knows <who.knows@example.com>
>> +Description: Just a test package
>> +Architecture: all
>> +EOF
>> +echo "Just some test content" >
>> example-prebuilt/opt/some-package-file +dpkg -b example-prebuilt
>> example-prebuilt_1.0.0-0_all.deb diff --git
>> a/meta-isar/recipes-app/prebuilt-deb/files/example-prebuilt_1.0.0-0_all.deb
>> b/meta-isar/recipes-app/prebuilt-deb/files/example-prebuilt_1.0.0-0_all.deb
>> new file mode 100644 index
>> 0000000000000000000000000000000000000000..3049dab62d8e8bb1857626e2a791e65a986c8f36
>> GIT binary patch literal 776
>> zcmY$iNi0gvu;WTeP0CEn(@o0EODw8XP*5;5Gc-0dH8e4^R8TMg@?oT*fq|KciGl(U
>> zK|unSk)8opa(-S(QGSkINn(*+MHONF#>QrF{eR7?BBB@=Se{+m;>L1d0#iePBBK}s
>> z1c=Be={!*X&&UzWAkMu<rj~K)0a-7*O3_1S)D|b&2(F!~Wt_XYcj`Wmwjwe2$w`7W
>> zcNkvUUAXiyd%l*p<Pt8%i${;t8GgHeG&{q1@}?zb->yuspRjqxy_YRdYBVND7#5f2
>> zojAB~Q`K$05-xTIohG9<PVDox7|dXp#Wbxa(D69WhI0WI3e~HHA8q(o_0@l#o&6@(
>> zwlkYV_?K)u^IdHBj<EBw`SR9s+k6}UaSP9!bm#2jaM{)Sa+YpWi><u6{iPREb_CZ=
>> zZa$kQO<C7YzD#cVVf3r*e*bQ-lcgMsWPcVEt~~tMRy%(d=gYi(rlC>ar1|Vp{`0?+
>> zGmh5!vGP}B^_Qz+ljl!vuwN=~khxmP{$jH3WN!ur_pGvC@;BsPGcc|Jh7|+D;&bc5
>> zHXcd;%>)WEmdL1-#F9jKL;ypXP+S_BSm20@?TpBAacGgFB`_`+)+5J-+Z>rA{{;?r
>> zDJES0U>A4Mbkg>BhKoyfKZ^bHDTkvjv;OI?g)B0Xc6n=U6YUqgTlLZCx22wE_MFR!
>> zml`a@^X-z-ZcRL~D)HNvt!|yXn<jpU*XaJUbxq;V#eX>ddOzB=Yw^ccs|9VlcYWwh
>> z4s<OS%c<0RHl_M%-j^wDv${7sWn^i_v)|jwmVY%WF8FEJ5!1VO6oPkDY;ya}C8Bj|
>> ma*R#G{p}eGV}ZePiLHOqg_-NZ85l1E{lvhK&Rz8yIm`gKeJ%$8
>>
>> literal 0
>> HcmV?d00001
>>
>> diff --git a/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb.bb
>> b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb.bb new file mode
>> 100644 index 00000000..2f1b699e
>> --- /dev/null
>> +++ b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb.bb
>
> prebuilt-deb-1.0.0.bb
>
Well, not consistently done in our examples. But I can change that.
>> @@ -0,0 +1,20 @@
>> +# This software is a part of ISAR.
>> +# Copyright (c) Siemens AG, 2021
>> +#
>> +# SPDX-License-Identifier: MIT
>> +
>> +inherit dpkg-base
>> +
>> +# NOTE: The deb packages should almost never be stored in the repo
>> itself but +# rather fetched from a binary-serving location.
>> For this example, local +# storage was just simpler to maintain
>> across all archs and distros. +#
>> +# 2nd NOTE: "unpack=false" is important, bitbake unpacks deb files
>> otherwise +SRC_URI =
>> "file://example-prebuilt_1.0.0-0_all.deb;unpack=false" +
>
> file://${P}-0_all.deb
>
Nope, these are intentionally decoupled. No magics here, that's only
confusing.
>> +# Only needed if recipe name != package name, as in this case. Or
>> multiple +# packages are provided by a single recipe.
>> +PROVIDES += "example-prebuilt"
>> +
>> +do_dpkg_build() {
>> +}
>
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2021-02-15 9:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-13 12:46 [PATCH v2 0/2] Prebuilt debian package example Jan Kiszka
2021-02-13 12:46 ` [PATCH v2 1/2] meta-isar: Add simple example for injecting prebuilt deb packages Jan Kiszka
2021-02-15 7:45 ` Henning Schild
2021-02-15 9:25 ` Jan Kiszka [this message]
2021-02-13 12:46 ` [PATCH v2 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22c70697-d075-bba2-d170-09eb392e1453@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox