From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6635832943372664832 X-Received: by 2002:a5d:4811:: with SMTP id l17mr1195062wrq.29.1545052556836; Mon, 17 Dec 2018 05:15:56 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:e919:: with SMTP id q25ls2800591wmc.6.gmail; Mon, 17 Dec 2018 05:15:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/U46QNm4/Om/FxwFAGUEK7jRmSwmArAYqA4+4bXINs5tfpytzTv7+dQelb/EkjX+Dj6Kh6u X-Received: by 2002:a1c:5412:: with SMTP id i18mr1600049wmb.19.1545052556417; Mon, 17 Dec 2018 05:15:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545052556; cv=none; d=google.com; s=arc-20160816; b=wGIPBHf1+Zap/tceoqCHBgYMGY1yj64Aj7i5SBWZM3tJ14cqBNp4IsgLl/Y84tT7Zq 4lhdg4blIoR7AfPH5z6Pz0M377ILTMNlgT59ZzXpNpu3NL7ycQPlOkLUym2cEP9a2tt4 +Mr7Fy1Ju7n8iFu4/knW7uAsSQb8YcYajdh+1M8cSVrULVKriSHdGqmz03rSqhKGz4uw 9teBLc0t4IoRCtlRREA/w+e7Bi3oaQZShwK1v7Cd60BJO/LAqKQzRvtFwDRSn1F+H2Zy biFA4EHgzHHuzNrQWMU7SP4L1oNlgHTlJ1ee18T97Ug0q+SggaDgGTQy951p5vUrRWY9 Ktig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:cc:to :subject; bh=QFE/DJUWHGWi0r2f0V6cfvQ7u5m7kumgZW1Jiel2gfA=; b=MRfiAn6NUJFdmUfhVmV4sPvi54GsVAxB/tOrXFkaekQVHDWo5nLQITUGe06CiduPR2 c+Kfux/67GcC8+UHwGja7jmgjBY2/1OaUyNhhh4V3/COUu3gppjumi3eJMkQToxJX7zC bxKUCxHqfeS6ZmPnDW/s2KMREG9OtQI7t2xFq2FrGxGSEcHxRJQTB9W+whXemvCENaR9 4MbplvcNY3Uzouy9FRH7eOHcJKSAnKY29gVRcZYHt6VEi97zBPRWcMPMWJVz/PpxHGpy OHm6ZSBJPOm51IFrTbk5fQUGGAEgRRFoR94zBkg5mIArwZ6iSw7IkXCkvgC7qEhEPzQZ +wzA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id z207si447897wmc.2.2018.12.17.05.15.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 05:15:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from [192.168.50.180] (nat-ppp-217.71.235.199-satnet-spb.ru [217.71.235.199] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id wBHDFraB004502 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 17 Dec 2018 14:15:54 +0100 Subject: Re: [PATCH 1/2] isar-bootstrap: Keep the initial APT sources list To: Henning Schild Cc: isar-users@googlegroups.com References: <20181217054034.12236-1-mosipov@ilbers.de> <20181217124145.1b2038d5@md1za8fc.ad001.siemens.net> From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: Date: Mon, 17 Dec 2018 16:15:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181217124145.1b2038d5@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: aGxM6PJJ2Q6z On 12/17/18 2:41 PM, Henning Schild wrote: > Am Mon, 17 Dec 2018 06:40:33 +0100 > schrieb "Maxim Yu. Osipov" : > >> Keep the initial copy of APT sources list passed >> via DISTRO_APT_SOURCES as the contents of APTSRCS >> get modified during isar-bootstrap. >> >> Signed-off-by: Maxim Yu. Osipov >> --- >> meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb | 2 ++ >> meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb | 2 ++ >> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 3 +++ >> 3 files changed, 7 insertions(+) >> >> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb index >> 19b60dc..7b83f80 100644 --- >> a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb +++ >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb @@ -34,8 >> +34,10 @@ python do_apt_config_prepare() { aggregate_files(d, >> apt_preferences_list, apt_preferences_out) >> apt_sources_out = d.getVar("APTSRCS", True) >> + apt_sources_init_out = d.getVar("APTSRCS_INIT", True) >> apt_sources_list = (d.getVar("HOST_DISTRO_APT_SOURCES", >> True) or "").split() >> + aggregate_files(d, apt_sources_list, apt_sources_init_out) >> aggregate_aptsources_list(d, apt_sources_list, >> apt_sources_out) } >> addtask apt_config_prepare before do_bootstrap after do_unpack >> diff --git >> a/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb index >> 3631506..c264123 100644 --- >> a/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb +++ >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb @@ -33,8 >> +33,10 @@ python do_apt_config_prepare() { aggregate_files(d, >> apt_preferences_list, apt_preferences_out) apt_sources_out = >> d.getVar("APTSRCS", True) >> + apt_sources_init_out = d.getVar("APTSRCS_INIT", True) >> apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or >> "").split() >> + aggregate_files(d, apt_sources_list, apt_sources_init_out) >> aggregate_aptsources_list(d, apt_sources_list, >> apt_sources_out) } >> addtask apt_config_prepare before do_bootstrap after do_unpack >> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index >> 811d50e..f411ad1 100644 --- >> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ >> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -20,6 +20,7 >> @@ DEBOOTSTRAP ?= "qemu-debootstrap" ROOTFSDIR = "${WORKDIR}/rootfs" >> APTPREFS = "${WORKDIR}/apt-preferences" >> APTSRCS = "${WORKDIR}/apt-sources" >> +APTSRCS_INIT = "${WORKDIR}/apt-sources-init" >> BASEAPTSRCS = "${WORKDIR}/base-apt-sources" >> APTKEYFILES = "" >> APTKEYRING = "${WORKDIR}/apt-keyring.gpg" >> @@ -222,6 +223,8 @@ isar_bootstrap() { >> install -v -m644 "${APTSRCS}" \ >> "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" >> fi >> + install -v -m644 "${APTSRCS_INIT}" \ >> + "${ROOTFSDIR}/etc/apt/sources-list" > > That file should get another name, and ideally not sit in the rootfs at > all. If something goes wrong, this looks dangerously close to a valid > file, with no clue where it came from. One may try generate this sources-list from DISTRO_APT_SOURCES again in isar-image.class (one have to share python aggregate_files & friends and add another task similar to do_apt_config_prepare from isar-bootstrap-*). In my opinion such duplication looks ugly as the natural place to parse DISTRO_APT_SOURCES once during isar-bootstrap phase. Maxim. > Henning > >> rm -f "${ROOTFSDIR}/etc/apt/sources.list" >> mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d" >> install -v -m644 "${WORKDIR}/isar-apt.conf" \ > -- Maxim Osipov ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn Germany +49 (151) 6517 6917 mosipov@ilbers.de http://ilbers.de/ Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov