* [PATCHv3 0/9] a few cleanups a bug and a feature
@ 2019-11-07 18:55 Henning Schild
2019-11-07 18:55 ` [PATCHv3 1/9] rootfs: fix incorrect feature name in comment Henning Schild
` (9 more replies)
0 siblings, 10 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:55 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
changes to v2:
* drop base-apt: use the "basename" command instead of pattern substitution
* stop the creation of the run.XX files for all recipes in p6 (v2 7)
The first 5 patches are pure cosmetic to clean up some things i stumbled
over when working on base-apt. I have a few more but they will come
later.
The series introduces the feature that Isar respects BB_NO_NETWORK,
p6+7.
p8 fixes a bug when using a not signed base-apt.
and the new p9 is also cosmetic
Henning Schild (9):
rootfs: fix incorrect feature name in comment
base_apt_helper: change variable names to increase readability
rootfs: rename ROOTFS_INSTALL_COMMAND lock to "isar-apt-lock"
dpkg-base: remove pointless ";" s at end of line
dpkg-base: fix indentation from tabs to spaces
base: implement BB_NO_NETWORK for apt-get
meta: do not equip rootfss with resolv.conf when BB_NO_NETWORK
bootstrap: fix debootstrap gpg issue when base-apt is not signed
meta: dpkg-gbp: remove unneeded proxy export
meta/classes/base-apt-helper.bbclass | 12 +++----
meta/classes/base.bbclass | 13 +++++++
meta/classes/buildchroot.bbclass | 10 ++++--
meta/classes/dpkg-base.bbclass | 34 +++++++++----------
meta/classes/dpkg-gbp.bbclass | 1 -
meta/classes/dpkg.bbclass | 4 +--
meta/classes/image-tools-extension.bbclass | 2 +-
meta/classes/rootfs.bbclass | 17 ++++++----
.../isar-bootstrap/isar-bootstrap.inc | 12 +++----
meta/recipes-kernel/linux/linux-custom.inc | 4 +--
10 files changed, 63 insertions(+), 46 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 1/9] rootfs: fix incorrect feature name in comment
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
@ 2019-11-07 18:55 ` Henning Schild
2019-11-07 18:55 ` [PATCHv3 2/9] base_apt_helper: change variable names to increase readability Henning Schild
` (8 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:55 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
This is purely cosmetic, no functional change.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/rootfs.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 1da27ff..61d7883 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -7,7 +7,7 @@ ROOTFS_PACKAGES ?= ""
# Features of the rootfs creation:
# available features are:
-# 'deploy-package-cache' - copy the package cache ${WORKDIR}/apt_cache
+# 'copy-package-cache' - copy the package cache ${WORKDIR}/apt_cache
# 'clean-package-cache' - delete package cache from rootfs
# 'generate-manifest' - generate a package manifest of the rootfs into ${ROOTFS_MANIFEST_DEPLOY_DIR}
# 'finalize-rootfs' - delete files needed to chroot into the rootfs
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 2/9] base_apt_helper: change variable names to increase readability
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
2019-11-07 18:55 ` [PATCHv3 1/9] rootfs: fix incorrect feature name in comment Henning Schild
@ 2019-11-07 18:55 ` Henning Schild
2019-11-07 18:55 ` [PATCHv3 3/9] rootfs: rename ROOTFS_INSTALL_COMMAND lock to "isar-apt-lock" Henning Schild
` (7 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:55 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
Use (isar|base)_apt_p instead of "isar_package" as variable name for
package comparison.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/base-apt-helper.bbclass | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/meta/classes/base-apt-helper.bbclass b/meta/classes/base-apt-helper.bbclass
index 81df45a..d5674c9 100644
--- a/meta/classes/base-apt-helper.bbclass
+++ b/meta/classes/base-apt-helper.bbclass
@@ -27,17 +27,17 @@ populate_base_apt() {
# Check if this package is taken from Isar-apt, if so - ingore it.
base_name=${package##*/}
- isar_package=$(find ${REPO_ISAR_DIR}/${DISTRO} -name $base_name)
- if [ -n "$isar_package" ]; then
+ isar_apt_p=$(find ${REPO_ISAR_DIR}/${DISTRO} -name $base_name)
+ if [ -n "$isar_apt_p" ]; then
# Check if MD5 sums are identical. This helps to avoid the case
# when packages is overridden from another repo.
- compare_pkg_md5sums "$package" "$isar_package" && continue
+ compare_pkg_md5sums "$package" "$isar_apt_p" && continue
fi
# Check if this package is already in base-apt
- isar_package=$(find ${REPO_BASE_DIR}/${BASE_DISTRO} -name $base_name)
- if [ -n "$isar_package" ]; then
- compare_pkg_md5sums "$package" "$isar_package" && continue
+ base_apt_p=$(find ${REPO_BASE_DIR}/${BASE_DISTRO} -name $base_name)
+ if [ -n "$base_apt_p" ]; then
+ compare_pkg_md5sums "$package" "$base_apt_p" && continue
# md5sum differs, so remove the package from base-apt
name=$(echo $base_name | cut -d '_' -f 1)
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 3/9] rootfs: rename ROOTFS_INSTALL_COMMAND lock to "isar-apt-lock"
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
2019-11-07 18:55 ` [PATCHv3 1/9] rootfs: fix incorrect feature name in comment Henning Schild
2019-11-07 18:55 ` [PATCHv3 2/9] base_apt_helper: change variable names to increase readability Henning Schild
@ 2019-11-07 18:55 ` Henning Schild
2019-11-07 18:55 ` [PATCHv3 4/9] dpkg-base: remove pointless ";" s at end of line Henning Schild
` (6 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:55 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
The new name should make clear what gets (un)-locked here. No functional
change.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/rootfs.bbclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 61d7883..72303fe 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -94,7 +94,7 @@ EOSUDO
ROOTFS_INSTALL_COMMAND += "rootfs_install_pkgs_update"
rootfs_install_pkgs_update[weight] = "5"
-rootfs_install_pkgs_update[isar-lock] = "acquire-before"
+rootfs_install_pkgs_update[isar-apt-lock] = "acquire-before"
rootfs_install_pkgs_update() {
sudo -E chroot '${ROOTFSDIR}' /usr/bin/apt-get update \
-o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
@@ -110,7 +110,7 @@ rootfs_install_resolvconf() {
ROOTFS_INSTALL_COMMAND += "rootfs_install_pkgs_download"
rootfs_install_pkgs_download[weight] = "600"
-rootfs_install_pkgs_download[isar-lock] = "release-after"
+rootfs_install_pkgs_download[isar-apt-lock] = "release-after"
rootfs_install_pkgs_download() {
sudo -E chroot '${ROOTFSDIR}' \
/usr/bin/apt-get ${ROOTFS_APT_ARGS} --download-only ${ROOTFS_PACKAGES}
@@ -157,13 +157,13 @@ python do_rootfs_install() {
for cmd in cmds:
progress_reporter.next_stage()
- if (d.getVarFlag(cmd, 'isar-lock') or "") == "acquire-before":
+ if (d.getVarFlag(cmd, 'isar-apt-lock') or "") == "acquire-before":
lock = bb.utils.lockfile(d.getVar("REPO_ISAR_DIR") + "/isar.lock",
shared=True)
bb.build.exec_func(cmd, d)
- if (d.getVarFlag(cmd, 'isar-lock') or "") == "release-after":
+ if (d.getVarFlag(cmd, 'isar-apt-lock') or "") == "release-after":
bb.utils.unlockfile(lock)
progress_reporter.finish()
}
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 4/9] dpkg-base: remove pointless ";" s at end of line
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (2 preceding siblings ...)
2019-11-07 18:55 ` [PATCHv3 3/9] rootfs: rename ROOTFS_INSTALL_COMMAND lock to "isar-apt-lock" Henning Schild
@ 2019-11-07 18:55 ` Henning Schild
2019-11-07 18:55 ` [PATCHv3 5/9] dpkg-base: fix indentation from tabs to spaces Henning Schild
` (5 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:55 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
Pure style change, nothing functional.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg-base.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 1478a17..81ca11f 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -152,7 +152,7 @@ python do_devshell() {
oe_lib_path = os.path.join(d.getVar('LAYERDIR_core'), 'lib')
sys.path.insert(0, oe_lib_path)
- bb.build.exec_func('dpkg_do_mounts', d);
+ bb.build.exec_func('dpkg_do_mounts', d)
bb.utils.export_proxies(d)
@@ -161,7 +161,7 @@ python do_devshell() {
termcmd = "sudo -E chroot {0} sh -c 'cd {1}; $SHELL -i'"
oe_terminal(termcmd.format(buildchroot, pp_pps), "Isar devshell", d)
- bb.build.exec_func('dpkg_undo_mounts', d);
+ bb.build.exec_func('dpkg_undo_mounts', d)
}
addtask devshell after do_prepare_build
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 5/9] dpkg-base: fix indentation from tabs to spaces
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (3 preceding siblings ...)
2019-11-07 18:55 ` [PATCHv3 4/9] dpkg-base: remove pointless ";" s at end of line Henning Schild
@ 2019-11-07 18:55 ` Henning Schild
2019-11-07 18:56 ` [PATCHv3 6/9] base: implement BB_NO_NETWORK for apt-get Henning Schild
` (4 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:55 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
Purely cosmetic change. That one function used tabs instead of spaces,
align with the rest of the file.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg-base.bbclass | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 81ca11f..adc0e85 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -25,20 +25,20 @@ addtask patch after do_adjust_git before do_dpkg_build
SRC_APT ?= ""
do_apt_fetch() {
- if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
- exit
- fi
- rm -rf ${S}
- dpkg_do_mounts
- E="${@ bb.utils.export_proxies(d)}"
- sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \
- -o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
- -o Dir::Etc::SourceParts="-" \
- -o APT::Get::List-Cleanup="0"
-
- sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
- sh -c 'cd ${PP} && apt-get -y --only-source source ${SRC_APT}'
- dpkg_undo_mounts
+ if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
+ exit
+ fi
+ rm -rf ${S}
+ dpkg_do_mounts
+ E="${@ bb.utils.export_proxies(d)}"
+ sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \
+ -o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
+ -o Dir::Etc::SourceParts="-" \
+ -o APT::Get::List-Cleanup="0"
+
+ sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
+ sh -c 'cd ${PP} && apt-get -y --only-source source ${SRC_APT}'
+ dpkg_undo_mounts
}
addtask apt_fetch after do_unpack before do_patch
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 6/9] base: implement BB_NO_NETWORK for apt-get
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (4 preceding siblings ...)
2019-11-07 18:55 ` [PATCHv3 5/9] dpkg-base: fix indentation from tabs to spaces Henning Schild
@ 2019-11-07 18:56 ` Henning Schild
2019-11-07 18:56 ` [PATCHv3 7/9] meta: do not equip rootfss with resolv.conf when BB_NO_NETWORK Henning Schild
` (3 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:56 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
BB_NO_NETWORK should stop all fetchers from downloading stuff, but apt-get
will continue to access the network.
To make it respect the wish for no network, inject a proxy that will not
work, forcing it to eventually fail so when trying to download something.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/base.bbclass | 13 +++++++++++++
meta/classes/dpkg-base.bbclass | 4 ++--
meta/classes/dpkg-gbp.bbclass | 2 +-
meta/classes/dpkg.bbclass | 4 ++--
meta/classes/image-tools-extension.bbclass | 2 +-
meta/classes/rootfs.bbclass | 2 +-
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 2 +-
meta/recipes-kernel/linux/linux-custom.inc | 4 ++--
8 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 0670430..4bd17e3 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -125,6 +125,19 @@ python() {
)
}
+def isar_export_proxies(d):
+ deadend_proxy = 'http://this.should.fail:4242'
+ variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY',
+ 'ftp_proxy', 'FTP_PROXY' ]
+
+ if d.getVar('BB_NO_NETWORK') == "1":
+ for v in variables:
+ d.setVar(v, deadend_proxy)
+ for v in [ 'no_proxy', 'NO_PROXY' ]:
+ d.setVar(v, '')
+
+ return bb.utils.export_proxies(d)
+
# filter out all "apt://" URIs out of SRC_URI and stick them into SRC_APT
python() {
src_uri = (d.getVar('SRC_URI', True) or "").split()
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index adc0e85..0be1627 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -30,7 +30,7 @@ do_apt_fetch() {
fi
rm -rf ${S}
dpkg_do_mounts
- E="${@ bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \
-o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
-o Dir::Etc::SourceParts="-" \
@@ -154,7 +154,7 @@ python do_devshell() {
bb.build.exec_func('dpkg_do_mounts', d)
- bb.utils.export_proxies(d)
+ isar_export_proxies(d)
buildchroot = d.getVar('BUILDCHROOT_DIR')
pp_pps = os.path.join(d.getVar('PP'), d.getVar('PPS'))
diff --git a/meta/classes/dpkg-gbp.bbclass b/meta/classes/dpkg-gbp.bbclass
index 8a8e0f4..e2db671 100644
--- a/meta/classes/dpkg-gbp.bbclass
+++ b/meta/classes/dpkg-gbp.bbclass
@@ -12,7 +12,7 @@ GBP_EXTRA_OPTIONS ?= "--git-pristine-tar"
do_install_builddeps_append() {
dpkg_do_mounts
- E="${@ bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} \
apt-get install -y -o Debug::pkgProblemResolver=yes \
--no-install-recommends ${GBP_DEPENDS}
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 19d77a2..180a3a8 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -6,7 +6,7 @@ inherit dpkg-base
# Install build dependencies for package
do_install_builddeps() {
dpkg_do_mounts
- E="${@ bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} ${DISTRO_ARCH}
dpkg_undo_mounts
}
@@ -19,7 +19,7 @@ addtask devshell after do_install_builddeps
# Build package from sources using build script
dpkg_runbuild() {
- E="${@ bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
/isar/build.sh ${PP}/${PPS} ${DISTRO_ARCH}
}
diff --git a/meta/classes/image-tools-extension.bbclass b/meta/classes/image-tools-extension.bbclass
index 2d8a777..d4f216d 100644
--- a/meta/classes/image-tools-extension.bbclass
+++ b/meta/classes/image-tools-extension.bbclass
@@ -24,7 +24,7 @@ do_install_imager_deps() {
buildchroot_do_mounts
- E="${@bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} sh -c ' \
apt-get update \
-o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 72303fe..fa915f8 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -18,7 +18,7 @@ ROOTFS_APT_ARGS="install --yes -o Debug::pkgProblemResolver=yes"
ROOTFS_CLEAN_FILES="/etc/hostname /etc/resolv.conf"
# Useful environment variables:
-export E = "${@ bb.utils.export_proxies(d)}"
+export E = "${@ isar_export_proxies(d)}"
export DEBIAN_FRONTEND = "noninteractive"
# To avoid Perl locale warnings:
export LANG = "C"
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 1a58471..203a557 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -240,7 +240,7 @@ isar_bootstrap() {
debootstrap_args="$debootstrap_args --no-check-gpg"
fi
fi
- E="${@bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
export IS_HOST debootstrap_args E
sudo -E -s <<'EOSUDO'
set -e
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index dc2af1a..fcbe326 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -40,7 +40,7 @@ KERNEL_LIBC_DEV_DEPLOY ?= "0"
do_install_builddeps() {
dpkg_do_mounts
- E="${@ bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} \
apt-get update \
-o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
@@ -65,7 +65,7 @@ dpkg_runbuild() {
cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config
fi
- E="${@ bb.utils.export_proxies(d)}"
+ E="${@ isar_export_proxies(d)}"
export PV=${PV}
export KERNEL_NAME=${KERNEL_NAME_PROVIDED}
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 7/9] meta: do not equip rootfss with resolv.conf when BB_NO_NETWORK
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (5 preceding siblings ...)
2019-11-07 18:56 ` [PATCHv3 6/9] base: implement BB_NO_NETWORK for apt-get Henning Schild
@ 2019-11-07 18:56 ` Henning Schild
2019-11-07 18:56 ` [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed Henning Schild
` (2 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:56 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
A second "line of defense" to implement BB_NO_NETWORK in Isar.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/buildchroot.bbclass | 10 ++++++++--
meta/classes/rootfs.bbclass | 5 ++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 64ac450..1a8ee13 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -48,8 +48,14 @@ buildchroot_do_mounts() {
mount --bind '${REPO_BASE_DIR}' '${BUILDCHROOT_DIR}/base-apt'
fi
- # Refresh /etc/resolv.conf at this chance
- cp -L /etc/resolv.conf '${BUILDCHROOT_DIR}/etc'
+ # Refresh or remove /etc/resolv.conf at this chance
+ if [ "${@repr(bb.utils.to_boolean(d.getVar('BB_NO_NETWORK')))}" = 'True' ]
+ then
+ rm -rf '${BUILDCHROOT_DIR}/etc/resolv.conf'
+ else
+ cp -L /etc/resolv.conf '${BUILDCHROOT_DIR}/etc'
+ fi
+
) 9>'${MOUNT_LOCKFILE}'
EOSUDO
}
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index fa915f8..c67abab 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -105,7 +105,10 @@ rootfs_install_pkgs_update() {
ROOTFS_INSTALL_COMMAND += "rootfs_install_resolvconf"
rootfs_install_resolvconf[weight] = "1"
rootfs_install_resolvconf() {
- sudo cp -rL /etc/resolv.conf '${ROOTFSDIR}/etc'
+ if [ "${@repr(bb.utils.to_boolean(d.getVar('BB_NO_NETWORK')))}" != "True" ]
+ then
+ sudo cp -rL /etc/resolv.conf '${ROOTFSDIR}/etc'
+ fi
}
ROOTFS_INSTALL_COMMAND += "rootfs_install_pkgs_download"
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (6 preceding siblings ...)
2019-11-07 18:56 ` [PATCHv3 7/9] meta: do not equip rootfss with resolv.conf when BB_NO_NETWORK Henning Schild
@ 2019-11-07 18:56 ` Henning Schild
2019-11-14 20:11 ` Jan Kiszka
2019-11-07 18:56 ` [PATCHv3 9/9] meta: dpkg-gbp: remove unneeded proxy export Henning Schild
2019-11-12 16:39 ` [PATCHv3 0/9] a few cleanups a bug and a feature Baurzhan Ismagulov
9 siblings, 1 reply; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:56 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
DISTRO_BOOTSTRAP_KEYRING will not exist if DISTRO_BOOTSTRAP_KEYFILES is empty.
So the debootstrap argument will not work.
Simplify the logic to depend on the existance of the keyring-file.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 203a557..b506f30 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -231,14 +231,10 @@ isar_bootstrap() {
shift
done
debootstrap_args="--verbose --variant=minbase --include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
- if [ ! "x${DISTRO_BOOTSTRAP_KEYS}" = "x" ] || \
- [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
+ if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
debootstrap_args="$debootstrap_args --keyring=${DISTRO_BOOTSTRAP_KEYRING}"
- fi
- if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
- if [ -z "${BASE_REPO_KEY}" ] ; then
- debootstrap_args="$debootstrap_args --no-check-gpg"
- fi
+ else
+ debootstrap_args="$debootstrap_args --no-check-gpg"
fi
E="${@ isar_export_proxies(d)}"
export IS_HOST debootstrap_args E
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 9/9] meta: dpkg-gbp: remove unneeded proxy export
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (7 preceding siblings ...)
2019-11-07 18:56 ` [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed Henning Schild
@ 2019-11-07 18:56 ` Henning Schild
2019-11-12 16:39 ` [PATCHv3 0/9] a few cleanups a bug and a feature Baurzhan Ismagulov
9 siblings, 0 replies; 14+ messages in thread
From: Henning Schild @ 2019-11-07 18:56 UTC (permalink / raw)
To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov, chombourger, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
The task that is appended already has proxies exported.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg-gbp.bbclass | 1 -
1 file changed, 1 deletion(-)
diff --git a/meta/classes/dpkg-gbp.bbclass b/meta/classes/dpkg-gbp.bbclass
index e2db671..0533a52 100644
--- a/meta/classes/dpkg-gbp.bbclass
+++ b/meta/classes/dpkg-gbp.bbclass
@@ -12,7 +12,6 @@ GBP_EXTRA_OPTIONS ?= "--git-pristine-tar"
do_install_builddeps_append() {
dpkg_do_mounts
- E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} \
apt-get install -y -o Debug::pkgProblemResolver=yes \
--no-install-recommends ${GBP_DEPENDS}
--
2.23.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv3 0/9] a few cleanups a bug and a feature
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
` (8 preceding siblings ...)
2019-11-07 18:56 ` [PATCHv3 9/9] meta: dpkg-gbp: remove unneeded proxy export Henning Schild
@ 2019-11-12 16:39 ` Baurzhan Ismagulov
9 siblings, 0 replies; 14+ messages in thread
From: Baurzhan Ismagulov @ 2019-11-12 16:39 UTC (permalink / raw)
To: isar-users
On Thu, Nov 07, 2019 at 07:55:54PM +0100, Henning Schild wrote:
> changes to v2:
> * drop base-apt: use the "basename" command instead of pattern substitution
> * stop the creation of the run.XX files for all recipes in p6 (v2 7)
>
> The first 5 patches are pure cosmetic to clean up some things i stumbled
> over when working on base-apt. I have a few more but they will come
> later.
>
> The series introduces the feature that Isar respects BB_NO_NETWORK,
> p6+7.
>
> p8 fixes a bug when using a not signed base-apt.
>
> and the new p9 is also cosmetic
Applied to next, thanks.
With kind regards,
Baurzhan.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed
2019-11-07 18:56 ` [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed Henning Schild
@ 2019-11-14 20:11 ` Jan Kiszka
2019-11-14 21:45 ` Henning Schild
0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2019-11-14 20:11 UTC (permalink / raw)
To: Henning Schild, isar-users; +Cc: Baurzhan Ismagulov, chombourger
On 07.11.19 19:56, Henning Schild wrote:
> From: Henning Schild <henning.schild@siemens.com>
>
> DISTRO_BOOTSTRAP_KEYRING will not exist if DISTRO_BOOTSTRAP_KEYFILES is empty.
> So the debootstrap argument will not work.
> Simplify the logic to depend on the existance of the keyring-file.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> index 203a557..b506f30 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -231,14 +231,10 @@ isar_bootstrap() {
> shift
> done
> debootstrap_args="--verbose --variant=minbase --include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
> - if [ ! "x${DISTRO_BOOTSTRAP_KEYS}" = "x" ] || \
> - [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> + if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
> debootstrap_args="$debootstrap_args --keyring=${DISTRO_BOOTSTRAP_KEYRING}"
> - fi
> - if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> - if [ -z "${BASE_REPO_KEY}" ] ; then
> - debootstrap_args="$debootstrap_args --no-check-gpg"
> - fi
> + else
> + debootstrap_args="$debootstrap_args --no-check-gpg"
> fi
> E="${@ isar_export_proxies(d)}"
> export IS_HOST debootstrap_args E
>
Breaks with non-empty DISTRO_BOOTSTRAP_KEYS and a non-signed base-apt.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed
2019-11-14 20:11 ` Jan Kiszka
@ 2019-11-14 21:45 ` Henning Schild
2019-11-15 6:07 ` Baurzhan Ismagulov
0 siblings, 1 reply; 14+ messages in thread
From: Henning Schild @ 2019-11-14 21:45 UTC (permalink / raw)
To: Jan Kiszka; +Cc: isar-users, Baurzhan Ismagulov, chombourger
On Thu, 14 Nov 2019 21:11:23 +0100
Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On 07.11.19 19:56, Henning Schild wrote:
> > From: Henning Schild <henning.schild@siemens.com>
> >
> > DISTRO_BOOTSTRAP_KEYRING will not exist if
> > DISTRO_BOOTSTRAP_KEYFILES is empty. So the debootstrap argument
> > will not work. Simplify the logic to depend on the existance of the
> > keyring-file.
> >
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> > meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10
> > +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
> > 203a557..b506f30 100644 ---
> > a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
> > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -231,14
> > +231,10 @@ isar_bootstrap() { shift
> > done
> > debootstrap_args="--verbose --variant=minbase
> > --include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
> > - if [ ! "x${DISTRO_BOOTSTRAP_KEYS}" = "x" ] || \
> > - [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> > + if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
> > debootstrap_args="$debootstrap_args
> > --keyring=${DISTRO_BOOTSTRAP_KEYRING}"
> > - fi
> > - if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> > - if [ -z "${BASE_REPO_KEY}" ] ; then
> > - debootstrap_args="$debootstrap_args --no-check-gpg"
> > - fi
> > + else
> > + debootstrap_args="$debootstrap_args --no-check-gpg"
> > fi
> > E="${@ isar_export_proxies(d)}"
> > export IS_HOST debootstrap_args E
> >
>
> Breaks with non-empty DISTRO_BOOTSTRAP_KEYS and a non-signed base-apt.
Thanks. I will come up with a fix ASAP.
The key problem is that ci_build.sh has too many knobs and does not
test the repo build in all its beauty. In fact this fix should have
come with a test that shows the problem it fixed in the first place.
So i guess my fix will come with another change that simplifies the
build script and reduces the number of knobs. Maybe in the end just one,
fast|full. Where full would do the offline build signed, unsigned, with
other keys and without, and with+out any other variation i find on the
way.
Henning
> Jan
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed
2019-11-14 21:45 ` Henning Schild
@ 2019-11-15 6:07 ` Baurzhan Ismagulov
0 siblings, 0 replies; 14+ messages in thread
From: Baurzhan Ismagulov @ 2019-11-15 6:07 UTC (permalink / raw)
To: isar-users
On Thu, Nov 14, 2019 at 10:45:25PM +0100, Henning Schild wrote:
> The key problem is that ci_build.sh has too many knobs and does not
> test the repo build in all its beauty. In fact this fix should have
> come with a test that shows the problem it fixed in the first place.
Indeed, we only test "-r -s" after signing was implemented.
> So i guess my fix will come with another change that simplifies the
> build script and reduces the number of knobs. Maybe in the end just one,
> fast|full.
I support this as long as we don't lose tested configurations.
> Where full would do the offline build signed, unsigned, with other keys and
> without, and with+out any other variation i find on the way.
I think we could do that with one amd64 configuration, each in a separate build
directory, keeping the built artifacts.
With kind regards,
Baurzhan.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-11-15 6:07 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 18:55 [PATCHv3 0/9] a few cleanups a bug and a feature Henning Schild
2019-11-07 18:55 ` [PATCHv3 1/9] rootfs: fix incorrect feature name in comment Henning Schild
2019-11-07 18:55 ` [PATCHv3 2/9] base_apt_helper: change variable names to increase readability Henning Schild
2019-11-07 18:55 ` [PATCHv3 3/9] rootfs: rename ROOTFS_INSTALL_COMMAND lock to "isar-apt-lock" Henning Schild
2019-11-07 18:55 ` [PATCHv3 4/9] dpkg-base: remove pointless ";" s at end of line Henning Schild
2019-11-07 18:55 ` [PATCHv3 5/9] dpkg-base: fix indentation from tabs to spaces Henning Schild
2019-11-07 18:56 ` [PATCHv3 6/9] base: implement BB_NO_NETWORK for apt-get Henning Schild
2019-11-07 18:56 ` [PATCHv3 7/9] meta: do not equip rootfss with resolv.conf when BB_NO_NETWORK Henning Schild
2019-11-07 18:56 ` [PATCHv3 8/9] bootstrap: fix debootstrap gpg issue when base-apt is not signed Henning Schild
2019-11-14 20:11 ` Jan Kiszka
2019-11-14 21:45 ` Henning Schild
2019-11-15 6:07 ` Baurzhan Ismagulov
2019-11-07 18:56 ` [PATCHv3 9/9] meta: dpkg-gbp: remove unneeded proxy export Henning Schild
2019-11-12 16:39 ` [PATCHv3 0/9] a few cleanups a bug and a feature Baurzhan Ismagulov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox