From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6631131420328722432 X-Received: by 2002:a1c:b4c3:: with SMTP id d186mr112799wmf.15.1544512811002; Mon, 10 Dec 2018 23:20:11 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:ce8b:: with SMTP id r11ls2721138wrn.5.gmail; Mon, 10 Dec 2018 23:20:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/XIdTF49yhdoBWCEjZNRcYNVr7/ysIQV9cjoO3+mizvdQWeY37Flj9TzURzYMlE7WcDhcRl X-Received: by 2002:adf:f88c:: with SMTP id u12mr1116210wrp.18.1544512810540; Mon, 10 Dec 2018 23:20:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544512810; cv=none; d=google.com; s=arc-20160816; b=VwzzMEfek67cyOVvGk9KAj6x5QL1amfZFjtZmggIiXSMMxjYrzWZj+x42pg22n29KE w0gkgLDM4dKLUtH3d6sONZsbnGl9tAvKsMaqrlTkaP930siRhJ6RMc41oSB3O0egbPH3 Tx9z14sV8Q6GI5Pu2WpyQLAXViAZuSixRRlh9LXHu0OkfBewV+49rRAf2ncVnwN8cyvJ YwcQAQug5gEQWzQidm3z67hen36REx0Tt/LIAylLOoo3/IIkXJOjoiGIJQIt9bKes5xl MeGQ30qTWuijIVapWOiWalbWUzGB967edDXGuovP0I8cXHCfxTxNZO1s5X4hgwV9tf+W rZjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=aLl+6wP5C1yFYhC1PhA1hMoijapSU2kpKn3cHh7mEpI=; b=H+FDzB2uK3oKVhF+HmjfYvGyUFXLQDlMpB7mUzt686gApJA8AB9/lKy5JV4VziOnZ6 ILvpgVmj5m//U7OUIX/TtXV6vku0qYfu/RVM2Xw9wg1PjmSeXv0bJ2TUxj5vF/tpylMQ s1qB9zNxgMuV2qxbU3at7OGcriW5s3cKyXijgGLoWWWfI9Z3wkCTWRiZtk9KjNjibr2I Lu/PLQhI6g5978NaavLiUtQS1Xc+MehFxdVSRtxH+sCRvf/9iMt2NFSadEPohEDZmYXY D0ys84vy4eCyVU0ZxJKXY845gZMb0gKQr2M98u2ciAIgClMDm6tItQsJY05ymqXy3WNn jidg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id 69si434338wrb.1.2018.12.10.23.20.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 23:20:10 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id wBB7K9i1005787 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Dec 2018 08:20:09 +0100 Received: from md1za8fc.ad001.siemens.net ([167.87.12.121]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id wBB7K3Qh018848; Tue, 11 Dec 2018 08:20:06 +0100 Date: Tue, 11 Dec 2018 08:17:51 +0100 From: Henning Schild To: "Hosgor, Tolga (CT RDA DS EU TR MTS)" Cc: Subject: Re: [PATCH] isar-bootstrap: debootstrap --include flag to support https:// sources Message-ID: <20181211081751.073ed373@md1za8fc.ad001.siemens.net> In-Reply-To: <20181204133544.50621-1-tolga.hosgor@siemens.com> References: <20181204133544.50621-1-tolga.hosgor@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: kM2UTbYi1/ZQ Hi, will you send a v2? Henning Am Tue, 4 Dec 2018 16:35:44 +0300 schrieb "Hosgor, Tolga (CT RDA DS EU TR MTS)" : > Building 'isar-bootstrap-target' fails when there are HTTPS URIs in > the distro APT sources and the first URI is not HTTPS. > The first URI in the APT sources is passed to 'debootstrap' and > the distro APT sources file is written to the isar bootstrap rootfs. > Then, following 'apt-get update' fails due to apt-transport-https, > ca-certificates being missing. In a normal workflow, 'debootstrap' > automatically includes them if the MIRROR is HTTPS. > > Signed-off-by: Hosgor, Tolga (CT RDA DS EU TR MTS) > --- > .../isar-bootstrap/isar-bootstrap.inc | 28 > +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) > > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index > cfad136..33ad8e8 100644 --- > a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -109,11 > +109,15 @@ def aggregate_aptsources_list(d, file_list, file_out): > out_fd.write("\n".encode()) out_fd.write("\n".encode()) > > -def get_distro_primary_source_entry(d, is_host=False): > +def get_aptsources_list(d, is_host=False): > if is_host: > apt_sources_list = (d.getVar("HOST_DISTRO_APT_SOURCES", > True) or "").split() else: > apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or > "").split() > + return apt_sources_list > + > +def get_distro_primary_source_entry(d, is_host=False): > + apt_sources_list = get_aptsources_list(d, is_host) > for entry in apt_sources_list: > entry_real = bb.parse.resolve_file(entry, d) > with open(entry_real, "r") as in_fd: > @@ -125,6 +129,18 @@ def get_distro_primary_source_entry(d, > is_host=False): return parsed[2:] > return ["", "", ""] > > +def get_distro_have_https_source(d, is_host=False): > + for entry in get_aptsources_list(d, is_host): > + entry_real = bb.parse.resolve_file(entry, d) > + with open(entry_real, "r") as in_fd: > + for line in in_fd: > + parsed = parse_aptsources_list_line(line) > + if parsed: > + parsed = get_apt_source_mirror(d, parsed) > + if parsed[2].startswith("https://"): > + return True > + return False > + > def get_distro_source(d, is_host): > return get_distro_primary_source_entry(d, is_host)[0] > > @@ -138,6 +154,12 @@ def get_distro_components_argument(d, is_host): > else: > return "" > > +def get_debootstrap_includes(d, is_host=False): > + if get_distro_have_https_source(d, is_host): > + return "locales,apt-transport-https,ca-certificates" > + else: > + return "locales" > + > do_generate_keyring[dirs] = "${DL_DIR}" > do_generate_keyring[vardeps] += "DISTRO_APT_KEYS" > do_generate_keyring() { > @@ -183,7 +205,7 @@ isar_bootstrap() { > if [ ${IS_HOST} ]; then > ${DEBOOTSTRAP} --verbose \ > --variant=minbase \ > - --include=locales \ > + > --include="${@get_debootstrap_includes(d, True)}" \ > ${@get_distro_components_argument(d, True)} \ ${DEBOOTSTRAP_KEYRING} \ > "${@get_distro_suite(d, True)}" \ > @@ -194,7 +216,7 @@ isar_bootstrap() { > "${DEBOOTSTRAP}" --verbose \ > --variant=minbase \ > --arch="${DISTRO_ARCH}" \ > - --include=locales \ > + > --include="${@get_debootstrap_includes(d, False)}" \ > ${@get_distro_components_argument(d, False)} \ ${DEBOOTSTRAP_KEYRING} > \ "${@get_distro_suite(d, False)}" \