From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 2/8] Prioritize isar-apt repo over all others
Date: Thu, 8 Feb 2018 16:05:35 +0100 [thread overview]
Message-ID: <4bf281bca0d2afbf2bc661b70ed9a6932c72fcde.1518102341.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1518102341.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1518102341.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
This ensures that we can override packages from upstream Debian or other
external sources with our self-built versions. We achieve this for now
by asking multistrap to drop a preferences file for the buildchroot so
that dependency installations use the right priority. For the image
build, this does not work because all packages are pull during the
bootstrap. Therefore, we set aptdefaultrelease to isar to ensure that
our repo gets the higher priority.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/recipes-core/images/files/multistrap.conf.in | 1 +
meta-isar/recipes-core/images/isar-image-base.bb | 1 +
meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +++-
meta/recipes-devtools/buildchroot/files/isar-apt-prefs | 3 +++
meta/recipes-devtools/buildchroot/files/multistrap.conf.in | 1 +
5 files changed, 9 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-devtools/buildchroot/files/isar-apt-prefs
diff --git a/meta-isar/recipes-core/images/files/multistrap.conf.in b/meta-isar/recipes-core/images/files/multistrap.conf.in
index 432b6af..2ab7eab 100644
--- a/meta-isar/recipes-core/images/files/multistrap.conf.in
+++ b/meta-isar/recipes-core/images/files/multistrap.conf.in
@@ -10,6 +10,7 @@ aptsources=##DISTRO_MULTICONF_APTSOURCES##
configscript=##CONFIG_SCRIPT##
setupscript=##SETUP_SCRIPT##
hookdir=##DIR_HOOKS##
+aptdefaultrelease=isar
[base]
source=##DISTRO_APT_SOURCE##
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 8ddbabb..e54b9a6 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -53,6 +53,7 @@ do_rootfs() {
-e 's|##IMAGE_INSTALL##|${IMAGE_INSTALL}|g' \
-e 's|##DEPLOY_DIR_APT##|copy:///${DEPLOY_DIR_APT}/${DISTRO}|g' \
-e 's|##ISAR_DISTRO_SUITE##|${DEBDISTRONAME}|g' \
+ -e 's|##APT_PREFS##|./'"$WORKDIR_REL"'/isar-apt-prefs|g' \
"${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
# Do not use bitbake flag [dirs] here because this folder should have
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index df9df19..bf80114 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -12,7 +12,8 @@ FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
SRC_URI = "file://multistrap.conf.in \
file://configscript.sh \
file://setup.sh \
- file://build.sh"
+ file://build.sh \
+ file://isar-apt-prefs"
PV = "1.0"
BUILDCHROOT_PREINSTALL ?= "gcc \
@@ -58,6 +59,7 @@ do_build() {
-e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
-e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
-e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
+ -e 's|##APT_PREFS##|./'"$WORKDIR_REL"'/isar-apt-prefs|g' \
"${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
do_setup_mounts
diff --git a/meta/recipes-devtools/buildchroot/files/isar-apt-prefs b/meta/recipes-devtools/buildchroot/files/isar-apt-prefs
new file mode 100644
index 0000000..2db40e5
--- /dev/null
+++ b/meta/recipes-devtools/buildchroot/files/isar-apt-prefs
@@ -0,0 +1,3 @@
+Package: *
+Pin: release n=isar,c=main
+Pin-Priority: 1001
diff --git a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
index 480a4b8..89c4968 100644
--- a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
+++ b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
@@ -10,6 +10,7 @@ aptsources=isar-apt ##DISTRO_MULTICONF_APTSOURCES##
configscript=##CONFIG_SCRIPT##
setupscript=##SETUP_SCRIPT##
hookdir=##DIR_HOOKS##
+aptpreferences=##APT_PREFS##
[base]
source=##DISTRO_APT_SOURCE##
--
2.13.6
next prev parent reply other threads:[~2018-02-08 15:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 15:05 [PATCH 0/8] Provide infrastructure and examples for custom kernels and modules Jan Kiszka
2018-02-08 15:05 ` [PATCH 1/8] Forward proxy settings to dpkg build Jan Kiszka
2018-02-08 15:05 ` Jan Kiszka [this message]
2018-02-08 15:05 ` [PATCH 3/8] Replace SRC_DIR with S Jan Kiszka
2018-02-08 15:05 ` [PATCH 4/8] Install kernel via replaceable recipe Jan Kiszka
2018-02-08 15:05 ` [PATCH 5/8] Provide include file for easy custom kernel builds Jan Kiszka
2018-02-08 15:05 ` [PATCH 6/8] Add custom kernel examples Jan Kiszka
2018-02-08 15:05 ` [PATCH 7/8] Provide include file for easy custom module builds Jan Kiszka
2018-02-08 15:05 ` [PATCH 8/8] Add exemplary kernel module 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=4bf281bca0d2afbf2bc661b70ed9a6932c72fcde.1518102341.git.jan.kiszka@siemens.com \
--to=jan.kiszka@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