* [PATCH v3 0/2] Prebuilt debian package example
@ 2021-02-15 9:35 Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 1/2] meta-isar: Add simple example for injecting prebuilt deb packages Jan Kiszka
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Jan Kiszka @ 2021-02-15 9:35 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
Changes in v3:
- add a version to the recipe (but keep it decoupled from the deb
package, for demonstration purposes)
Changes in v2:
- integrated with Henning's version, specifically including his
documentation
- converted example deb generation into pure README, removing sources
CC: Henning Schild <henning.schild@siemens.com>
Henning Schild (1):
doc/user_manual.md: add a section on how to deal with prebuilt debs
Jan Kiszka (1):
meta-isar: Add simple example for injecting prebuilt deb packages
doc/user_manual.md | 8 +++++++
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
.../prebuilt-deb/prebuilt-deb_0.1.bb | 20 ++++++++++++++++++
5 files changed, 43 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_0.1.bb
--
2.26.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 1/2] meta-isar: Add simple example for injecting prebuilt deb packages
2021-02-15 9:35 [PATCH v3 0/2] Prebuilt debian package example Jan Kiszka
@ 2021-02-15 9:35 ` Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs Jan Kiszka
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2021-02-15 9:35 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
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
.../prebuilt-deb/prebuilt-deb_0.1.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_0.1.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_0.1.bb b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb
new file mode 100644
index 00000000..2f1b699e
--- /dev/null
+++ b/meta-isar/recipes-app/prebuilt-deb/prebuilt-deb_0.1.bb
@@ -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"
+
+# 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() {
+}
--
2.26.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs
2021-02-15 9:35 [PATCH v3 0/2] Prebuilt debian package example Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 1/2] meta-isar: Add simple example for injecting prebuilt deb packages Jan Kiszka
@ 2021-02-15 9:35 ` Jan Kiszka
2021-03-30 8:13 ` Baurzhan Ismagulov
2021-02-15 11:36 ` [PATCH v3 0/2] Prebuilt debian package example Henning Schild
2021-04-05 10:00 ` Baurzhan Ismagulov
3 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2021-02-15 9:35 UTC (permalink / raw)
To: isar-users; +Cc: Henning Schild
From: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: some tweaks for the wording]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
doc/user_manual.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/doc/user_manual.md b/doc/user_manual.md
index a4f3d1de..e051cc70 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -691,6 +691,14 @@ For the variables please have a look at the previous example, the following new
Have a look at the `example-raw` recipe to get an idea how the `dpkg-raw` class can be used to customize your image.
Note that the package will be build using the whole debian package workflow, so your package will be checked by many debhelper scripts. If those helpers point out quality issues it might be a good idea to fix them. But `example-raw` also shows how rules can still be violated.
+### Prebuilt .deb packages from somewhere
+
+In some cases you might find yourself having a `.deb` that someone else built,
+but not a proper debian repository to add to `DISTRO_APT_SOURCES` to get it from which would be the better way.
+
+Such single debs can be included if need be. You just need to write a recipe that just fetches those debs to its `WORKDIR` and deploys them.
+They can then be installed via `IMAGE_INSTALL`. Have a look at `prebuilt-deb`.
+
## Isar Cross-compilation
### Motivation
--
2.26.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 0/2] Prebuilt debian package example
2021-02-15 9:35 [PATCH v3 0/2] Prebuilt debian package example Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 1/2] meta-isar: Add simple example for injecting prebuilt deb packages Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs Jan Kiszka
@ 2021-02-15 11:36 ` Henning Schild
2021-04-05 10:00 ` Baurzhan Ismagulov
3 siblings, 0 replies; 6+ messages in thread
From: Henning Schild @ 2021-02-15 11:36 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users
ACK, thanks for taking over.
Henning
Am Mon, 15 Feb 2021 10:35:36 +0100
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> Changes in v3:
> - add a version to the recipe (but keep it decoupled from the deb
> package, for demonstration purposes)
>
> Changes in v2:
> - integrated with Henning's version, specifically including his
> documentation
> - converted example deb generation into pure README, removing sources
>
>
> CC: Henning Schild <henning.schild@siemens.com>
>
> Henning Schild (1):
> doc/user_manual.md: add a section on how to deal with prebuilt debs
>
> Jan Kiszka (1):
> meta-isar: Add simple example for injecting prebuilt deb packages
>
> doc/user_manual.md | 8 +++++++
> 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
> .../prebuilt-deb/prebuilt-deb_0.1.bb | 20
> ++++++++++++++++++ 5 files changed, 43 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_0.1.bb
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs
2021-02-15 9:35 ` [PATCH v3 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs Jan Kiszka
@ 2021-03-30 8:13 ` Baurzhan Ismagulov
0 siblings, 0 replies; 6+ messages in thread
From: Baurzhan Ismagulov @ 2021-03-30 8:13 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users, Henning Schild
On Mon, Feb 15, 2021 at 10:35:38AM +0100, Jan Kiszka wrote:
> diff --git a/doc/user_manual.md b/doc/user_manual.md
> index a4f3d1de..e051cc70 100644
> --- a/doc/user_manual.md
> +++ b/doc/user_manual.md
> @@ -691,6 +691,14 @@ For the variables please have a look at the previous example, the following new
> Have a look at the `example-raw` recipe to get an idea how the `dpkg-raw` class can be used to customize your image.
> Note that the package will be build using the whole debian package workflow, so your package will be checked by many debhelper scripts. If those helpers point out quality issues it might be a good idea to fix them. But `example-raw` also shows how rules can still be violated.
>
> +### Prebuilt .deb packages from somewhere
> +
> +In some cases you might find yourself having a `.deb` that someone else built,
> +but not a proper debian repository to add to `DISTRO_APT_SOURCES` to get it from which would be the better way.
> +
> +Such single debs can be included if need be. You just need to write a recipe that just fetches those debs to its `WORKDIR` and deploys them.
> +They can then be installed via `IMAGE_INSTALL`. Have a look at `prebuilt-deb`.
> +
Thanks, the series looks good to me. Ok to reformat at column 79 before
applying?
With kind regards,
Baurzhan.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 0/2] Prebuilt debian package example
2021-02-15 9:35 [PATCH v3 0/2] Prebuilt debian package example Jan Kiszka
` (2 preceding siblings ...)
2021-02-15 11:36 ` [PATCH v3 0/2] Prebuilt debian package example Henning Schild
@ 2021-04-05 10:00 ` Baurzhan Ismagulov
3 siblings, 0 replies; 6+ messages in thread
From: Baurzhan Ismagulov @ 2021-04-05 10:00 UTC (permalink / raw)
To: isar-users
On Mon, Feb 15, 2021 at 10:35:36AM +0100, Jan Kiszka wrote:
> Changes in v3:
> - add a version to the recipe (but keep it decoupled from the deb
> package, for demonstration purposes)
Thanks, applied to next with newlines.
With kind regards,
Baurzhan.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-05 10:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 9:35 [PATCH v3 0/2] Prebuilt debian package example Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 1/2] meta-isar: Add simple example for injecting prebuilt deb packages Jan Kiszka
2021-02-15 9:35 ` [PATCH v3 2/2] doc/user_manual.md: add a section on how to deal with prebuilt debs Jan Kiszka
2021-03-30 8:13 ` Baurzhan Ismagulov
2021-02-15 11:36 ` [PATCH v3 0/2] Prebuilt debian package example Henning Schild
2021-04-05 10:00 ` Baurzhan Ismagulov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox