* [PATCH v2 1/5] implement isar-bootstrap using debootstrap
2018-02-22 13:18 [PATCH v2 0/5] Debootstrap integration claudius.heine.ext
@ 2018-02-22 13:18 ` claudius.heine.ext
2018-02-23 20:39 ` Jan Kiszka
2018-02-22 13:18 ` [PATCH v2 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally claudius.heine.ext
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: claudius.heine.ext @ 2018-02-22 13:18 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
Since multistrap is deprecated for some years, it is required to change
to debootstrap.
This patch introduces the 'isar-bootstrap' recipe that implement the
creation of a minimal base root file system using debootstrap.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta-isar/conf/distro/debian-jessie.conf | 14 ++-
meta-isar/conf/distro/debian-jessie.list | 2 +
meta-isar/conf/distro/debian-stretch.conf | 12 +-
meta-isar/conf/distro/debian-stretch.list | 2 +
meta-isar/conf/distro/debian-wheezy.conf | 14 ++-
meta-isar/conf/distro/debian-wheezy.list | 2 +
meta-isar/conf/distro/raspbian-jessie.conf | 9 +-
.../isar-bootstrap/files/isar-apt.conf | 2 +
meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 128 +++++++++++++++++++++
9 files changed, 168 insertions(+), 17 deletions(-)
create mode 100644 meta-isar/conf/distro/debian-jessie.list
create mode 100644 meta-isar/conf/distro/debian-stretch.list
create mode 100644 meta-isar/conf/distro/debian-wheezy.list
create mode 100644 meta/recipes-core/isar-bootstrap/files/isar-apt.conf
create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
diff --git a/meta-isar/conf/distro/debian-jessie.conf b/meta-isar/conf/distro/debian-jessie.conf
index 3e62b14..d7efa63 100644
--- a/meta-isar/conf/distro/debian-jessie.conf
+++ b/meta-isar/conf/distro/debian-jessie.conf
@@ -1,16 +1,20 @@
-# Debian jessie multistrap configuration
+# Debian jessie distribution configuration
#
# This software is a part of ISAR.
# Copyright (C) 2015-2016 ilbers GmbH
DISTRO_SUITE ?= "jessie"
-DISTRO_COMPONENTS ?= "main contrib non-free"
+# For bootstrap purposes still needed:
DISTRO_APT_SOURCE ?= "http://ftp.debian.org/debian"
-DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
+DISTRO_COMPONENTS ?= "main contrib non-free"
+DISTRO_APT_SOURCES += "conf/distro/debian-jessie.list"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
-DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
DISTRO_KERNELS ?= "486 4kc-malta 586 5kc-malta 686-pae amd64 arm64 armmp \
armmp-lpae ixp4xx kirkwood loongson-2e loongson-2f loongson-3 octeon \
orion5x powerpc powerpc-smp powerpc64 powerpc64le r4k-ip22 r5k-ip32 \
s390x sb1-bcm91250a versatile"
+
+# No longer needed:
+DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
+DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
+DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/distro/debian-jessie.list b/meta-isar/conf/distro/debian-jessie.list
new file mode 100644
index 0000000..3b5cc59
--- /dev/null
+++ b/meta-isar/conf/distro/debian-jessie.list
@@ -0,0 +1,2 @@
+deb http://ftp.de.debian.org/debian jessie-updates main contrib non-free
+deb http://security.debian.org jessie/updates main contrib non-free
diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
index 5a85d52..26a08c5 100644
--- a/meta-isar/conf/distro/debian-stretch.conf
+++ b/meta-isar/conf/distro/debian-stretch.conf
@@ -2,12 +2,16 @@
# Copyright (C) 2017 ilbers GmbH
DISTRO_SUITE ?= "stretch"
-DISTRO_COMPONENTS ?= "main contrib non-free"
+# For bootstrap purposes still needed:
DISTRO_APT_SOURCE ?= "http://ftp.debian.org/debian"
-DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
+DISTRO_COMPONENTS ?= "main contrib non-free"
+DISTRO_APT_SOURCES += "conf/distro/debian-stretch.list"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
-DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
DISTRO_KERNELS ?= "4kc-malta 586 5kc-malta 686 686-pae amd64 arm64 armmp \
armmp-lpae kirkwood loongson-3 marvell octeon orion5x powerpc64le \
rt-686-pae rt-amd64 s390x"
+
+# No longer needed:
+DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
+DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
+DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/distro/debian-stretch.list b/meta-isar/conf/distro/debian-stretch.list
new file mode 100644
index 0000000..842a859
--- /dev/null
+++ b/meta-isar/conf/distro/debian-stretch.list
@@ -0,0 +1,2 @@
+deb http://ftp.de.debian.org/debian stretch-updates main contrib non-free
+deb http://security.debian.org stretch/updates main contrib non-free
diff --git a/meta-isar/conf/distro/debian-wheezy.conf b/meta-isar/conf/distro/debian-wheezy.conf
index f5ab6eb..de7a10f 100644
--- a/meta-isar/conf/distro/debian-wheezy.conf
+++ b/meta-isar/conf/distro/debian-wheezy.conf
@@ -1,14 +1,18 @@
-# Debian wheezy multistrap configuration
+# Debian wheezy distribution configuration
#
# This software is a part of ISAR.
# Copyright (C) 2015-2016 ilbers GmbH
DISTRO_SUITE ?= "wheezy"
-DISTRO_COMPONENTS ?= "main contrib non-free"
+# For bootstrap purposes still needed:
DISTRO_APT_SOURCE ?= "http://ftp.debian.org/debian"
-DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
+DISTRO_COMPONENTS ?= "main contrib non-free"
+DISTRO_APT_SOURCES += "conf/distro/debian-wheezy.list"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
-DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
DISTRO_KERNELS ?= "486 686-pae amd64 rt-686-pae rt-amd64 versatile vexpress \
iop32x ixp4xx kirkwood mv78xx0 mx5 omap orion5x"
+
+# No longer needed:
+DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
+DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
+DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/distro/debian-wheezy.list b/meta-isar/conf/distro/debian-wheezy.list
new file mode 100644
index 0000000..2dbb112
--- /dev/null
+++ b/meta-isar/conf/distro/debian-wheezy.list
@@ -0,0 +1,2 @@
+deb http://ftp.de.debian.org/debian wheezy-updates main contrib non-free
+deb http://security.debian.org wheezy/updates main contrib non-free
diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
index c2a867d..0d66905 100644
--- a/meta-isar/conf/distro/raspbian-jessie.conf
+++ b/meta-isar/conf/distro/raspbian-jessie.conf
@@ -1,13 +1,16 @@
-# Raspbian stable multistrap configuration
+# Raspbian stable distribution configuration
#
# This software is a part of ISAR.
# Copyright (C) 2015-2016 ilbers GmbH
DISTRO_SUITE ?= "jessie"
+# For bootstrap purposes still needed:
DISTRO_COMPONENTS ?= "main contrib non-free firmware"
DISTRO_APT_SOURCE ?= "http://archive.raspbian.org/raspbian"
+DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
+DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
+
+# No longer needed:
DISTRO_APT_SOURCE_SEC ?= ""
-DISTRO_CONFIG_SCRIPT ?= "raspbian-configscript.sh"
DISTRO_MULTICONF_BOOTSTRAP ?= "base"
DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
-DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
diff --git a/meta/recipes-core/isar-bootstrap/files/isar-apt.conf b/meta/recipes-core/isar-bootstrap/files/isar-apt.conf
new file mode 100644
index 0000000..c378775
--- /dev/null
+++ b/meta/recipes-core/isar-bootstrap/files/isar-apt.conf
@@ -0,0 +1,2 @@
+APT::Install-Recommends "0";
+APT::Install-Suggests "0";
\ No newline at end of file
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
new file mode 100644
index 0000000..60da4b1
--- /dev/null
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
@@ -0,0 +1,128 @@
+# Minimal debian root file system
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+Description = "Minimal debian root file system"
+
+LICENSE = "gpl-2.0"
+LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
+FILESPATH_prepend := "${THISDIR}/files:"
+SRC_URI = "file://isar-apt.conf"
+PV = "1.0"
+
+WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
+DEBOOTSTRAP ?= ""
+ROOTFSDIR = "${WORKDIR}/rootfs"
+APTPREFS = "${WORKDIR}/apt-preferences"
+APTSRCS = "${WORKDIR}/apt-sources"
+
+python () {
+ debootstrap = d.getVar("DEBOOTSTRAP", True)
+ if not debootstrap:
+ target = d.getVar("DISTRO_ARCH", True)
+ machine = os.uname()[4]
+ m = {
+ "x86_64": ["i386", "amd64"],
+ "x86": ["i386"],
+ }
+ if machine not in m or target not in m[machine]:
+ debootstrap = "qemu-debootstrap"
+ else:
+ debootstrap = "debootstrap"
+ d.setVar("DEBOOTSTRAP", debootstrap)
+}
+
+def aggregate_files(d, file_list, file_out):
+ import shutil
+
+ with open(file_out, "wb") as out_fd:
+ for entry in file_list:
+ entry_real = bb.parse.resolve_file(entry, d)
+ with open(entry_real, "rb") as in_fd:
+ shutil.copyfileobj(in_fd, out_fd, 1024*1024*10)
+ out_fd.write("\n".encode())
+
+def gen_components_argument(d):
+ components = d.getVar("DISTRO_COMPONENTS", True)
+ if components and components.strip():
+ return "--components=%s" % ",".join(components.split())
+ else:
+ return ""
+
+do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+do_bootstrap[dirs] = "${WORKDIR}"
+do_bootstrap[vardeps] += "DISTRO_COMPONENTS"
+do_bootstrap() {
+ if [ -e "${ROOTFSDIR}" ]; then
+ sudo umount -l "${ROOTFSDIR}/dev" || true
+ sudo umount -l "${ROOTFSDIR}/proc" || true
+ sudo rm -rf "${ROOTFSDIR}"
+ fi
+ E="${@bb.utils.export_proxies(d)}"
+ sudo -E "${DEBOOTSTRAP}" --verbose \
+ --variant minbase \
+ --arch "${DISTRO_ARCH}" \
+ ${@ gen_components_argument(d)} \
+ "${DISTRO_SUITE}" \
+ "${ROOTFSDIR}" \
+ "${DISTRO_APT_SOURCE}"
+}
+addtask bootstrap before do_build after do_unpack
+
+# TODO: add stamp with checksum of preferences and source files
+# TODO: add mirror handling
+do_apt_config_prepare[vardeps] += "\
+ APTPREFS \
+ DISTRO_APT_PREFERENCES \
+ DEBDISTRONAME \
+ APTSRCS \
+ DISTRO_APT_SOURCES \
+ "
+python do_apt_config_prepare() {
+ import textwrap
+
+ apt_preferences_out = d.getVar("APTPREFS", True)
+ apt_preferences_list = (d.getVar("DISTRO_APT_PREFERENCES", True) or ""
+ ).split()
+ aggregate_files(d, apt_preferences_list, apt_preferences_out)
+
+ apt_sources_out = d.getVar("APTSRCS", True)
+ apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or "").split()
+
+ aggregate_files(d, apt_sources_list, apt_sources_out)
+}
+addtask apt_config_prepare before do_build after do_bootstrap
+
+do_apt_config_install() {
+ sudo mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d"
+ sudo install -v -m644 "${APTPREFS}" \
+ "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
+ sudo mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
+ sudo install -v -m644 "${APTSRCS}" \
+ "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
+ sudo mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
+ sudo install -v -m644 "${WORKDIR}/isar-apt.conf" \
+ "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
+}
+addtask apt_config_install before do_build after do_apt_config_prepare
+
+do_apt_update() {
+ sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${ROOTFSDIR}/dev
+ sudo mount -t proc none ${ROOTFSDIR}/proc
+
+ E="${@bb.utils.export_proxies(d)}"
+ export DEBIAN_FRONTEND=noninteractive
+ sudo -E chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
+ sudo -E chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
+ -o Debug::pkgProblemResolver=yes
+}
+addtask apt_update before do_build after do_apt_config_install
+
+do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
+do_deploy() {
+ ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${DISTRO_ARCH}"
+}
+addtask deploy before do_build after do_apt_update
\ No newline at end of file
--
2.16.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/5] implement isar-bootstrap using debootstrap
2018-02-22 13:18 ` [PATCH v2 1/5] implement isar-bootstrap using debootstrap claudius.heine.ext
@ 2018-02-23 20:39 ` Jan Kiszka
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2018-02-23 20:39 UTC (permalink / raw)
To: [ext] claudius.heine.ext@siemens.com, isar-users; +Cc: Claudius Heine
On 2018-02-22 14:18, [ext] claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> Since multistrap is deprecated for some years, it is required to change
> to debootstrap.
>
> This patch introduces the 'isar-bootstrap' recipe that implement the
> creation of a minimal base root file system using debootstrap.
>
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
> meta-isar/conf/distro/debian-jessie.conf | 14 ++-
> meta-isar/conf/distro/debian-jessie.list | 2 +
> meta-isar/conf/distro/debian-stretch.conf | 12 +-
> meta-isar/conf/distro/debian-stretch.list | 2 +
> meta-isar/conf/distro/debian-wheezy.conf | 14 ++-
> meta-isar/conf/distro/debian-wheezy.list | 2 +
> meta-isar/conf/distro/raspbian-jessie.conf | 9 +-
> .../isar-bootstrap/files/isar-apt.conf | 2 +
> meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 128 +++++++++++++++++++++
> 9 files changed, 168 insertions(+), 17 deletions(-)
> create mode 100644 meta-isar/conf/distro/debian-jessie.list
> create mode 100644 meta-isar/conf/distro/debian-stretch.list
> create mode 100644 meta-isar/conf/distro/debian-wheezy.list
> create mode 100644 meta/recipes-core/isar-bootstrap/files/isar-apt.conf
> create mode 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
>
> diff --git a/meta-isar/conf/distro/debian-jessie.conf b/meta-isar/conf/distro/debian-jessie.conf
> index 3e62b14..d7efa63 100644
> --- a/meta-isar/conf/distro/debian-jessie.conf
> +++ b/meta-isar/conf/distro/debian-jessie.conf
> @@ -1,16 +1,20 @@
> -# Debian jessie multistrap configuration
> +# Debian jessie distribution configuration
> #
> # This software is a part of ISAR.
> # Copyright (C) 2015-2016 ilbers GmbH
>
> DISTRO_SUITE ?= "jessie"
> -DISTRO_COMPONENTS ?= "main contrib non-free"
> +# For bootstrap purposes still needed:
> DISTRO_APT_SOURCE ?= "http://ftp.debian.org/debian"
> -DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> +DISTRO_COMPONENTS ?= "main contrib non-free"
> +DISTRO_APT_SOURCES += "conf/distro/debian-jessie.list"
> DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> DISTRO_KERNELS ?= "486 4kc-malta 586 5kc-malta 686-pae amd64 arm64 armmp \
> armmp-lpae ixp4xx kirkwood loongson-2e loongson-2f loongson-3 octeon \
> orion5x powerpc powerpc-smp powerpc64 powerpc64le r4k-ip22 r5k-ip32 \
> s390x sb1-bcm91250a versatile"
> +
> +# No longer needed:
> +DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> +DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> +DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/distro/debian-jessie.list b/meta-isar/conf/distro/debian-jessie.list
> new file mode 100644
> index 0000000..3b5cc59
> --- /dev/null
> +++ b/meta-isar/conf/distro/debian-jessie.list
> @@ -0,0 +1,2 @@
> +deb http://ftp.de.debian.org/debian jessie-updates main contrib non-free
> +deb http://security.debian.org jessie/updates main contrib non-free
> diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
> index 5a85d52..26a08c5 100644
> --- a/meta-isar/conf/distro/debian-stretch.conf
> +++ b/meta-isar/conf/distro/debian-stretch.conf
> @@ -2,12 +2,16 @@
> # Copyright (C) 2017 ilbers GmbH
>
> DISTRO_SUITE ?= "stretch"
> -DISTRO_COMPONENTS ?= "main contrib non-free"
> +# For bootstrap purposes still needed:
> DISTRO_APT_SOURCE ?= "http://ftp.debian.org/debian"
> -DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> +DISTRO_COMPONENTS ?= "main contrib non-free"
> +DISTRO_APT_SOURCES += "conf/distro/debian-stretch.list"
> DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> DISTRO_KERNELS ?= "4kc-malta 586 5kc-malta 686 686-pae amd64 arm64 armmp \
> armmp-lpae kirkwood loongson-3 marvell octeon orion5x powerpc64le \
> rt-686-pae rt-amd64 s390x"
> +
> +# No longer needed:
> +DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> +DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> +DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/distro/debian-stretch.list b/meta-isar/conf/distro/debian-stretch.list
> new file mode 100644
> index 0000000..842a859
> --- /dev/null
> +++ b/meta-isar/conf/distro/debian-stretch.list
> @@ -0,0 +1,2 @@
> +deb http://ftp.de.debian.org/debian stretch-updates main contrib non-free
> +deb http://security.debian.org stretch/updates main contrib non-free
> diff --git a/meta-isar/conf/distro/debian-wheezy.conf b/meta-isar/conf/distro/debian-wheezy.conf
> index f5ab6eb..de7a10f 100644
> --- a/meta-isar/conf/distro/debian-wheezy.conf
> +++ b/meta-isar/conf/distro/debian-wheezy.conf
> @@ -1,14 +1,18 @@
> -# Debian wheezy multistrap configuration
> +# Debian wheezy distribution configuration
> #
> # This software is a part of ISAR.
> # Copyright (C) 2015-2016 ilbers GmbH
>
> DISTRO_SUITE ?= "wheezy"
> -DISTRO_COMPONENTS ?= "main contrib non-free"
> +# For bootstrap purposes still needed:
> DISTRO_APT_SOURCE ?= "http://ftp.debian.org/debian"
> -DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> +DISTRO_COMPONENTS ?= "main contrib non-free"
> +DISTRO_APT_SOURCES += "conf/distro/debian-wheezy.list"
> DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> DISTRO_KERNELS ?= "486 686-pae amd64 rt-686-pae rt-amd64 versatile vexpress \
> iop32x ixp4xx kirkwood mv78xx0 mx5 omap orion5x"
> +
> +# No longer needed:
> +DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> +DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> +DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/distro/debian-wheezy.list b/meta-isar/conf/distro/debian-wheezy.list
> new file mode 100644
> index 0000000..2dbb112
> --- /dev/null
> +++ b/meta-isar/conf/distro/debian-wheezy.list
> @@ -0,0 +1,2 @@
> +deb http://ftp.de.debian.org/debian wheezy-updates main contrib non-free
> +deb http://security.debian.org wheezy/updates main contrib non-free
> diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
> index c2a867d..0d66905 100644
> --- a/meta-isar/conf/distro/raspbian-jessie.conf
> +++ b/meta-isar/conf/distro/raspbian-jessie.conf
> @@ -1,13 +1,16 @@
> -# Raspbian stable multistrap configuration
> +# Raspbian stable distribution configuration
> #
> # This software is a part of ISAR.
> # Copyright (C) 2015-2016 ilbers GmbH
>
> DISTRO_SUITE ?= "jessie"
> +# For bootstrap purposes still needed:
> DISTRO_COMPONENTS ?= "main contrib non-free firmware"
> DISTRO_APT_SOURCE ?= "http://archive.raspbian.org/raspbian"
> +DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
> +DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
> +
> +# No longer needed:
> DISTRO_APT_SOURCE_SEC ?= ""
> -DISTRO_CONFIG_SCRIPT ?= "raspbian-configscript.sh"
> DISTRO_MULTICONF_BOOTSTRAP ?= "base"
> DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> -DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
DISTRO_APT_SOURCES missing, see also my patch in the other mail.
> diff --git a/meta/recipes-core/isar-bootstrap/files/isar-apt.conf b/meta/recipes-core/isar-bootstrap/files/isar-apt.conf
> new file mode 100644
> index 0000000..c378775
> --- /dev/null
> +++ b/meta/recipes-core/isar-bootstrap/files/isar-apt.conf
> @@ -0,0 +1,2 @@
> +APT::Install-Recommends "0";
> +APT::Install-Suggests "0";
> \ No newline at end of file
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
> new file mode 100644
> index 0000000..60da4b1
> --- /dev/null
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
> @@ -0,0 +1,128 @@
> +# Minimal debian root file system
> +#
> +# This software is a part of ISAR.
> +# Copyright (c) Siemens AG, 2018
> +#
> +# SPDX-License-Identifier: MIT
> +
> +Description = "Minimal debian root file system"
> +
> +LICENSE = "gpl-2.0"
> +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
> +FILESPATH_prepend := "${THISDIR}/files:"
> +SRC_URI = "file://isar-apt.conf"
> +PV = "1.0"
> +
> +WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
> +DEBOOTSTRAP ?= ""
> +ROOTFSDIR = "${WORKDIR}/rootfs"
> +APTPREFS = "${WORKDIR}/apt-preferences"
> +APTSRCS = "${WORKDIR}/apt-sources"
> +
> +python () {
> + debootstrap = d.getVar("DEBOOTSTRAP", True)
> + if not debootstrap:
> + target = d.getVar("DISTRO_ARCH", True)
> + machine = os.uname()[4]
> + m = {
> + "x86_64": ["i386", "amd64"],
> + "x86": ["i386"],
> + }
> + if machine not in m or target not in m[machine]:
> + debootstrap = "qemu-debootstrap"
> + else:
> + debootstrap = "debootstrap"
> + d.setVar("DEBOOTSTRAP", debootstrap)
> +}
> +
> +def aggregate_files(d, file_list, file_out):
> + import shutil
> +
> + with open(file_out, "wb") as out_fd:
> + for entry in file_list:
> + entry_real = bb.parse.resolve_file(entry, d)
> + with open(entry_real, "rb") as in_fd:
> + shutil.copyfileobj(in_fd, out_fd, 1024*1024*10)
> + out_fd.write("\n".encode())
> +
> +def gen_components_argument(d):
> + components = d.getVar("DISTRO_COMPONENTS", True)
> + if components and components.strip():
> + return "--components=%s" % ",".join(components.split())
> + else:
> + return ""
> +
> +do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> +do_bootstrap[dirs] = "${WORKDIR}"
> +do_bootstrap[vardeps] += "DISTRO_COMPONENTS"
> +do_bootstrap() {
> + if [ -e "${ROOTFSDIR}" ]; then
> + sudo umount -l "${ROOTFSDIR}/dev" || true
> + sudo umount -l "${ROOTFSDIR}/proc" || true
> + sudo rm -rf "${ROOTFSDIR}"
> + fi
> + E="${@bb.utils.export_proxies(d)}"
> + sudo -E "${DEBOOTSTRAP}" --verbose \
> + --variant minbase \
> + --arch "${DISTRO_ARCH}" \
> + ${@ gen_components_argument(d)} \
> + "${DISTRO_SUITE}" \
> + "${ROOTFSDIR}" \
> + "${DISTRO_APT_SOURCE}"
> +}
> +addtask bootstrap before do_build after do_unpack
> +
> +# TODO: add stamp with checksum of preferences and source files
> +# TODO: add mirror handling
> +do_apt_config_prepare[vardeps] += "\
> + APTPREFS \
> + DISTRO_APT_PREFERENCES \
> + DEBDISTRONAME \
> + APTSRCS \
> + DISTRO_APT_SOURCES \
> + "
> +python do_apt_config_prepare() {
> + import textwrap
> +
> + apt_preferences_out = d.getVar("APTPREFS", True)
> + apt_preferences_list = (d.getVar("DISTRO_APT_PREFERENCES", True) or ""
> + ).split()
> + aggregate_files(d, apt_preferences_list, apt_preferences_out)
> +
> + apt_sources_out = d.getVar("APTSRCS", True)
> + apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or "").split()
> +
> + aggregate_files(d, apt_sources_list, apt_sources_out)
> +}
> +addtask apt_config_prepare before do_build after do_bootstrap
> +
> +do_apt_config_install() {
> + sudo mkdir -p "${ROOTFSDIR}/etc/apt/preferences.d"
> + sudo install -v -m644 "${APTPREFS}" \
> + "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
> + sudo mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
> + sudo install -v -m644 "${APTSRCS}" \
> + "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
> + sudo mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
> + sudo install -v -m644 "${WORKDIR}/isar-apt.conf" \
> + "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
> +}
> +addtask apt_config_install before do_build after do_apt_config_prepare
> +
> +do_apt_update() {
> + sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${ROOTFSDIR}/dev
> + sudo mount -t proc none ${ROOTFSDIR}/proc
> +
> + E="${@bb.utils.export_proxies(d)}"
> + export DEBIAN_FRONTEND=noninteractive
> + sudo -E chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
> + sudo -E chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
> + -o Debug::pkgProblemResolver=yes
> +}
> +addtask apt_update before do_build after do_apt_config_install
> +
> +do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
> +do_deploy() {
> + ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${DISTRO_ARCH}"
Don't we need to remove this on do_clean (CLEANFUNCS)?
> +}
> +addtask deploy before do_build after do_apt_update
> \ No newline at end of file
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally
2018-02-22 13:18 [PATCH v2 0/5] Debootstrap integration claudius.heine.ext
2018-02-22 13:18 ` [PATCH v2 1/5] implement isar-bootstrap using debootstrap claudius.heine.ext
@ 2018-02-22 13:18 ` claudius.heine.ext
2018-02-22 13:18 ` [PATCH v2 3/5] meta/buildchroot: switch to using isar-bootstrap claudius.heine.ext
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: claudius.heine.ext @ 2018-02-22 13:18 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
This patch introduces the 'isar-bootstrap-helper' bitbake class to
support recipes that use the basic root file system created by
isar-bootstrap.
In this patch the function 'setup_root_file_system' is defined that
allows to copy the root file system to the directory specified in the
first parameter and installs additional packages specified by the
next parameters. It also adds the local 'isar-apt' repo to the apt
configuration and fetches its index.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/classes/isar-bootstrap-helper.bbclass | 39 ++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 meta/classes/isar-bootstrap-helper.bbclass
diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
new file mode 100644
index 0000000..a06116d
--- /dev/null
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -0,0 +1,39 @@
+# Helper functions for using isar-bootstrap
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+setup_root_file_system() {
+ ROOTFSDIR="$1"
+ shift
+ PACKAGES="$@"
+
+ sudo cp -Trpfx \
+ "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${DISTRO_ARCH}/" \
+ "$ROOTFSDIR"
+
+ echo "deb file:///isar-apt ${DEBDISTRONAME} main" | \
+ sudo tee "$ROOTFSDIR/etc/apt/sources.list.d/isar-apt.list" >/dev/null
+
+ echo "Package: *\nPin: release n=${DEBDISTRONAME}\nPin-Priority: 1000" | \
+ sudo tee "$ROOTFSDIR/etc/apt/preferences.d/isar" >/dev/null
+
+ sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} $ROOTFSDIR/isar-apt
+ sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs $ROOTFSDIR/dev
+ sudo mount -t proc none $ROOTFSDIR/proc
+
+ # Install packages:
+ E="${@ bb.utils.export_proxies(d)}"
+ export DEBIAN_FRONTEND=noninteractive
+ sudo -E chroot "$ROOTFSDIR" /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 "$ROOTFSDIR" \
+ /usr/bin/apt-get install -y \
+ --allow-unauthenticated \
+ -o Debug::pkgProblemResolver=yes \
+ $PACKAGES
+}
--
2.16.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 3/5] meta/buildchroot: switch to using isar-bootstrap
2018-02-22 13:18 [PATCH v2 0/5] Debootstrap integration claudius.heine.ext
2018-02-22 13:18 ` [PATCH v2 1/5] implement isar-bootstrap using debootstrap claudius.heine.ext
2018-02-22 13:18 ` [PATCH v2 2/5] meta/isar-bootstrap-helper.bbclass: handle rfs customization centrally claudius.heine.ext
@ 2018-02-22 13:18 ` claudius.heine.ext
2018-02-23 20:44 ` Jan Kiszka
2018-02-22 13:19 ` [PATCH v2 4/5] meta-isar/isar-image-base: " claudius.heine.ext
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: claudius.heine.ext @ 2018-02-22 13:18 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
This patch removes the multistrap dependency of the buildchroot recipe
and changes it to use the 'isar-bootstrap' and 'isar-bootstrap-helper'
instead.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/recipes-devtools/buildchroot/buildchroot.bb | 54 ++++----------
meta/recipes-devtools/buildchroot/files/build.sh | 2 +-
.../buildchroot/files/configscript.sh | 10 ---
.../buildchroot/files/multistrap.conf.in | 37 ----------
meta/recipes-devtools/buildchroot/files/setup.sh | 82 ----------------------
5 files changed, 13 insertions(+), 172 deletions(-)
delete mode 100644 meta/recipes-devtools/buildchroot/files/multistrap.conf.in
delete mode 100755 meta/recipes-devtools/buildchroot/files/setup.sh
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index 520daf9..809bc11 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -8,13 +8,13 @@ DESCRIPTION = "Multistrap development filesystem"
LICENSE = "gpl-2.0"
LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
-FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
-SRC_URI = "file://multistrap.conf.in \
- file://configscript.sh \
- file://setup.sh \
+FILESPATH_prepend := "${THISDIR}/files:"
+SRC_URI = "file://configscript.sh \
file://build.sh"
PV = "1.0"
+inherit isar-bootstrap-helper
+
BUILDCHROOT_PREINSTALL ?= "gcc \
make \
build-essential \
@@ -31,50 +31,20 @@ BUILDCHROOT_PREINSTALL ?= "gcc \
WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-do_build[depends] = "isar-apt:do_cache_config"
+do_build[cleandirs] = "${BUILDCHROOT_DIR} \
+ ${BUILDCHROOT_DIR}/isar-apt \
+ ${BUILDCHROOT_DIR}/downloads \
+ ${BUILDCHROOT_DIR}/home/builder"
+do_build[depends] = "isar-apt:do_cache_config isar-bootstrap:do_deploy"
do_build() {
- E="${@ bb.utils.export_proxies(d)}"
-
- # If buildchroot re-build is triggered, this ensure that we are always
- # re-building a clean image:
- sudo rm -rf ${BUILDCHROOT_DIR}
- mkdir -p ${BUILDCHROOT_DIR}/isar-apt
- mkdir -p ${BUILDCHROOT_DIR}/downloads
- mkdir -p ${BUILDCHROOT_DIR}/dev
- mkdir -p ${BUILDCHROOT_DIR}/proc
- mkdir -p ${BUILDCHROOT_DIR}/sys
-
- chmod +x "${WORKDIR}/setup.sh"
- chmod +x "${WORKDIR}/configscript.sh"
-
- # Multistrap accepts only relative path in configuration files, so get it:
- cd ${TOPDIR}
- WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
-
- # Adjust multistrap config
- sed -e 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|g' \
- -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \
- -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \
- -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
- -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \
- -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
- -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
- -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' \
- "${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
-
- sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt
- sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
- sudo mount -t proc none ${BUILDCHROOT_DIR}/proc
-
- # Create root filesystem
- sudo -E multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f "${WORKDIR}/multistrap.conf"
+ setup_root_file_system "${BUILDCHROOT_DIR}" ${BUILDCHROOT_PREINSTALL}
# Install package builder script
+ sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder"
sudo install -m 755 ${WORKDIR}/build.sh ${BUILDCHROOT_DIR}
# Configure root filesystem
+ sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_DIR}
sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
}
diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
index 048f76f..06172f7 100644
--- a/meta/recipes-devtools/buildchroot/files/build.sh
+++ b/meta/recipes-devtools/buildchroot/files/build.sh
@@ -29,7 +29,7 @@ install_cmd="${install_cmd} --allow-unauthenticated"
# APT::Get::List-Cleanup - do not erase obsolete packages list for
# upstream in '/var/lib/apt/lists'
apt-get update \
- -o Dir::Etc::sourcelist="sources.list.d/multistrap-isar-apt.list" \
+ -o Dir::Etc::sourcelist="sources.list.d/isar-apt.list" \
-o Dir::Etc::sourceparts="-" \
-o APT::Get::List-Cleanup="0"
diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh
index a5942b5..c2a599a 100644
--- a/meta/recipes-devtools/buildchroot/files/configscript.sh
+++ b/meta/recipes-devtools/buildchroot/files/configscript.sh
@@ -31,13 +31,3 @@ debconf-set-selections <<END
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
locales locales/default_environment_locale select en_US.UTF-8
END
-
-#set up non-interactive configuration
-export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
-export LC_ALL=C LANGUAGE=C LANG=C
-
-#run pre installation script
-/var/lib/dpkg/info/dash.preinst install
-
-#configuring packages
-dpkg --configure -a
diff --git a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
deleted file mode 100644
index 480a4b8..0000000
--- a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
+++ /dev/null
@@ -1,37 +0,0 @@
-# This software is a part of ISAR.
-# Copyright (C) 2015-2017 ilbers GmbH
-
-[General]
-noauth=true
-unpack=true
-ignorenativearch=true
-bootstrap=##DISTRO_MULTICONF_BOOTSTRAP##
-aptsources=isar-apt ##DISTRO_MULTICONF_APTSOURCES##
-configscript=##CONFIG_SCRIPT##
-setupscript=##SETUP_SCRIPT##
-hookdir=##DIR_HOOKS##
-
-[base]
-source=##DISTRO_APT_SOURCE##
-suite=##DISTRO_SUITE##
-components=##DISTRO_COMPONENTS##
-packages=##BUILDCHROOT_PREINSTALL##
-omitdebsrc=true
-
-[updates]
-source=##DISTRO_APT_SOURCE##
-suite=##DISTRO_SUITE##-updates
-components=##DISTRO_COMPONENTS##
-omitdebsrc=true
-
-[security]
-source=##DISTRO_APT_SOURCE_SEC##
-suite=##DISTRO_SUITE##/updates
-components=##DISTRO_COMPONENTS##
-omitdebsrc=true
-
-[isar-apt]
-source=file:///isar-apt
-suite=isar
-components=main
-omitdebsrc=true
diff --git a/meta/recipes-devtools/buildchroot/files/setup.sh b/meta/recipes-devtools/buildchroot/files/setup.sh
deleted file mode 100755
index 1257739..0000000
--- a/meta/recipes-devtools/buildchroot/files/setup.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-#
-# This software is a part of ISAR.
-# Copyright (C) 2015-2016 ilbers GmbH
-#
-# Based on multistrap/examples/chroot.sh
-
-set -e
-
-# The script is called with the following arguments:
-# $1 = $DIR - the top directory of the bootstrapped system
-# $2 = $ARCH - the specified architecture, already checked with
-# dpkg-architecture.
-# setup.sh needs to be executable.
-
-TARGET=$1
-ARCH=$2
-
-# Prevent daemons from starting in buildchroot
-if [ -x "$TARGET/sbin/start-stop-daemon" ]; then
- echo "initctl: Trying to prevent daemons from starting in $TARGET"
-
- # Disable start-stop-daemon
- mv $TARGET/sbin/start-stop-daemon $TARGET/sbin/start-stop-daemon.REAL
- cat > $TARGET/sbin/start-stop-daemon << EOF
-#!/bin/sh
-echo
-echo Warning: Fake start-stop-daemon called, doing nothing
-EOF
- chmod 755 $TARGET/sbin/start-stop-daemon
-fi
-
-if [ -x "$TARGET/sbin/initctl" ]; then
- echo "start-stop-daemon: Trying to prevent daemons from starting in $TARGET"
-
- # Disable initctl
- mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
- cat > $TARGET/sbin/initctl << EOF
-#!/bin/sh
-echo
-echo "Warning: Fake initctl called, doing nothing"
-EOF
- chmod 755 $TARGET/sbin/initctl
-fi
-
-# Define sysvinit policy 101 to prevent daemons from starting in buildchroot
-if [ -x "$TARGET/sbin/init" -a ! -f "$TARGET/usr/sbin/policy-rc.d" ]; then
- echo "sysvinit: Using policy-rc.d to prevent daemons from starting in $TARGET"
-
- cat > $TARGET/usr/sbin/policy-rc.d << EOF
-#!/bin/sh
-echo "sysvinit: All runlevel operations denied by policy" >&2
-exit 101
-EOF
- chmod a+x $TARGET/usr/sbin/policy-rc.d
-fi
-
-case $ARCH in
- armel|armhf)
- qemu_arch=arm
- ;;
- arm64)
- qemu_arch=aarch64
- ;;
-esac
-
-# Install QEMU emulator to execute foreign binaries
-if [ ! -x /usr/bin/qemu-${qemu_arch}-static ]; then
- echo "qemu-${qemu_arch}-static binary not present, unable to execute target binaries"
-else
- sudo cp /usr/bin/qemu-${qemu_arch}-static ${TARGET}/usr/bin
-fi
-
-# Set hostname
-echo "isar" > $TARGET/etc/hostname
-
-# Create packages build folder
-sudo install -d $TARGET/home/builder
-sudo chmod -R a+rw $TARGET/home/builder
-
-# Install host networking settings
-sudo cp /etc/resolv.conf $TARGET/etc
--
2.16.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/5] meta/buildchroot: switch to using isar-bootstrap
2018-02-22 13:18 ` [PATCH v2 3/5] meta/buildchroot: switch to using isar-bootstrap claudius.heine.ext
@ 2018-02-23 20:44 ` Jan Kiszka
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2018-02-23 20:44 UTC (permalink / raw)
To: [ext] claudius.heine.ext@siemens.com, isar-users; +Cc: Claudius Heine
On 2018-02-22 14:18, [ext] claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> This patch removes the multistrap dependency of the buildchroot recipe
> and changes it to use the 'isar-bootstrap' and 'isar-bootstrap-helper'
> instead.
>
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
> meta/recipes-devtools/buildchroot/buildchroot.bb | 54 ++++----------
> meta/recipes-devtools/buildchroot/files/build.sh | 2 +-
> .../buildchroot/files/configscript.sh | 10 ---
> .../buildchroot/files/multistrap.conf.in | 37 ----------
> meta/recipes-devtools/buildchroot/files/setup.sh | 82 ----------------------
> 5 files changed, 13 insertions(+), 172 deletions(-)
> delete mode 100644 meta/recipes-devtools/buildchroot/files/multistrap.conf.in
> delete mode 100755 meta/recipes-devtools/buildchroot/files/setup.sh
>
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
> index 520daf9..809bc11 100644
> --- a/meta/recipes-devtools/buildchroot/buildchroot.bb
> +++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
> @@ -8,13 +8,13 @@ DESCRIPTION = "Multistrap development filesystem"
> LICENSE = "gpl-2.0"
> LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
>
> -FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
> -SRC_URI = "file://multistrap.conf.in \
> - file://configscript.sh \
> - file://setup.sh \
> +FILESPATH_prepend := "${THISDIR}/files:"
> +SRC_URI = "file://configscript.sh \
> file://build.sh"
> PV = "1.0"
>
> +inherit isar-bootstrap-helper
> +
> BUILDCHROOT_PREINSTALL ?= "gcc \
> make \
> build-essential \
> @@ -31,50 +31,20 @@ BUILDCHROOT_PREINSTALL ?= "gcc \
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> -do_build[depends] = "isar-apt:do_cache_config"
> +do_build[cleandirs] = "${BUILDCHROOT_DIR} \
> + ${BUILDCHROOT_DIR}/isar-apt \
> + ${BUILDCHROOT_DIR}/downloads \
> + ${BUILDCHROOT_DIR}/home/builder"
We still have massive issues with cleaning root-owned build artifacts.
So these cleandirs do not work on rebuilds. That's why there are all the
mkdirs below, rather than a short statement like above.
Either we fix this generically, somehow, or we need to stick with those
explicit "sudo rm" / "sudo chown" at the task beginning.
Jan
> +do_build[depends] = "isar-apt:do_cache_config isar-bootstrap:do_deploy"
>
> do_build() {
> - E="${@ bb.utils.export_proxies(d)}"
> -
> - # If buildchroot re-build is triggered, this ensure that we are always
> - # re-building a clean image:
> - sudo rm -rf ${BUILDCHROOT_DIR}
> - mkdir -p ${BUILDCHROOT_DIR}/isar-apt
> - mkdir -p ${BUILDCHROOT_DIR}/downloads
> - mkdir -p ${BUILDCHROOT_DIR}/dev
> - mkdir -p ${BUILDCHROOT_DIR}/proc
> - mkdir -p ${BUILDCHROOT_DIR}/sys
> -
> - chmod +x "${WORKDIR}/setup.sh"
> - chmod +x "${WORKDIR}/configscript.sh"
> -
> - # Multistrap accepts only relative path in configuration files, so get it:
> - cd ${TOPDIR}
> - WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
> -
> - # Adjust multistrap config
> - sed -e 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|g' \
> - -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \
> - -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \
> - -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> - -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \
> - -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> - -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> - -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' \
> - "${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
> -
> - sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt
> - sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
> - sudo mount -t proc none ${BUILDCHROOT_DIR}/proc
> -
> - # Create root filesystem
> - sudo -E multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f "${WORKDIR}/multistrap.conf"
> + setup_root_file_system "${BUILDCHROOT_DIR}" ${BUILDCHROOT_PREINSTALL}
>
> # Install package builder script
> + sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder"
> sudo install -m 755 ${WORKDIR}/build.sh ${BUILDCHROOT_DIR}
>
> # Configure root filesystem
> + sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_DIR}
> sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
> }
> diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
> index 048f76f..06172f7 100644
> --- a/meta/recipes-devtools/buildchroot/files/build.sh
> +++ b/meta/recipes-devtools/buildchroot/files/build.sh
> @@ -29,7 +29,7 @@ install_cmd="${install_cmd} --allow-unauthenticated"
> # APT::Get::List-Cleanup - do not erase obsolete packages list for
> # upstream in '/var/lib/apt/lists'
> apt-get update \
> - -o Dir::Etc::sourcelist="sources.list.d/multistrap-isar-apt.list" \
> + -o Dir::Etc::sourcelist="sources.list.d/isar-apt.list" \
> -o Dir::Etc::sourceparts="-" \
> -o APT::Get::List-Cleanup="0"
>
> diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh
> index a5942b5..c2a599a 100644
> --- a/meta/recipes-devtools/buildchroot/files/configscript.sh
> +++ b/meta/recipes-devtools/buildchroot/files/configscript.sh
> @@ -31,13 +31,3 @@ debconf-set-selections <<END
> locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
> locales locales/default_environment_locale select en_US.UTF-8
> END
> -
> -#set up non-interactive configuration
> -export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
> -export LC_ALL=C LANGUAGE=C LANG=C
> -
> -#run pre installation script
> -/var/lib/dpkg/info/dash.preinst install
> -
> -#configuring packages
> -dpkg --configure -a
> diff --git a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
> deleted file mode 100644
> index 480a4b8..0000000
> --- a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -# This software is a part of ISAR.
> -# Copyright (C) 2015-2017 ilbers GmbH
> -
> -[General]
> -noauth=true
> -unpack=true
> -ignorenativearch=true
> -bootstrap=##DISTRO_MULTICONF_BOOTSTRAP##
> -aptsources=isar-apt ##DISTRO_MULTICONF_APTSOURCES##
> -configscript=##CONFIG_SCRIPT##
> -setupscript=##SETUP_SCRIPT##
> -hookdir=##DIR_HOOKS##
> -
> -[base]
> -source=##DISTRO_APT_SOURCE##
> -suite=##DISTRO_SUITE##
> -components=##DISTRO_COMPONENTS##
> -packages=##BUILDCHROOT_PREINSTALL##
> -omitdebsrc=true
> -
> -[updates]
> -source=##DISTRO_APT_SOURCE##
> -suite=##DISTRO_SUITE##-updates
> -components=##DISTRO_COMPONENTS##
> -omitdebsrc=true
> -
> -[security]
> -source=##DISTRO_APT_SOURCE_SEC##
> -suite=##DISTRO_SUITE##/updates
> -components=##DISTRO_COMPONENTS##
> -omitdebsrc=true
> -
> -[isar-apt]
> -source=file:///isar-apt
> -suite=isar
> -components=main
> -omitdebsrc=true
> diff --git a/meta/recipes-devtools/buildchroot/files/setup.sh b/meta/recipes-devtools/buildchroot/files/setup.sh
> deleted file mode 100755
> index 1257739..0000000
> --- a/meta/recipes-devtools/buildchroot/files/setup.sh
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -#!/bin/sh
> -#
> -# This software is a part of ISAR.
> -# Copyright (C) 2015-2016 ilbers GmbH
> -#
> -# Based on multistrap/examples/chroot.sh
> -
> -set -e
> -
> -# The script is called with the following arguments:
> -# $1 = $DIR - the top directory of the bootstrapped system
> -# $2 = $ARCH - the specified architecture, already checked with
> -# dpkg-architecture.
> -# setup.sh needs to be executable.
> -
> -TARGET=$1
> -ARCH=$2
> -
> -# Prevent daemons from starting in buildchroot
> -if [ -x "$TARGET/sbin/start-stop-daemon" ]; then
> - echo "initctl: Trying to prevent daemons from starting in $TARGET"
> -
> - # Disable start-stop-daemon
> - mv $TARGET/sbin/start-stop-daemon $TARGET/sbin/start-stop-daemon.REAL
> - cat > $TARGET/sbin/start-stop-daemon << EOF
> -#!/bin/sh
> -echo
> -echo Warning: Fake start-stop-daemon called, doing nothing
> -EOF
> - chmod 755 $TARGET/sbin/start-stop-daemon
> -fi
> -
> -if [ -x "$TARGET/sbin/initctl" ]; then
> - echo "start-stop-daemon: Trying to prevent daemons from starting in $TARGET"
> -
> - # Disable initctl
> - mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
> - cat > $TARGET/sbin/initctl << EOF
> -#!/bin/sh
> -echo
> -echo "Warning: Fake initctl called, doing nothing"
> -EOF
> - chmod 755 $TARGET/sbin/initctl
> -fi
> -
> -# Define sysvinit policy 101 to prevent daemons from starting in buildchroot
> -if [ -x "$TARGET/sbin/init" -a ! -f "$TARGET/usr/sbin/policy-rc.d" ]; then
> - echo "sysvinit: Using policy-rc.d to prevent daemons from starting in $TARGET"
> -
> - cat > $TARGET/usr/sbin/policy-rc.d << EOF
> -#!/bin/sh
> -echo "sysvinit: All runlevel operations denied by policy" >&2
> -exit 101
> -EOF
> - chmod a+x $TARGET/usr/sbin/policy-rc.d
> -fi
> -
> -case $ARCH in
> - armel|armhf)
> - qemu_arch=arm
> - ;;
> - arm64)
> - qemu_arch=aarch64
> - ;;
> -esac
> -
> -# Install QEMU emulator to execute foreign binaries
> -if [ ! -x /usr/bin/qemu-${qemu_arch}-static ]; then
> - echo "qemu-${qemu_arch}-static binary not present, unable to execute target binaries"
> -else
> - sudo cp /usr/bin/qemu-${qemu_arch}-static ${TARGET}/usr/bin
> -fi
> -
> -# Set hostname
> -echo "isar" > $TARGET/etc/hostname
> -
> -# Create packages build folder
> -sudo install -d $TARGET/home/builder
> -sudo chmod -R a+rw $TARGET/home/builder
> -
> -# Install host networking settings
> -sudo cp /etc/resolv.conf $TARGET/etc
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 4/5] meta-isar/isar-image-base: switch to using isar-bootstrap
2018-02-22 13:18 [PATCH v2 0/5] Debootstrap integration claudius.heine.ext
` (2 preceding siblings ...)
2018-02-22 13:18 ` [PATCH v2 3/5] meta/buildchroot: switch to using isar-bootstrap claudius.heine.ext
@ 2018-02-22 13:19 ` claudius.heine.ext
2018-02-23 20:45 ` Jan Kiszka
2018-02-22 13:19 ` [PATCH v2 5/5] meta-isar/multiconfig: remove multistrap references claudius.heine.ext
2018-02-22 14:21 ` [PATCH v2 0/5] Debootstrap integration Alexander Smirnov
5 siblings, 1 reply; 15+ messages in thread
From: claudius.heine.ext @ 2018-02-22 13:19 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
This patch removes the multistrap dependency of the isar-image-base
recipe and changes it to use the 'isar-bootstrap' and
'isar-bootstrap-helper' instead.
Signed-off-by: Claudius Heine <ch@denx.de>
---
.../recipes-core/images/files/download_dev-random | 24 -------
.../recipes-core/images/files/multistrap.conf.in | 38 -----------
meta-isar/recipes-core/images/files/setup.sh | 77 ----------------------
meta-isar/recipes-core/images/isar-image-base.bb | 61 +++++------------
meta/classes/image.bbclass | 2 +-
5 files changed, 17 insertions(+), 185 deletions(-)
delete mode 100644 meta-isar/recipes-core/images/files/download_dev-random
delete mode 100644 meta-isar/recipes-core/images/files/multistrap.conf.in
delete mode 100755 meta-isar/recipes-core/images/files/setup.sh
diff --git a/meta-isar/recipes-core/images/files/download_dev-random b/meta-isar/recipes-core/images/files/download_dev-random
deleted file mode 100644
index f7f5fe5..0000000
--- a/meta-isar/recipes-core/images/files/download_dev-random
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-#
-# This software is a part of ISAR.
-# Copyright (C) 2017 ilbers GmbH
-
-set -e
-
-readonly ROOTFS="$1"
-
-if [ ! -c ${ROOTFS}/dev/random ]; then
- rm -f ${ROOTFS}/dev/random
- mknod "${ROOTFS}/dev/random" c 1 8
- chmod 666 "${ROOTFS}/dev/random"
- chown 0:0 "${ROOTFS}/dev/random"
-fi
-
-if [ ! -c ${ROOTFS}/dev/urandom ]; then
- rm -f ${ROOTFS}/dev/urandom
- mknod "${ROOTFS}/dev/urandom" c 1 9
- chmod 666 "${ROOTFS}/dev/urandom"
- chown 0:0 "${ROOTFS}/dev/urandom"
-fi
-
-exit 0
diff --git a/meta-isar/recipes-core/images/files/multistrap.conf.in b/meta-isar/recipes-core/images/files/multistrap.conf.in
deleted file mode 100644
index 432b6af..0000000
--- a/meta-isar/recipes-core/images/files/multistrap.conf.in
+++ /dev/null
@@ -1,38 +0,0 @@
-# This software is a part of ISAR.
-# Copyright (C) 2015-2017 ilbers GmbH
-
-[General]
-noauth=true
-unpack=true
-ignorenativearch=true
-bootstrap=##DISTRO_MULTICONF_BOOTSTRAP## Isar
-aptsources=##DISTRO_MULTICONF_APTSOURCES##
-configscript=##CONFIG_SCRIPT##
-setupscript=##SETUP_SCRIPT##
-hookdir=##DIR_HOOKS##
-
-[base]
-source=##DISTRO_APT_SOURCE##
-suite=##DISTRO_SUITE##
-components=##DISTRO_COMPONENTS##
-packages=##IMAGE_PREINSTALL##
-omitdebsrc=true
-
-[updates]
-source=##DISTRO_APT_SOURCE##
-suite=##DISTRO_SUITE##-updates
-components=##DISTRO_COMPONENTS##
-omitdebsrc=true
-
-[security]
-source=##DISTRO_APT_SOURCE_SEC##
-suite=##DISTRO_SUITE##/updates
-components=##DISTRO_COMPONENTS##
-omitdebsrc=true
-
-[Isar]
-packages=##IMAGE_INSTALL##
-source=##DEPLOY_DIR_APT##
-suite=##ISAR_DISTRO_SUITE##
-components=main
-omitdebsrc=true
diff --git a/meta-isar/recipes-core/images/files/setup.sh b/meta-isar/recipes-core/images/files/setup.sh
deleted file mode 100755
index 86c065c..0000000
--- a/meta-isar/recipes-core/images/files/setup.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-#
-# This software is a part of ISAR.
-# Copyright (C) 2015-2016 ilbers GmbH
-#
-# Based on multistrap/examples/chroot.sh
-
-set -e
-
-# The script is called with the following arguments:
-# $1 = $DIR - the top directory of the bootstrapped system
-# $2 = $ARCH - the specified architecture, already checked with
-# dpkg-architecture.
-# setup.sh needs to be executable.
-
-TARGET=$1
-ARCH=$2
-
-# Prevent daemons from starting in postinstall during the initial "dpkg
-# --configure -a" under QEMU on the build host
-if [ -x "$TARGET/sbin/start-stop-daemon" ]; then
- echo "initctl: Trying to prevent daemons from starting in $TARGET"
-
- # Disable start-stop-daemon
- mv $TARGET/sbin/start-stop-daemon $TARGET/sbin/start-stop-daemon.REAL
- cat > $TARGET/sbin/start-stop-daemon << EOF
-#!/bin/sh
-echo
-echo Warning: Fake start-stop-daemon called, doing nothing
-EOF
- chmod 755 $TARGET/sbin/start-stop-daemon
-fi
-
-if [ -x "$TARGET/sbin/initctl" ]; then
- echo "start-stop-daemon: Trying to prevent daemons from starting in $TARGET"
-
- # Disable initctl
- mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
- cat > $TARGET/sbin/initctl << EOF
-#!/bin/sh
-echo
-echo "Warning: Fake initctl called, doing nothing"
-EOF
- chmod 755 $TARGET/sbin/initctl
-fi
-
-# Define sysvinit policy 101 to prevent daemons from starting in postinstall
-# during the initial "dpkg --configure -a" under QEMU on the build host
-if [ -x "$TARGET/sbin/init" -a ! -f "$TARGET/usr/sbin/policy-rc.d" ]; then
- echo "sysvinit: Using policy-rc.d to prevent daemons from starting in $TARGET"
-
- cat > $TARGET/usr/sbin/policy-rc.d << EOF
-#!/bin/sh
-echo "sysvinit: All runlevel operations denied by policy" >&2
-exit 101
-EOF
- chmod a+x $TARGET/usr/sbin/policy-rc.d
-fi
-
-case $ARCH in
- armel|armhf)
- qemu_arch=arm
- ;;
- arm64)
- qemu_arch=aarch64
- ;;
-esac
-
-# Install QEMU emulator to execute foreign binaries
-if [ ! -x /usr/bin/qemu-${qemu_arch}-static ]; then
- echo "qemu-${qemu_arch}-static binary not present, unable to execute target binaries"
-else
- sudo cp /usr/bin/qemu-${qemu_arch}-static ${TARGET}/usr/bin
-fi
-
-# Set hostname
-echo "isar" > $TARGET/etc/hostname
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index b444258..6047dd0 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -9,14 +9,12 @@ LICENSE = "gpl-2.0"
LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:"
-SRC_URI = "file://multistrap.conf.in \
- file://${DISTRO_CONFIG_SCRIPT} \
- file://setup.sh \
- file://download_dev-random"
+SRC_URI = "file://${DISTRO_CONFIG_SCRIPT}"
PV = "1.0"
inherit image
+inherit isar-bootstrap-helper
IMAGE_INSTALL += "linux-image-${KERNEL_NAME}"
@@ -28,50 +26,23 @@ IMAGE_PREINSTALL += "apt \
WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
-do_rootfs[dirs] = "${WORKDIR}/hooks_multistrap"
+do_rootfs[cleandirs] = "${IMAGE_ROOTFS} \
+ ${IMAGE_ROOTFS}/isar-apt"
do_rootfs() {
- E="${@ bb.utils.export_proxies(d)}"
-
- sudo rm -rf ${IMAGE_ROOTFS}
-
- chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
- chmod +x "${WORKDIR}/setup.sh"
- install -m 755 "${WORKDIR}/download_dev-random" "${WORKDIR}/hooks_multistrap/"
-
- # Multistrap accepts only relative path in configuration files, so get it:
- cd ${TOPDIR}
- WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
-
- # Adjust multistrap config
- sed -e 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|g' \
- -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \
- -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \
- -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
- -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \
- -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
- -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
- -e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/${DISTRO_CONFIG_SCRIPT}|g' \
- -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
- -e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
- -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' \
- "${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
-
- # Do not use bitbake flag [dirs] here because this folder should have
- # specific ownership.
- [ ! -d ${IMAGE_ROOTFS}/proc ] && sudo install -d -o 0 -g 0 -m 555 ${IMAGE_ROOTFS}/proc
- sudo mount -t proc none ${IMAGE_ROOTFS}/proc
-
- # Create root filesystem. We must use sudo -E here to preserve the environment
- # because of proxy settings
- sudo -E multistrap -a ${DISTRO_ARCH} -d "${IMAGE_ROOTFS}" -f "${WORKDIR}/multistrap.conf"
+ setup_root_file_system "${IMAGE_ROOTFS}" ${IMAGE_PREINSTALL} ${IMAGE_INSTALL}
# Configure root filesystem
- sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} ${BAUDRATE_TTY} \
- ${ROOTFS_DEV}
- sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
+ sudo install -m 755 "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}" "${IMAGE_ROOTFS}"
+ sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} \
+ ${BAUDRATE_TTY} \
+ ${ROOTFS_DEV}
- sudo umount ${IMAGE_ROOTFS}/proc 2>/dev/null || true
+ # Cleanup
+ sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
+ sudo rm "${IMAGE_ROOTFS}/etc/apt/sources.list.d/isar-apt.list"
+ sudo umount -l ${IMAGE_ROOTFS}/isar-apt
+ sudo rmdir ${IMAGE_ROOTFS}/isar-apt
+ sudo umount -l ${IMAGE_ROOTFS}/dev
+ sudo umount -l ${IMAGE_ROOTFS}/proc
}
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2c255f4..56038b3 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -19,7 +19,7 @@ INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')}"
inherit ${IMAGE_TYPE}
do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
-do_rootfs[depends] = "isar-apt:do_cache_config"
+do_rootfs[depends] = "isar-apt:do_cache_config isar-bootstrap:do_deploy"
do_rootfs() {
die "No root filesystem function defined, please implement in your recipe"
--
2.16.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 4/5] meta-isar/isar-image-base: switch to using isar-bootstrap
2018-02-22 13:19 ` [PATCH v2 4/5] meta-isar/isar-image-base: " claudius.heine.ext
@ 2018-02-23 20:45 ` Jan Kiszka
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2018-02-23 20:45 UTC (permalink / raw)
To: [ext] claudius.heine.ext@siemens.com, isar-users; +Cc: Claudius Heine
On 2018-02-22 14:19, [ext] claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> This patch removes the multistrap dependency of the isar-image-base
> recipe and changes it to use the 'isar-bootstrap' and
> 'isar-bootstrap-helper' instead.
>
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
> .../recipes-core/images/files/download_dev-random | 24 -------
> .../recipes-core/images/files/multistrap.conf.in | 38 -----------
> meta-isar/recipes-core/images/files/setup.sh | 77 ----------------------
> meta-isar/recipes-core/images/isar-image-base.bb | 61 +++++------------
> meta/classes/image.bbclass | 2 +-
> 5 files changed, 17 insertions(+), 185 deletions(-)
> delete mode 100644 meta-isar/recipes-core/images/files/download_dev-random
> delete mode 100644 meta-isar/recipes-core/images/files/multistrap.conf.in
> delete mode 100755 meta-isar/recipes-core/images/files/setup.sh
>
> diff --git a/meta-isar/recipes-core/images/files/download_dev-random b/meta-isar/recipes-core/images/files/download_dev-random
> deleted file mode 100644
> index f7f5fe5..0000000
> --- a/meta-isar/recipes-core/images/files/download_dev-random
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#!/bin/sh
> -#
> -# This software is a part of ISAR.
> -# Copyright (C) 2017 ilbers GmbH
> -
> -set -e
> -
> -readonly ROOTFS="$1"
> -
> -if [ ! -c ${ROOTFS}/dev/random ]; then
> - rm -f ${ROOTFS}/dev/random
> - mknod "${ROOTFS}/dev/random" c 1 8
> - chmod 666 "${ROOTFS}/dev/random"
> - chown 0:0 "${ROOTFS}/dev/random"
> -fi
> -
> -if [ ! -c ${ROOTFS}/dev/urandom ]; then
> - rm -f ${ROOTFS}/dev/urandom
> - mknod "${ROOTFS}/dev/urandom" c 1 9
> - chmod 666 "${ROOTFS}/dev/urandom"
> - chown 0:0 "${ROOTFS}/dev/urandom"
> -fi
> -
> -exit 0
> diff --git a/meta-isar/recipes-core/images/files/multistrap.conf.in b/meta-isar/recipes-core/images/files/multistrap.conf.in
> deleted file mode 100644
> index 432b6af..0000000
> --- a/meta-isar/recipes-core/images/files/multistrap.conf.in
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -# This software is a part of ISAR.
> -# Copyright (C) 2015-2017 ilbers GmbH
> -
> -[General]
> -noauth=true
> -unpack=true
> -ignorenativearch=true
> -bootstrap=##DISTRO_MULTICONF_BOOTSTRAP## Isar
> -aptsources=##DISTRO_MULTICONF_APTSOURCES##
> -configscript=##CONFIG_SCRIPT##
> -setupscript=##SETUP_SCRIPT##
> -hookdir=##DIR_HOOKS##
> -
> -[base]
> -source=##DISTRO_APT_SOURCE##
> -suite=##DISTRO_SUITE##
> -components=##DISTRO_COMPONENTS##
> -packages=##IMAGE_PREINSTALL##
> -omitdebsrc=true
> -
> -[updates]
> -source=##DISTRO_APT_SOURCE##
> -suite=##DISTRO_SUITE##-updates
> -components=##DISTRO_COMPONENTS##
> -omitdebsrc=true
> -
> -[security]
> -source=##DISTRO_APT_SOURCE_SEC##
> -suite=##DISTRO_SUITE##/updates
> -components=##DISTRO_COMPONENTS##
> -omitdebsrc=true
> -
> -[Isar]
> -packages=##IMAGE_INSTALL##
> -source=##DEPLOY_DIR_APT##
> -suite=##ISAR_DISTRO_SUITE##
> -components=main
> -omitdebsrc=true
> diff --git a/meta-isar/recipes-core/images/files/setup.sh b/meta-isar/recipes-core/images/files/setup.sh
> deleted file mode 100755
> index 86c065c..0000000
> --- a/meta-isar/recipes-core/images/files/setup.sh
> +++ /dev/null
> @@ -1,77 +0,0 @@
> -#!/bin/sh
> -#
> -# This software is a part of ISAR.
> -# Copyright (C) 2015-2016 ilbers GmbH
> -#
> -# Based on multistrap/examples/chroot.sh
> -
> -set -e
> -
> -# The script is called with the following arguments:
> -# $1 = $DIR - the top directory of the bootstrapped system
> -# $2 = $ARCH - the specified architecture, already checked with
> -# dpkg-architecture.
> -# setup.sh needs to be executable.
> -
> -TARGET=$1
> -ARCH=$2
> -
> -# Prevent daemons from starting in postinstall during the initial "dpkg
> -# --configure -a" under QEMU on the build host
> -if [ -x "$TARGET/sbin/start-stop-daemon" ]; then
> - echo "initctl: Trying to prevent daemons from starting in $TARGET"
> -
> - # Disable start-stop-daemon
> - mv $TARGET/sbin/start-stop-daemon $TARGET/sbin/start-stop-daemon.REAL
> - cat > $TARGET/sbin/start-stop-daemon << EOF
> -#!/bin/sh
> -echo
> -echo Warning: Fake start-stop-daemon called, doing nothing
> -EOF
> - chmod 755 $TARGET/sbin/start-stop-daemon
> -fi
> -
> -if [ -x "$TARGET/sbin/initctl" ]; then
> - echo "start-stop-daemon: Trying to prevent daemons from starting in $TARGET"
> -
> - # Disable initctl
> - mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
> - cat > $TARGET/sbin/initctl << EOF
> -#!/bin/sh
> -echo
> -echo "Warning: Fake initctl called, doing nothing"
> -EOF
> - chmod 755 $TARGET/sbin/initctl
> -fi
> -
> -# Define sysvinit policy 101 to prevent daemons from starting in postinstall
> -# during the initial "dpkg --configure -a" under QEMU on the build host
> -if [ -x "$TARGET/sbin/init" -a ! -f "$TARGET/usr/sbin/policy-rc.d" ]; then
> - echo "sysvinit: Using policy-rc.d to prevent daemons from starting in $TARGET"
> -
> - cat > $TARGET/usr/sbin/policy-rc.d << EOF
> -#!/bin/sh
> -echo "sysvinit: All runlevel operations denied by policy" >&2
> -exit 101
> -EOF
> - chmod a+x $TARGET/usr/sbin/policy-rc.d
> -fi
> -
> -case $ARCH in
> - armel|armhf)
> - qemu_arch=arm
> - ;;
> - arm64)
> - qemu_arch=aarch64
> - ;;
> -esac
> -
> -# Install QEMU emulator to execute foreign binaries
> -if [ ! -x /usr/bin/qemu-${qemu_arch}-static ]; then
> - echo "qemu-${qemu_arch}-static binary not present, unable to execute target binaries"
> -else
> - sudo cp /usr/bin/qemu-${qemu_arch}-static ${TARGET}/usr/bin
> -fi
> -
> -# Set hostname
> -echo "isar" > $TARGET/etc/hostname
> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
> index b444258..6047dd0 100644
> --- a/meta-isar/recipes-core/images/isar-image-base.bb
> +++ b/meta-isar/recipes-core/images/isar-image-base.bb
> @@ -9,14 +9,12 @@ LICENSE = "gpl-2.0"
> LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
>
> FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:"
> -SRC_URI = "file://multistrap.conf.in \
> - file://${DISTRO_CONFIG_SCRIPT} \
> - file://setup.sh \
> - file://download_dev-random"
> +SRC_URI = "file://${DISTRO_CONFIG_SCRIPT}"
>
> PV = "1.0"
>
> inherit image
> +inherit isar-bootstrap-helper
>
> IMAGE_INSTALL += "linux-image-${KERNEL_NAME}"
>
> @@ -28,50 +26,23 @@ IMAGE_PREINSTALL += "apt \
>
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> -do_rootfs[dirs] = "${WORKDIR}/hooks_multistrap"
> +do_rootfs[cleandirs] = "${IMAGE_ROOTFS} \
> + ${IMAGE_ROOTFS}/isar-apt"
Same issue as with the buildchroot: cleaning does not work.
Jan
>
> do_rootfs() {
> - E="${@ bb.utils.export_proxies(d)}"
> -
> - sudo rm -rf ${IMAGE_ROOTFS}
> -
> - chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
> - chmod +x "${WORKDIR}/setup.sh"
> - install -m 755 "${WORKDIR}/download_dev-random" "${WORKDIR}/hooks_multistrap/"
> -
> - # Multistrap accepts only relative path in configuration files, so get it:
> - cd ${TOPDIR}
> - WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
> -
> - # Adjust multistrap config
> - sed -e 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|g' \
> - -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \
> - -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \
> - -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> - -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \
> - -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> - -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> - -e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/${DISTRO_CONFIG_SCRIPT}|g' \
> - -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
> - -e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
> - -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' \
> - "${WORKDIR}/multistrap.conf.in" > "${WORKDIR}/multistrap.conf"
> -
> - # Do not use bitbake flag [dirs] here because this folder should have
> - # specific ownership.
> - [ ! -d ${IMAGE_ROOTFS}/proc ] && sudo install -d -o 0 -g 0 -m 555 ${IMAGE_ROOTFS}/proc
> - sudo mount -t proc none ${IMAGE_ROOTFS}/proc
> -
> - # Create root filesystem. We must use sudo -E here to preserve the environment
> - # because of proxy settings
> - sudo -E multistrap -a ${DISTRO_ARCH} -d "${IMAGE_ROOTFS}" -f "${WORKDIR}/multistrap.conf"
> + setup_root_file_system "${IMAGE_ROOTFS}" ${IMAGE_PREINSTALL} ${IMAGE_INSTALL}
>
> # Configure root filesystem
> - sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} ${BAUDRATE_TTY} \
> - ${ROOTFS_DEV}
> - sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
> + sudo install -m 755 "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}" "${IMAGE_ROOTFS}"
> + sudo chroot ${IMAGE_ROOTFS} /${DISTRO_CONFIG_SCRIPT} ${MACHINE_SERIAL} \
> + ${BAUDRATE_TTY} \
> + ${ROOTFS_DEV}
>
> - sudo umount ${IMAGE_ROOTFS}/proc 2>/dev/null || true
> + # Cleanup
> + sudo rm "${IMAGE_ROOTFS}/${DISTRO_CONFIG_SCRIPT}"
> + sudo rm "${IMAGE_ROOTFS}/etc/apt/sources.list.d/isar-apt.list"
> + sudo umount -l ${IMAGE_ROOTFS}/isar-apt
> + sudo rmdir ${IMAGE_ROOTFS}/isar-apt
> + sudo umount -l ${IMAGE_ROOTFS}/dev
> + sudo umount -l ${IMAGE_ROOTFS}/proc
> }
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 2c255f4..56038b3 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -19,7 +19,7 @@ INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')}"
> inherit ${IMAGE_TYPE}
>
> do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
> -do_rootfs[depends] = "isar-apt:do_cache_config"
> +do_rootfs[depends] = "isar-apt:do_cache_config isar-bootstrap:do_deploy"
>
> do_rootfs() {
> die "No root filesystem function defined, please implement in your recipe"
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 5/5] meta-isar/multiconfig: remove multistrap references
2018-02-22 13:18 [PATCH v2 0/5] Debootstrap integration claudius.heine.ext
` (3 preceding siblings ...)
2018-02-22 13:19 ` [PATCH v2 4/5] meta-isar/isar-image-base: " claudius.heine.ext
@ 2018-02-22 13:19 ` claudius.heine.ext
2018-02-23 20:46 ` Jan Kiszka
2018-02-22 14:21 ` [PATCH v2 0/5] Debootstrap integration Alexander Smirnov
5 siblings, 1 reply; 15+ messages in thread
From: claudius.heine.ext @ 2018-02-22 13:19 UTC (permalink / raw)
To: isar-users; +Cc: Claudius Heine
From: Claudius Heine <ch@denx.de>
This patch removes the left-over references to multistrap from the
configuration files.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta-isar/conf/distro/debian-jessie.conf | 5 -----
meta-isar/conf/distro/debian-stretch.conf | 5 -----
meta-isar/conf/distro/debian-wheezy.conf | 5 -----
meta-isar/conf/distro/raspbian-jessie.conf | 5 -----
meta-isar/conf/multiconfig/qemuarm-jessie.conf | 2 +-
meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 2 +-
meta-isar/conf/multiconfig/rpi-jessie.conf | 2 +-
7 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/meta-isar/conf/distro/debian-jessie.conf b/meta-isar/conf/distro/debian-jessie.conf
index d7efa63..ce7d049 100644
--- a/meta-isar/conf/distro/debian-jessie.conf
+++ b/meta-isar/conf/distro/debian-jessie.conf
@@ -13,8 +13,3 @@ DISTRO_KERNELS ?= "486 4kc-malta 586 5kc-malta 686-pae amd64 arm64 armmp \
armmp-lpae ixp4xx kirkwood loongson-2e loongson-2f loongson-3 octeon \
orion5x powerpc powerpc-smp powerpc64 powerpc64le r4k-ip22 r5k-ip32 \
s390x sb1-bcm91250a versatile"
-
-# No longer needed:
-DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
-DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
index 26a08c5..000317b 100644
--- a/meta-isar/conf/distro/debian-stretch.conf
+++ b/meta-isar/conf/distro/debian-stretch.conf
@@ -10,8 +10,3 @@ DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_KERNELS ?= "4kc-malta 586 5kc-malta 686 686-pae amd64 arm64 armmp \
armmp-lpae kirkwood loongson-3 marvell octeon orion5x powerpc64le \
rt-686-pae rt-amd64 s390x"
-
-# No longer needed:
-DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
-DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/distro/debian-wheezy.conf b/meta-isar/conf/distro/debian-wheezy.conf
index de7a10f..e9065f5 100644
--- a/meta-isar/conf/distro/debian-wheezy.conf
+++ b/meta-isar/conf/distro/debian-wheezy.conf
@@ -11,8 +11,3 @@ DISTRO_APT_SOURCES += "conf/distro/debian-wheezy.list"
DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
DISTRO_KERNELS ?= "486 686-pae amd64 rt-686-pae rt-amd64 versatile vexpress \
iop32x ixp4xx kirkwood mv78xx0 mx5 omap orion5x"
-
-# No longer needed:
-DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
-DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
index 0d66905..51d3023 100644
--- a/meta-isar/conf/distro/raspbian-jessie.conf
+++ b/meta-isar/conf/distro/raspbian-jessie.conf
@@ -9,8 +9,3 @@ DISTRO_COMPONENTS ?= "main contrib non-free firmware"
DISTRO_APT_SOURCE ?= "http://archive.raspbian.org/raspbian"
DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
-
-# No longer needed:
-DISTRO_APT_SOURCE_SEC ?= ""
-DISTRO_MULTICONF_BOOTSTRAP ?= "base"
-DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
index 74fb7d9..fe1d760 100644
--- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
@@ -9,7 +9,7 @@
# This sets the default machine to be qemuarm in this configuration:
MACHINE ?= "qemuarm"
-# This sets the default multistrap configuration:
+# This sets the default distribution configuration:
DISTRO ?= "debian-jessie"
DISTRO_ARCH ?= "armhf"
diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
index 11355a4..c573254 100644
--- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
+++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
@@ -9,7 +9,7 @@
# This sets the default machine to be qemuarm in this configuration:
MACHINE ?= "qemuarm"
-# This sets the default multistrap configuration:
+# This sets the default distribution configuration:
DISTRO ?= "debian-wheezy"
DISTRO_ARCH ?= "armhf"
diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
index 3f33731..fcc10d9 100644
--- a/meta-isar/conf/multiconfig/rpi-jessie.conf
+++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
@@ -9,7 +9,7 @@
# This sets the default machine to be rpi in this configuration:
MACHINE ?= "rpi"
-# This sets the default multistrap configuration:
+# This sets the default distribution configuration:
DISTRO ?= "raspbian-jessie"
DISTRO_ARCH ?= "armhf"
--
2.16.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 5/5] meta-isar/multiconfig: remove multistrap references
2018-02-22 13:19 ` [PATCH v2 5/5] meta-isar/multiconfig: remove multistrap references claudius.heine.ext
@ 2018-02-23 20:46 ` Jan Kiszka
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2018-02-23 20:46 UTC (permalink / raw)
To: [ext] claudius.heine.ext@siemens.com, isar-users; +Cc: Claudius Heine
On 2018-02-22 14:19, [ext] claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> This patch removes the left-over references to multistrap from the
> configuration files.
>
There is more (ignoring the manual for now):
meta-isar/conf/local.conf.sample
Jan
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
> meta-isar/conf/distro/debian-jessie.conf | 5 -----
> meta-isar/conf/distro/debian-stretch.conf | 5 -----
> meta-isar/conf/distro/debian-wheezy.conf | 5 -----
> meta-isar/conf/distro/raspbian-jessie.conf | 5 -----
> meta-isar/conf/multiconfig/qemuarm-jessie.conf | 2 +-
> meta-isar/conf/multiconfig/qemuarm-wheezy.conf | 2 +-
> meta-isar/conf/multiconfig/rpi-jessie.conf | 2 +-
> 7 files changed, 3 insertions(+), 23 deletions(-)
>
> diff --git a/meta-isar/conf/distro/debian-jessie.conf b/meta-isar/conf/distro/debian-jessie.conf
> index d7efa63..ce7d049 100644
> --- a/meta-isar/conf/distro/debian-jessie.conf
> +++ b/meta-isar/conf/distro/debian-jessie.conf
> @@ -13,8 +13,3 @@ DISTRO_KERNELS ?= "486 4kc-malta 586 5kc-malta 686-pae amd64 arm64 armmp \
> armmp-lpae ixp4xx kirkwood loongson-2e loongson-2f loongson-3 octeon \
> orion5x powerpc powerpc-smp powerpc64 powerpc64le r4k-ip22 r5k-ip32 \
> s390x sb1-bcm91250a versatile"
> -
> -# No longer needed:
> -DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/distro/debian-stretch.conf b/meta-isar/conf/distro/debian-stretch.conf
> index 26a08c5..000317b 100644
> --- a/meta-isar/conf/distro/debian-stretch.conf
> +++ b/meta-isar/conf/distro/debian-stretch.conf
> @@ -10,8 +10,3 @@ DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
> DISTRO_KERNELS ?= "4kc-malta 586 5kc-malta 686 686-pae amd64 arm64 armmp \
> armmp-lpae kirkwood loongson-3 marvell octeon orion5x powerpc64le \
> rt-686-pae rt-amd64 s390x"
> -
> -# No longer needed:
> -DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/distro/debian-wheezy.conf b/meta-isar/conf/distro/debian-wheezy.conf
> index de7a10f..e9065f5 100644
> --- a/meta-isar/conf/distro/debian-wheezy.conf
> +++ b/meta-isar/conf/distro/debian-wheezy.conf
> @@ -11,8 +11,3 @@ DISTRO_APT_SOURCES += "conf/distro/debian-wheezy.list"
> DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
> DISTRO_KERNELS ?= "486 686-pae amd64 rt-686-pae rt-amd64 versatile vexpress \
> iop32x ixp4xx kirkwood mv78xx0 mx5 omap orion5x"
> -
> -# No longer needed:
> -DISTRO_APT_SOURCE_SEC ?= "http://security.debian.org/debian-security"
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base updates security"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
> index 0d66905..51d3023 100644
> --- a/meta-isar/conf/distro/raspbian-jessie.conf
> +++ b/meta-isar/conf/distro/raspbian-jessie.conf
> @@ -9,8 +9,3 @@ DISTRO_COMPONENTS ?= "main contrib non-free firmware"
> DISTRO_APT_SOURCE ?= "http://archive.raspbian.org/raspbian"
> DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
> DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
> -
> -# No longer needed:
> -DISTRO_APT_SOURCE_SEC ?= ""
> -DISTRO_MULTICONF_BOOTSTRAP ?= "base"
> -DISTRO_MULTICONF_APTSOURCES ?= "${DISTRO_MULTICONF_BOOTSTRAP}"
> diff --git a/meta-isar/conf/multiconfig/qemuarm-jessie.conf b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
> index 74fb7d9..fe1d760 100644
> --- a/meta-isar/conf/multiconfig/qemuarm-jessie.conf
> +++ b/meta-isar/conf/multiconfig/qemuarm-jessie.conf
> @@ -9,7 +9,7 @@
> # This sets the default machine to be qemuarm in this configuration:
> MACHINE ?= "qemuarm"
>
> -# This sets the default multistrap configuration:
> +# This sets the default distribution configuration:
> DISTRO ?= "debian-jessie"
> DISTRO_ARCH ?= "armhf"
>
> diff --git a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
> index 11355a4..c573254 100644
> --- a/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
> +++ b/meta-isar/conf/multiconfig/qemuarm-wheezy.conf
> @@ -9,7 +9,7 @@
> # This sets the default machine to be qemuarm in this configuration:
> MACHINE ?= "qemuarm"
>
> -# This sets the default multistrap configuration:
> +# This sets the default distribution configuration:
> DISTRO ?= "debian-wheezy"
> DISTRO_ARCH ?= "armhf"
>
> diff --git a/meta-isar/conf/multiconfig/rpi-jessie.conf b/meta-isar/conf/multiconfig/rpi-jessie.conf
> index 3f33731..fcc10d9 100644
> --- a/meta-isar/conf/multiconfig/rpi-jessie.conf
> +++ b/meta-isar/conf/multiconfig/rpi-jessie.conf
> @@ -9,7 +9,7 @@
> # This sets the default machine to be rpi in this configuration:
> MACHINE ?= "rpi"
>
> -# This sets the default multistrap configuration:
> +# This sets the default distribution configuration:
> DISTRO ?= "raspbian-jessie"
> DISTRO_ARCH ?= "armhf"
>
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/5] Debootstrap integration
2018-02-22 13:18 [PATCH v2 0/5] Debootstrap integration claudius.heine.ext
` (4 preceding siblings ...)
2018-02-22 13:19 ` [PATCH v2 5/5] meta-isar/multiconfig: remove multistrap references claudius.heine.ext
@ 2018-02-22 14:21 ` Alexander Smirnov
2018-02-22 18:09 ` Jan Kiszka
2018-02-23 7:40 ` Claudius Heine
5 siblings, 2 replies; 15+ messages in thread
From: Alexander Smirnov @ 2018-02-22 14:21 UTC (permalink / raw)
To: claudius.heine.ext, isar-users; +Cc: Claudius Heine
On 02/22/2018 04:18 PM, claudius.heine.ext@siemens.com wrote:
> From: Claudius Heine <ch@denx.de>
>
> Hi,
>
> this is the new rebased and fixed version of this patchset.
>
> Cheers,
> Claudius
>
> Changes from v1:
> - rebased to current next
> - added unmounting of /dev and /proc at the end of do_rootfs in isar-image-base
> This was necessary for image file creation, otherwise it tried to
> package stuff from the host.
> - added 'isar-bootstrap:do_deploy' dependency to do_rootfs task in
> image.bbclass.
> - Changed 'RFSDIR' variable name to 'ROOTFSDIR' in
> isar-bootstrap-helper.bbclass to be consistent with the variable
> name in isar-bootstrap.bb
> - Moved 'isar-apt' apt-preference settings from isar-bootstrap.bb to
> isar-bootstrap-helper.bbclass
> - Removed '--no-install-recommends' parameters in favor of adding the
> apt configuration in 'isar-bootstrap.bb'
> - unmount and remove possible existing bootstraped directories before
> bootstrapping in do_bootstrap task of 'isar-bootstrap.bb'
> - changed from /dev ro bind mounts to mounting devtmpfs to /dev to be
> consistent with the other places where /dev is mounted.
>
$ time bitbake multiconfig:qemuarm-wheezy:isar-image-base
multiconfig:qemuarm-jessie:isar-image-base
multiconfig:qemuarm-stretch:isar-image-base
multiconfig:qemui386-jessie:isar-image-base
multiconfig:qemui386-stretch:isar-image-base
multiconfig:qemuamd64-jessie:isar-image-base
multiconfig:qemuamd64-stretch:isar-image-base
multiconfig:rpi-jessie:isar-image-base
multiconfig:qemuarm64-stretch:isar-image-base
ERROR: mc:rpi-jessie:isar-bootstrap-1.0-r0 do_bootstrap: Function
failed: do_bootstrap (log file is located at
/home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
ERROR: Logfile of failure stored in:
/home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
ERROR: Task
(multiconfig:rpi-jessie:/home/builder/isar/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb:do_bootstrap)
failed with exit code '1'
builder@zbook:~/isar$ cat
/home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
DEBUG: Executing shell function do_bootstrap
I: Running command: debootstrap --arch armhf --foreign --verbose
--variant minbase --components=main,contrib,non-free,firmware jessie
/home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/rootfs
http://archive.raspbian.org/raspbian
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
E: Release signed by unknown key (key id 9165938D90FDDD2E)
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_bootstrap (log file is located at
/home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
Alex
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/5] Debootstrap integration
2018-02-22 14:21 ` [PATCH v2 0/5] Debootstrap integration Alexander Smirnov
@ 2018-02-22 18:09 ` Jan Kiszka
2018-02-23 7:40 ` Claudius Heine
1 sibling, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2018-02-22 18:09 UTC (permalink / raw)
To: Alexander Smirnov, claudius.heine.ext, isar-users; +Cc: Claudius Heine
On 2018-02-22 15:21, Alexander Smirnov wrote:
> On 02/22/2018 04:18 PM, claudius.heine.ext@siemens.com wrote:
>> From: Claudius Heine <ch@denx.de>
>>
>> Hi,
>>
>> this is the new rebased and fixed version of this patchset.
>>
>> Cheers,
>> Claudius
>>
>> Changes from v1:
>> - rebased to current next
>> - added unmounting of /dev and /proc at the end of do_rootfs in
>> isar-image-base
>> This was necessary for image file creation, otherwise it tried to
>> package stuff from the host.
>> - added 'isar-bootstrap:do_deploy' dependency to do_rootfs task in
>> image.bbclass.
>> - Changed 'RFSDIR' variable name to 'ROOTFSDIR' in
>> isar-bootstrap-helper.bbclass to be consistent with the variable
>> name in isar-bootstrap.bb
>> - Moved 'isar-apt' apt-preference settings from isar-bootstrap.bb to
>> isar-bootstrap-helper.bbclass
>> - Removed '--no-install-recommends' parameters in favor of adding the
>> apt configuration in 'isar-bootstrap.bb'
>> - unmount and remove possible existing bootstraped directories before
>> bootstrapping in do_bootstrap task of 'isar-bootstrap.bb'
>> - changed from /dev ro bind mounts to mounting devtmpfs to /dev to be
>> consistent with the other places where /dev is mounted.
>>
>
> $ time bitbake multiconfig:qemuarm-wheezy:isar-image-base
> multiconfig:qemuarm-jessie:isar-image-base
> multiconfig:qemuarm-stretch:isar-image-base
> multiconfig:qemui386-jessie:isar-image-base
> multiconfig:qemui386-stretch:isar-image-base
> multiconfig:qemuamd64-jessie:isar-image-base
> multiconfig:qemuamd64-stretch:isar-image-base
> multiconfig:rpi-jessie:isar-image-base
> multiconfig:qemuarm64-stretch:isar-image-base
>
> ERROR: mc:rpi-jessie:isar-bootstrap-1.0-r0 do_bootstrap: Function
> failed: do_bootstrap (log file is located at
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
>
> ERROR: Logfile of failure stored in:
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
>
> ERROR: Task
> (multiconfig:rpi-jessie:/home/builder/isar/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb:do_bootstrap)
> failed with exit code '1'
>
> builder@zbook:~/isar$ cat
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
>
> DEBUG: Executing shell function do_bootstrap
> I: Running command: debootstrap --arch armhf --foreign --verbose
> --variant minbase --components=main,contrib,non-free,firmware jessie
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/rootfs
> http://archive.raspbian.org/raspbian
> I: Retrieving Release
> I: Retrieving Release.gpg
> I: Checking Release signature
> E: Release signed by unknown key (key id 9165938D90FDDD2E)
> WARNING: exit code 1 from a shell command.
> ERROR: Function failed: do_bootstrap (log file is located at
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
>
Looks like we are lucky that the other bootstraps work, maybe due to the
keys installed on the host: there are no key rings specified so far.
Jan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/5] Debootstrap integration
2018-02-22 14:21 ` [PATCH v2 0/5] Debootstrap integration Alexander Smirnov
2018-02-22 18:09 ` Jan Kiszka
@ 2018-02-23 7:40 ` Claudius Heine
2018-02-23 20:35 ` Jan Kiszka
1 sibling, 1 reply; 15+ messages in thread
From: Claudius Heine @ 2018-02-23 7:40 UTC (permalink / raw)
To: Alexander Smirnov, claudius.heine.ext, isar-users
[-- Attachment #1.1: Type: text/plain, Size: 4079 bytes --]
Hi Alex,
On 02/22/2018 03:21 PM, Alexander Smirnov wrote:
> On 02/22/2018 04:18 PM, claudius.heine.ext@siemens.com wrote:
>> From: Claudius Heine <ch@denx.de>
>>
>> Hi,
>>
>> this is the new rebased and fixed version of this patchset.
>>
>> Cheers,
>> Claudius
>>
>> Changes from v1:
>> - rebased to current next
>> - added unmounting of /dev and /proc at the end of do_rootfs in
>> isar-image-base
>> This was necessary for image file creation, otherwise it tried to
>> package stuff from the host.
>> - added 'isar-bootstrap:do_deploy' dependency to do_rootfs task in
>> image.bbclass.
>> - Changed 'RFSDIR' variable name to 'ROOTFSDIR' in
>> isar-bootstrap-helper.bbclass to be consistent with the variable
>> name in isar-bootstrap.bb
>> - Moved 'isar-apt' apt-preference settings from isar-bootstrap.bb to
>> isar-bootstrap-helper.bbclass
>> - Removed '--no-install-recommends' parameters in favor of adding the
>> apt configuration in 'isar-bootstrap.bb'
>> - unmount and remove possible existing bootstraped directories before
>> bootstrapping in do_bootstrap task of 'isar-bootstrap.bb'
>> - changed from /dev ro bind mounts to mounting devtmpfs to /dev to be
>> consistent with the other places where /dev is mounted.
>>
>
> $ time bitbake multiconfig:qemuarm-wheezy:isar-image-base
> multiconfig:qemuarm-jessie:isar-image-base
> multiconfig:qemuarm-stretch:isar-image-base
> multiconfig:qemui386-jessie:isar-image-base
> multiconfig:qemui386-stretch:isar-image-base
> multiconfig:qemuamd64-jessie:isar-image-base
> multiconfig:qemuamd64-stretch:isar-image-base
> multiconfig:rpi-jessie:isar-image-base
> multiconfig:qemuarm64-stretch:isar-image-base
>
> ERROR: mc:rpi-jessie:isar-bootstrap-1.0-r0 do_bootstrap: Function
> failed: do_bootstrap (log file is located at
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
>
> ERROR: Logfile of failure stored in:
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
>
> ERROR: Task
> (multiconfig:rpi-jessie:/home/builder/isar/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb:do_bootstrap)
> failed with exit code '1'
>
> builder@zbook:~/isar$ cat
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
>
> DEBUG: Executing shell function do_bootstrap
> I: Running command: debootstrap --arch armhf --foreign --verbose
> --variant minbase --components=main,contrib,non-free,firmware jessie
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/rootfs
> http://archive.raspbian.org/raspbian
> I: Retrieving Release
> I: Retrieving Release.gpg
> I: Checking Release signature
> E: Release signed by unknown key (key id 9165938D90FDDD2E)
> WARNING: exit code 1 from a shell command.
> ERROR: Function failed: do_bootstrap (log file is located at
> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
Thx.
Is that the only issue that occured? In other words do all the other
targets where the key was available on the host run through without any
problems and the resulting image looks good? I am just asking to
decrease iteration over the testing-fixing cycle. If that is the only
problem, then I guess that this patchset can be merged after I
successfully fixed the usage of repository keys, right?
Since I am at the Embedded World as well, fixing this will be done in
the week after the following one.
Thanks again,
Claudius
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de
PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
Keyserver: hkp://pool.sks-keyservers.net
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/5] Debootstrap integration
2018-02-23 7:40 ` Claudius Heine
@ 2018-02-23 20:35 ` Jan Kiszka
2018-02-26 6:43 ` Jan Kiszka
0 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2018-02-23 20:35 UTC (permalink / raw)
To: Claudius Heine, Alexander Smirnov, claudius.heine.ext, isar-users
On 2018-02-23 08:40, Claudius Heine wrote:
> Hi Alex,
>
> On 02/22/2018 03:21 PM, Alexander Smirnov wrote:
>> On 02/22/2018 04:18 PM, claudius.heine.ext@siemens.com wrote:
>>> From: Claudius Heine <ch@denx.de>
>>>
>>> Hi,
>>>
>>> this is the new rebased and fixed version of this patchset.
>>>
>>> Cheers,
>>> Claudius
>>>
>>> Changes from v1:
>>> - rebased to current next
>>> - added unmounting of /dev and /proc at the end of do_rootfs in
>>> isar-image-base
>>> This was necessary for image file creation, otherwise it tried to
>>> package stuff from the host.
>>> - added 'isar-bootstrap:do_deploy' dependency to do_rootfs task in
>>> image.bbclass.
>>> - Changed 'RFSDIR' variable name to 'ROOTFSDIR' in
>>> isar-bootstrap-helper.bbclass to be consistent with the variable
>>> name in isar-bootstrap.bb
>>> - Moved 'isar-apt' apt-preference settings from isar-bootstrap.bb to
>>> isar-bootstrap-helper.bbclass
>>> - Removed '--no-install-recommends' parameters in favor of adding the
>>> apt configuration in 'isar-bootstrap.bb'
>>> - unmount and remove possible existing bootstraped directories before
>>> bootstrapping in do_bootstrap task of 'isar-bootstrap.bb'
>>> - changed from /dev ro bind mounts to mounting devtmpfs to /dev to be
>>> consistent with the other places where /dev is mounted.
>>>
>>
>> $ time bitbake multiconfig:qemuarm-wheezy:isar-image-base
>> multiconfig:qemuarm-jessie:isar-image-base
>> multiconfig:qemuarm-stretch:isar-image-base
>> multiconfig:qemui386-jessie:isar-image-base
>> multiconfig:qemui386-stretch:isar-image-base
>> multiconfig:qemuamd64-jessie:isar-image-base
>> multiconfig:qemuamd64-stretch:isar-image-base
>> multiconfig:rpi-jessie:isar-image-base
>> multiconfig:qemuarm64-stretch:isar-image-base
>>
>> ERROR: mc:rpi-jessie:isar-bootstrap-1.0-r0 do_bootstrap: Function
>> failed: do_bootstrap (log file is located at
>> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
>>
>> ERROR: Logfile of failure stored in:
>> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
>>
>> ERROR: Task
>> (multiconfig:rpi-jessie:/home/builder/isar/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb:do_bootstrap)
>> failed with exit code '1'
>>
>> builder@zbook:~/isar$ cat
>> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056
>>
>> DEBUG: Executing shell function do_bootstrap
>> I: Running command: debootstrap --arch armhf --foreign --verbose
>> --variant minbase --components=main,contrib,non-free,firmware jessie
>> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/rootfs
>> http://archive.raspbian.org/raspbian
>> I: Retrieving Release
>> I: Retrieving Release.gpg
>> I: Checking Release signature
>> E: Release signed by unknown key (key id 9165938D90FDDD2E)
>> WARNING: exit code 1 from a shell command.
>> ERROR: Function failed: do_bootstrap (log file is located at
>> /home/builder/isar/build/tmp/work/raspbian-jessie-armhf/isar-bootstrap/temp/log.do_bootstrap.29056)
>
> Thx.
>
> Is that the only issue that occured? In other words do all the other
> targets where the key was available on the host run through without any
> problems and the resulting image looks good? I am just asking to
> decrease iteration over the testing-fixing cycle. If that is the only
> problem, then I guess that this patchset can be merged after I
> successfully fixed the usage of repository keys, right?
There are some more issues, will comment on them in the patches.
This one here consists of several problems. First, we are missing the
Raspbian repo key. The question is how to obtain it. We could do this:
---8<---
From: Jan Kiszka <jan.kiszka@siemens.com>
Subject: [PATCH] Carry Raspbian public key ring
debootstrap only contains the Debian keys and requires a specific one
for other bootstrap repositories. One of them we support is Raspbian.
This imports the Raspbian public key in GPG format and makes them
available for bootstrapping by defining DISTRO_KEYRING in the distro
conf.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta-isar/conf/distro/raspbian-jessie.conf | 1 +
.../isar-bootstrap/files/raspbian.public.key.gpg | Bin 0 -> 1225 bytes
meta/recipes-core/isar-bootstrap/isar-bootstrap.bb | 10 ++++++++--
3 files changed, 9 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-core/isar-bootstrap/files/raspbian.public.key.gpg
diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
index 51d3023..89b769f 100644
--- a/meta-isar/conf/distro/raspbian-jessie.conf
+++ b/meta-isar/conf/distro/raspbian-jessie.conf
@@ -9,3 +9,4 @@ DISTRO_COMPONENTS ?= "main contrib non-free firmware"
DISTRO_APT_SOURCE ?= "http://archive.raspbian.org/raspbian"
DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
+DISTRO_KEYRING ?= "raspbian.public.key.gpg"
diff --git a/meta/recipes-core/isar-bootstrap/files/raspbian.public.key.gpg b/meta/recipes-core/isar-bootstrap/files/raspbian.public.key.gpg
new file mode 100644
index 0000000000000000000000000000000000000000..c438c3e4c06d6c679db3071c9bdda71416a99b35
GIT binary patch
literal 1225
zcmV;)1UCDb0SyFCc*1D`2msGpm>Th%h_P)c%5B{Gj^+H_Vx<@C+wVtcMV`p^QtJm(
zbt-pSjSf2f>lpyXa#ruMvl*a~bH)1r4uc;)MCe)%sbh>c#z@(>gCXt%zmPi`IKcBc
z1hyn0(A*d@ut#D`JhgPk_BZ_ED2q-|uPxdFH$h_Xd)JqP<uBn?EkN&+M?UDNvoCH9
z_6t^_4fwd%ubA#?DHSo{@}N$IlSYBsw&O)>=pRi8Y_L0PW&6Wj^RQBVSOQG@Z)vw5
z)exaU-m)Kpxmhg;7T+P}`5c0hS8Ka5QzA$ID<@INY+w(z2S*Q3r5UcakumY^UJ^D`
z+EKZdQlTX$@Azb2fMoy?0RRECN=<2NWgt{&Z*6dMZ*CwcQeks&Vr6o2c_2_}AVg(i
zX<=?4VRCI~W*|XQO?EabRz^@MAUthwbZBpFaC2{NKxb`XX>2ZIZ*4w_0XPH`0RjLb
z1p-fa!f65<0|pBT2nPcK1{DYb2?`4Y76JnS0v-VZ7k~f?2@sKGlZ}x5-7cXD2mr+U
z<@g5B*u))XINMIJq>orm-9Iyr{EI)wPl244p;iBDNtkx%)qpnz41HSJ^of-DA?Fs$
zm>QB{Z>ghd<eXmD&EOi{rqH)&@L`uA6tdm7ukf(qzB5>xn0m6!0>Y-u?Z%Ez7>lWg
z^F=L#1%)Zp9CcLQmnBHe5P#VlVw8Jhr!m<WH<pX61;sI^cWf;jpP~41lF2F`C=ATk
zW^JA%$7bZxia4Sp-7SX*vUCv!;^G{*#1Y6BuHL?I3QjNhy&C*>c!sg|olpAY>`-+i
zrwJ(19;YDJ)c^R?e1udv)D)L=(q0(^TRxzF|Ez%bG)#<Bp)M5YcUuT~VHLRn4Fpek
z!f62r0H6$Ppws;!*~lN{8pK}Ez{2zJJTdqq5TKZFJAS5qA?3wfFo-JCofT0gEMyqU
zzN0UrI6vU+fm!IT?&Al_54T1fSrK!!)7>GMEiaKdtPst*$5I}D12uFa%!1}96kVZQ
zu&FK&dFw9K8<yhA(3AdeX?sFW;3ELi5+=ilYvV{9h3<S&5oFz@bnli5AILF@W=_es
zih4O~i3cx_2h_M#%|eSE9x^9lx?6$I2$o*zuPY@gp2|B#Q9HG5c62<Cz*GU>2{t#+
zpjU<!YsantuMAvT`x`py=P6dQr0zQo`Sg>F{XizH7Ve_1XRDZ$!%AR;zM;cTZ+FFx
zUjPvS00D^s9|RZy0ssjG0#A6tX#yJz0162Zk!6#Okp0~*EW-!@qBEV2G$GLOa{p?n
z9#ugmAlBIONUj4dyDteI1x_4VwY<=I6iOpo_VJ2|I`r&{YYVn=&Z~oGgxp(s28D#K
zMe+nz9q+c9_)ah`otuZ5O`(m`0Pk`Z7sCQf6^WhC{2DVai;i%@mo6`Z<e9Ec)L^z!
zJ^e`78-FA+JGR31L&WH)kPniYl(%?ajZDnB!yHF&%mIp3{$6glaSD791WsXiBU_0?
zxR4qtYZCpD0jP(W9#)J+fXV5Nu56V>rk@yKE8A1>u2VD9vs@=k8y;K>B*E1Ln$Ni-
n5>?)d^5cjU@!t24JXLnUVEu?)?E{fxrcsM-z{P+pGkx~<R=X+6
literal 0
HcmV?d00001
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
index 60da4b1..0eb26f1 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
@@ -10,7 +10,9 @@ Description = "Minimal debian root file system"
LICENSE = "gpl-2.0"
LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
FILESPATH_prepend := "${THISDIR}/files:"
-SRC_URI = "file://isar-apt.conf"
+SRC_URI = " \
+ file://isar-apt.conf \
+ file://raspbian.public.key.gpg"
PV = "1.0"
WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
@@ -61,10 +63,14 @@ do_bootstrap() {
sudo umount -l "${ROOTFSDIR}/proc" || true
sudo rm -rf "${ROOTFSDIR}"
fi
+ if [ -n "${DISTRO_KEYRING}" ]; then
+ KEYRING_ARG="--keyring ${WORKDIR}/${DISTRO_KEYRING}"
+ fi
E="${@bb.utils.export_proxies(d)}"
sudo -E "${DEBOOTSTRAP}" --verbose \
--variant minbase \
--arch "${DISTRO_ARCH}" \
+ ${KEYRING_ARG} \
${@ gen_components_argument(d)} \
"${DISTRO_SUITE}" \
"${ROOTFSDIR}" \
@@ -125,4 +131,4 @@ do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
do_deploy() {
ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${DISTRO_ARCH}"
}
-addtask deploy before do_build after do_apt_update
\ No newline at end of file
+addtask deploy before do_build after do_apt_update
--
2.13.6
We could, of course, also download the key and convert it to gpg format
on-the-fly for use by debootstrap.
The second problem is then apparently a bug related to qemu-debootstrap:
The second stage bootstrap is called without specifying the mirror URL
once again, and that causes debootstrap to leave DEF_MIRROR in
/etc/apt/sources.list behind. That's a debian mirror, not a raspbian,
and the succeeding installation will fail.
I worked around it via this:
diff --git a/meta-isar/conf/distro/raspbian-jessie.conf b/meta-isar/conf/distro/raspbian-jessie.conf
index 89b769f..36faf01 100644
--- a/meta-isar/conf/distro/raspbian-jessie.conf
+++ b/meta-isar/conf/distro/raspbian-jessie.conf
@@ -7,6 +7,7 @@ DISTRO_SUITE ?= "jessie"
# For bootstrap purposes still needed:
DISTRO_COMPONENTS ?= "main contrib non-free firmware"
DISTRO_APT_SOURCE ?= "http://archive.raspbian.org/raspbian"
+DISTRO_APT_SOURCES += "conf/distro/raspbian-jessie.list"
DISTRO_CONFIG_SCRIPT?= "raspbian-configscript.sh"
DISTRO_KERNELS ?= "rpi rpi2 rpi-rpfv rpi2-rpfv"
DISTRO_KEYRING ?= "raspbian.public.key.gpg"
diff --git a/meta-isar/conf/distro/raspbian-jessie.list b/meta-isar/conf/distro/raspbian-jessie.list
new file mode 100644
index 0000000..c9a353c
--- /dev/null
+++ b/meta-isar/conf/distro/raspbian-jessie.list
@@ -0,0 +1 @@
+deb http://archive.raspbian.org/raspbian jessie main contrib non-free firmware
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
index 0eb26f1..af9f494 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
@@ -75,6 +75,7 @@ do_bootstrap() {
"${DISTRO_SUITE}" \
"${ROOTFSDIR}" \
"${DISTRO_APT_SOURCE}"
+ sudo rm -f ${ROOTFSDIR}/etc/apt/sources.list
}
addtask bootstrap before do_build after do_unpack
Jan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/5] Debootstrap integration
2018-02-23 20:35 ` Jan Kiszka
@ 2018-02-26 6:43 ` Jan Kiszka
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2018-02-26 6:43 UTC (permalink / raw)
To: Claudius Heine, Alexander Smirnov, claudius.heine.ext, isar-users
On 2018-02-23 21:35, [ext] Jan Kiszka wrote:
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
> index 0eb26f1..af9f494 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb
> @@ -75,6 +75,7 @@ do_bootstrap() {
> "${DISTRO_SUITE}" \
> "${ROOTFSDIR}" \
> "${DISTRO_APT_SOURCE}"
> + sudo rm -f ${ROOTFSDIR}/etc/apt/sources.list
> }
> addtask bootstrap before do_build after do_unpack
>
OK, this does not work as-is because the other targets do not have the
primary repo in their list files. It would probably make sense to
already migrate all repos into the list and extract the primary one from
it, also killing DISTRO_APT_SOURCE.
Anyway, I've tested the series and made some observations, mostly
positive ones:
- The generated images boot and run like the previous ones. Thumbs up!
- The new installation way is stricter with packages, rejecting those
that try to overwrite files of others. Multistrap was not doing this,
and I would consider this a weakness of the old way.
- Development round trip times can be shorter due to the initial single
bootstrap that gets widely reused for the target image build.
- We no longer set a hostname but leave it up to Debian to generate a
random one. Maybe worth reintroducing this simple customization via an
overwritable variable.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 15+ messages in thread