public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 1/2] isar-bootstrap: Keep the initial APT sources list
Date: Mon, 17 Dec 2018 16:15:48 +0300	[thread overview]
Message-ID: <a3f850f3-2c4e-678e-f507-faa4ae152adb@ilbers.de> (raw)
In-Reply-To: <20181217124145.1b2038d5@md1za8fc.ad001.siemens.net>

On 12/17/18 2:41 PM, Henning Schild wrote:
> Am Mon, 17 Dec 2018 06:40:33 +0100
> schrieb "Maxim Yu. Osipov" <mosipov@ilbers.de>:
> 
>> 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 <mosipov@ilbers.de>
>> ---
>>   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

  reply	other threads:[~2018-12-17 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17  5:40 Maxim Yu. Osipov
2018-12-17  5:40 ` [PATCH 2/2] classes/isar-image: Replace the apt sources file with the original Maxim Yu. Osipov
2018-12-17 11:42   ` Henning Schild
2018-12-17 11:41 ` [PATCH 1/2] isar-bootstrap: Keep the initial APT sources list Henning Schild
2018-12-17 13:15   ` Maxim Yu. Osipov [this message]
2018-12-19 11:45 ` Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3f850f3-2c4e-678e-f507-faa4ae152adb@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox