From: Henning Schild <henning.schild@siemens.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] meta-isar: Add simple example for injecting prebuilt deb packages
Date: Fri, 12 Feb 2021 18:07:25 +0100 [thread overview]
Message-ID: <20210212180725.5e3af386@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <8cbb94d5-0020-75b4-e724-4d6fde994c01@siemens.com>
Ok, seems we did not align correctly on who does it. We both did add
actual code, while i later found that an example in the user manual
might have been enough after all.
Am Fri, 12 Feb 2021 17:36:40 +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 "sources" and the procedure for creating the deb is also
> included.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> This was only lightly tested because our CI still f...-up thanks to
> some primitive content checker at the proxies.
>
> meta-isar/conf/local.conf.sample | 2 +-
> .../recipes-app/prebuilt-deb/files/README.deb | 3 +++
> .../files/some-deb-package/DEBIAN/control | 7 +++++++
> .../some-deb-package/opt/some-package-file | 1 +
> .../files/some-deb-package_1.0.0-0_all.deb | Bin 0 -> 780 bytes
> .../recipes-app/prebuilt-deb/prebuilt-deb.bb | 16
> ++++++++++++++++ 6 files changed, 28 insertions(+), 1 deletion(-)
> create mode 100644
> meta-isar/recipes-app/prebuilt-deb/files/README.deb create mode
> 100644
> meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/DEBIAN/control
> create mode 100644
> meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/opt/some-package-file
> create mode 100644
> meta-isar/recipes-app/prebuilt-deb/files/some-deb-package_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..2379f1ca 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
> some-deb-package" # # Enable cross-compilation support diff --git
> a/meta-isar/recipes-app/prebuilt-deb/files/README.deb
> b/meta-isar/recipes-app/prebuilt-deb/files/README.deb new file mode
> 100644 index 00000000..92f07113 --- /dev/null
> +++ b/meta-isar/recipes-app/prebuilt-deb/files/README.deb
I would say ".txt" or ".md" dot deb is pretty confusing
> @@ -0,0 +1,3 @@
> +Create test deb package:
> +
> +dpkg -b some-deb-package some-deb-package_1.0.0-0_all.deb
Maybe fold all the files into here, if we have that binary and keep it.
> diff --git
> a/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/DEBIAN/control
> b/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/DEBIAN/control
> new file mode 100644 index 00000000..cb2c39fe --- /dev/null
> +++
> b/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/DEBIAN/control
> @@ -0,0 +1,7 @@ +Section: misc
> +Priority: optional
> +Package: some-deb-package
> +Version: 1.0.0
> +Maintainer: Who Knows <who.knows@example.com>
> +Description: Just a test package
> +Architecture: all
> diff --git
> a/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/opt/some-package-file
> b/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/opt/some-package-file
> new file mode 100644 index 00000000..6f6625ec --- /dev/null
> +++
> b/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package/opt/some-package-file
> @@ -0,0 +1 @@ +Just some test content
> diff --git
> a/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package_1.0.0-0_all.deb
> b/meta-isar/recipes-app/prebuilt-deb/files/some-deb-package_1.0.0-0_all.deb
> new file mode 100644 index
> 0000000000000000000000000000000000000000..a4a760736634405807edac4d877f4cef7b86413f
> GIT binary patch literal 780
> zcmY$iNi0gvu;WTeP0CEn(@o0EODw8XP*5;5Gc-0dF|#x=Qcy4e@?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(Fzf^fgQ<<LI8cr@vJuYq#jl
> zx+f?ra#=crzhZ7v#ryvMx*KjK$A-*3CCL?48u*_7_SMSI-+S3iH{HwXtGe%c?dVtE
> z>Hdo^eb!7g*4_Uhkoo>Dfx{)fa#I@9-$vDa|C%<T`ml~>?%WNxEKYBq8M0x@T;GN3
> zI?@#u1k0RQ{xIgJP2ba+drHq!A5B!8^4IhFEc1<b`*>a&mY)*cXB4e+;9!rB<HFs%
> zp0N|Y6dmsE<`A`0Qa(4K;!4DK<vD^!qAEKyG7jvGo4=4taC>^d8t3wv2D4l$0%sm#
> ztTCu-;Onbhv43WF`L6qSE^4(iZ;Lxz<!ZN>rGkN>N2h+Lb5Z?K2F5kOuwr0Xd~RLX
> z#v|#!nLt6t5*d|}Sds{j2w*4^ic2F?U?hV<0vBpr>|#WYi<y^p_W|RAVH0v(xXqC{
> z@?YR^mtw-@4|Z`EO($)Cr*_cl@+9w?S5~%*U9K9;@!!KJsnw7ycW>ePi!-NYJj=B&
> zywCTBf9Z|PpUZ#koBN3WsqU%r(r*h-T#i=B$rsOFDzCCiVP|}*?cp~QEuJc`dJ#2;
> z-KIh2%4xORWiqEYCL8#RNUZj|R<z~Sk7w_$td05UAvf1r_HFX3ezCOKJ72WRzUgXv
> vUv?tv7}w87VeYFs!@f+{Rt5#l@6;9#QQo!E42;)+{$gObGHd&8<ZuH3TDvj1
>
> literal 0
> HcmV?d00001
A binary? It is small and you provided sources ... acceptable.
One reason to not build a random package within isar was that i did not
want it misunderstood as a valid way of building a package.
So i like the binary and suggest to move the sources into the README.
To give that README content but not give people files to do stupid
stuff.
And if it is a ```shell copy paste section ...
> 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..2ead6024
> --- /dev/null
> +++ b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb.bb
> @@ -0,0 +1,16 @@
> +# 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. +SRC_URI =
> "file://some-deb-package_1.0.0-0_all.deb;unpack=false" +
> +PROVIDES += "some-deb-package"
> +
> +do_dpkg_build() {
> +}
This is much more readable than mine and more to the point, without the
second package and the hacks to rename and pull it.
And my hacks are really bad examples ... overriding the checksumming
function, pulling packages out of isar-apt, task reordering ... it is
even fragile and hard to maintain.
Maybe take the verbosity of my patches and put it into your patch where
applicable. Which also means i only have to review and not code ;)
Henning
prev parent reply other threads:[~2021-02-12 17:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 16:36 Jan Kiszka
2021-02-12 17:07 ` Henning Schild [this message]
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=20210212180725.5e3af386@md1za8fc.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.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