From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 04 Oct 2024 13:36:58 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f56.google.com (mail-qv1-f56.google.com [209.85.219.56]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 494Bauam031323 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 4 Oct 2024 13:36:57 +0200 Received: by mail-qv1-f56.google.com with SMTP id 6a1803df08f44-6cb2e16ea95sf29462866d6.1 for ; Fri, 04 Oct 2024 04:36:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728041811; cv=pass; d=google.com; s=arc-20240605; b=C+XArOFMp7oexx0WI/aSldzUMlrkzkLw5qZBK8ev96WvIWhfxvvO6Nffx4XwFg+R2T U9/fI/nuDgumjyLsSZ2sR6kYSQjLkrvlYr+W/cH0Op647hx0lYhTLu7DPbML5DQAjuLW 5zxKFOHZ74ANDWK25nzuwsm01lgrzBoXTAOuuhcmMwtziDVAXY+RhzM1VS7AWkSx5g1M oQzXRIDjqCKHr8fmL7FgMgy0q5+T6fqUwmujY4DI4y9Y3WgCqqvVEpzcwvGSVhvQNFPf C/lcrwTRJye4VmqX52RDDlkuEQ51w/13ZAqtFJQSd01NlIOj6jcErHdgclEranSdFneg Jl1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:user-agent :content-transfer-encoding:autocrypt:references:in-reply-to:date:to :from:subject:message-id:sender:dkim-signature; bh=XMjTmNmlsSud+AIFz6ZXWjJdH1+uNA0hD12yRsHYMV0=; fh=IatIUTsMglWMlHAWHrwNnP8WOvKmcbr02Z4q2h7+mzI=; b=KeuHOMz1Tdn9b4Fc2PZhlbrIE7C1GP888OEeDEDto3w75ebYDEw30VaXO+hz/D0Kk8 xD0LMZF7exziNn96+6g+55Zi1DxO6FpvqeOWWk/XCeQNRKzlBuE9yvWBY9dJ9Ea05/Yf b/l/7ITGjJB4L2W6IZ7hClwbbiJs58nGMbx954Vx8M4ymzUWZJPLRMMgbrPlJoX3gqEc wTRT0S2uCe/fUE+iMxUXIKqaB+7JHbqDa12cf/FpADmGDosqu4cna7P8BDCPQjM2iWOr XFuHC9AfJvfv1K7tMDvzJMEcC0abfabNBWxBruq45UFMPJm/AFG0uYs9/4wa7d8ipbtz aS0Q==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1728041811; x=1728646611; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:user-agent:content-transfer-encoding :autocrypt:references:in-reply-to:date:to:from:subject:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=XMjTmNmlsSud+AIFz6ZXWjJdH1+uNA0hD12yRsHYMV0=; b=kEC4254MoIDMjXm3Nsq/joTHdkoZGCr9z+Wa06zkkuWk2Sj7nGeEjvApG65XgVyIfW AvA/oCvEZBXTLp+7f77PvyIooRCrMWPC0vmvKtb+IMa2SbC/iXUKEmGqKTracvxW+zQk xdAUvrHZIeZvwWxbzJ6pYGg2NA6S9D/ZlCf5I63lqtS5YDwLC2YgcSbaWhicq/kqdj5T YaS9bVDGxIpxYABoJT4syqvAW0iprLQriwrasdD6NX/o4sDIUXrcwM4AeoAFn+oPix6B nYPXIxx7lsrO0o2aJUZHMHyLo7BdpJwc0hM2rRwr0pecMNWOigerCyclvhA6GK9EpfvI 7NBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728041811; x=1728646611; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:to:from:subject:message-id:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=XMjTmNmlsSud+AIFz6ZXWjJdH1+uNA0hD12yRsHYMV0=; b=ADAVVzpGoS4GUeqziTgAX1ApStvUbcg+6V96uPHaHtN9LkhQ3v6ZMq+i5GoFF7zSVX i93pbBAFZy4pdk1pl8enWSAN06sIPgaKn4X4rs8SxlOms3ZiXEpTnEGO8AkUbesNb1i4 xq6MBS5xYsD9NfycglW+KnRWYAfnPr6ZxjQd+2UEhhkB20dDe5Yoys8P47eK7/kFlkh/ ZHjCUKSUwmj2IVk+8KmhlpRpb00avROLemH3Hcenql5UPiGY7frVHDoA/bA7n0kkSEjp ei2HOYD8qXcACMJs5dX8IJmwXSP+3e0G6Qj3D+A4j24Vr3g4yUCbEeFScDaWNQbN1B7z 6JYw== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXS5V4CBA42NGJGZYFKxVnVShmqov1MLGCocK7BWfQK+5HqgEiknKrcZl7t5+Akd1KtUuEw@ilbers.de X-Gm-Message-State: AOJu0YzS3eOkcf2Q1Nttz1DKlF2f3l5wROXfzSLiuNkcFwsbH2njVGu2 GQA3U2QncsnUeDp5sk/613Ps6G/jfIhO3yMB2gVtV6eLp0TytUL8 X-Google-Smtp-Source: AGHT+IHyoyoCzgi6PhrGmirpYopKMmX3fyVEO0pN4d4ShWE74j1DTfpn/pxyHp8zarz2ephYwGArhQ== X-Received: by 2002:a05:6214:4188:b0:6cb:3279:f0ac with SMTP id 6a1803df08f44-6cb9a302bf0mr28562536d6.24.1728041810869; Fri, 04 Oct 2024 04:36:50 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:1c0b:b0:6cb:2dc5:6bb5 with SMTP id 6a1803df08f44-6cb90136fc5ls31716046d6.2.-pod-prod-02-us; Fri, 04 Oct 2024 04:36:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX+O9Jd+9SFUUbWfrswi6eE6rkZEqbs8JSuVAl1g4Bpg2kXKpx6vqUFMmCZN0wIenx3OHrmIyOuBcMk@googlegroups.com X-Received: by 2002:a05:6102:38d0:b0:4a3:d5f9:1e0e with SMTP id ada2fe7eead31-4a4057649cfmr3139026137.8.1728041809831; Fri, 04 Oct 2024 04:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728041809; cv=none; d=google.com; s=arc-20240605; b=NbC3Kl/i+boULv0WXDT5Dj1uraKUvSRfxe0k2paD330LRK7DBZ34X6pxFaYN+V4h6M BBDz2G/qL0CQorjLFbXr1YGhuSstAsMaDBSBSUmq1pMqDUqZXypN8ancs0NEFlD0CYP9 ltVkfGkO511+adUIkHQ18JXfIUiKOx1Gm2nsRnHiTKRAfIwoOD/0IqW56uuRggstTL68 9rwZuTGOb1GlapH2eMbl7LJPeOV7eJmR2JGcINxHHmCInD2fGCxD80R4DmA6LDOoZ1Gq O7EVEpFktBZPJ2EINuIRb/FXCiT7xmad7LRMNCF9MQb3diY+O21s86/MnonhmfldJEj9 JoUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:to:from:subject:message-id; bh=L4/sCW3MYa37q6Jq4CCAopnpI8MzHSKSTM+PhSBwdjs=; fh=1x/T85rXr8yhgzXWAa7zssXnuyt2jGlhJYPIGFWr6UE=; b=duwBUDZfSYy1cbg4W+uNuOF/QzWOPq7Ebqet3I8ULoDe3e5fQl3tbXlDATwbuu3pvz BKmGfVwd5njyqh0MjWf8tQ5jR/XuZ1GdcF2O0KaDLssqCiFOcnl7bsr3HjSndTj7rpP9 l15XJn1Z3BSbE4oCT+OvN3Eqo2qxxWqOwiktI0e52l4eGm/dRyvMWMgsEo6mwFu7W9gn 8ZEP8IEEals2rFK1m5IlsmN9aq09Kf4neinkk6/uf8ByOprMdFjKTJ8GZcAX1gEg1yJS RL9R5r+Ej/uSSgZSAYUEhUPqMs9ufS/NZ/SdHathMxKuTJTz0vxxiPKU09XSTrkIE0SM VYHg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id d75a77b69052e-45d9210b7d9si1352071cf.2.2024.10.04.04.36.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2024 04:36:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [IPv6:::1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 494Baj7N031315 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 4 Oct 2024 13:36:46 +0200 Message-ID: Subject: Re: [PATCH] image: copy .list files from SRC_URI to the image From: Uladzimir Bely To: Cedric Hombourger , isar-users@googlegroups.com Date: Fri, 04 Oct 2024 14:36:45 +0300 In-Reply-To: <20240923142704.389438-1-cedric.hombourger@siemens.com> References: <20240923142704.389438-1-cedric.hombourger@siemens.com> Autocrypt: addr=ubely@ilbers.de; prefer-encrypt=mutual; keydata=mQENBGO2eUkBCACtT+T3OrPVSExBmqfgXT3lp9XcdxRzjYp26wezkgYjjBXaf36bxtaAf S471VoQtpar0RVeFfW7WDDdfX9ZclSj36zBQe+RVSJzoNoNQfjOXWuSHb5Z+cpAFtqBY4muxK4+ia IlLJd6CN3ejOsLHATtCeHHq8wi0z2T+KdLQO+wQRgo2hjj0Lp9pGTrKJry50HP/o7Vbdu14dOx2xq r8+wPc6SQbBIrcqaa4MqCQC00vQG7eXvo+k2MOw59FDdpMH0KR9mHgp3u/s4I+4YRBArukt9G9xz/ rsEFmxAIBC6N/a6Hzwg4puc91n7ABDsPg8Vp+X3MDraujN0dvR6OKVNtABEBAAG0IFVsYWR6aW1pc iBCZWx5IDx1YmVseUBpbGJlcnMuZGU+iQFOBBMBCAA4FiEEJqPNVhVGyk12Eh+PAUQYBM/2FkoFAm O2eUkCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQAUQYBM/2FkprlAgAmuna8Hm9EyoEtTl DBGDg6Zm4ZLp5ffvZBE946h92jepDrteoxsJ7pSzJVC2HmDLa4iZUao7lLLbDsUj5x45/iLJcqBZK k3YnAxP2r6a+kI+1VVQY1pxdG1nlJAbdNzoojm/qmezNPSrqni61KVMQKsXBCWhIjSXDSM9CsBj21 a+9qaVqfxovJGTn9lgrZO+xzKQNMKZeOouJlscVuFj21P0ww3/YENiU/nMeTSuYypO76mDtAd08Jo nc3yuHa9MJGei5ixN3wT+IrGR2aL2hdw2M6NgH7sYbL2Zi4ugD6RXHJai1Bh2yvFSVqSQ+M6QOInT 4ud7wslm1XRB065dXtA== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.0 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: ubely@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: xJwraHjLP1e9 On Mon, 2024-09-23 at 16:27 +0200, 'Cedric Hombourger' via isar-users wrote: > There are use-cases where the .list files used by Isar / apt during > the > build would not be the same as the initial .list files presented to > the > end-user of the image (e.g. build from base-apt or from a local > mirror). > If any .list files are listed in the SRC_URI of an image recipe, they > will be copied to /etc/apt/sources.list.d/ verbatim and in lieu of > the > bootstrap sources that were used by Isar. >=20 > Signed-off-by: Cedric Hombourger > --- > =C2=A0doc/user_manual.md=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = | 14 ++++++++++++++ > =C2=A0meta/classes/image.bbclass | 18 ++++++++++++++++++ > =C2=A02 files changed, 32 insertions(+) >=20 > diff --git a/doc/user_manual.md b/doc/user_manual.md > index 847f4b07..89c3a293 100644 > --- a/doc/user_manual.md > +++ b/doc/user_manual.md > @@ -769,6 +769,20 @@ inherit image > =C2=A0 > =C2=A0``` > =C2=A0 > +If the resulting image should not ship apt sources used during the > build but custom ones (e.g. for end-users to point > +to an external or simply different server when they "apt-get > update", custom list files may be listed in `SRC_URI`: > +Isar will copy them to `/etc/apt/sources.list.d/` and omit bootstrap > sources. Possible use-cases: > + > + * image built from base-apt (which is by definition local to the > build host) > + > + * image built from an internal mirror, not reachable by devices > running the produced image > + > + * ship template list files for the end-user to edit (e.g. letting > him uncomment `deb` or `deb-src` entries) > + > +It should be noted that Isar will not validate or even load supplied > list files: they are simply copied verbatim to > +the root file-system just before creating an image out of it > (loading sources from the network would make the build > +non-reproducible). > + > =C2=A0### Additional Notes > =C2=A0 > =C2=A0The distribution selected via the `DISTRO` variable may need to run > a post-configuration script after the root file-system > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index c29d9e26..0c162aa3 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -392,6 +392,18 @@ python do_deploy() { > =C2=A0} > =C2=A0addtask deploy before do_build after do_image > =C2=A0 > +def apt_list_files(d): > +=C2=A0=C2=A0=C2=A0 lists =3D [] > +=C2=A0=C2=A0=C2=A0 sources =3D d.getVar("SRC_URI").split() > +=C2=A0=C2=A0=C2=A0 for s in sources: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 _, _, local, _, _, parm =3D b= b.fetch.decodeurl(s) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 base, ext =3D os.path.splitex= t(os.path.basename(local)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ext and ext in (".list"): > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lists= .append(local) > +=C2=A0=C2=A0=C2=A0 return lists > + > +IMAGE_LISTS =3D "${@ ' '.join(apt_list_files(d)) }" > + > =C2=A0do_rootfs_finalize() { > =C2=A0=C2=A0=C2=A0=C2=A0 sudo -s <<'EOSUDO' > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 set -e > @@ -429,6 +441,12 @@ do_rootfs_finalize() { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = mv "${ROOTFSDIR}/etc/apt/sources-list" \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.lis= t" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if [ -n "${IMAGE_LISTS}" ]; t= hen > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rm -f > "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for l= in ${IMAGE_LISTS}; do > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 cp "${WORKDIR}"/${l} > "${ROOTFSDIR}/etc/apt/sources.list.d/" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 done > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rm -f "${ROOTFSDIR}/run/= blkid/blkid.tab" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rm -f "${ROOTFSDIR}/run/= blkid/blkid.tab.old" > --=20 > 2.39.2 >=20 Hello all. If there are no objection and futher discussion, we are ready to merge the patch. --=20 Best regards, Uladzimir. --=20 You received this message because you are subscribed to the Google Groups "= isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to isar-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/= isar-users/d97b287af26340c2ae39dbf26f2492ff785b4b2c.camel%40ilbers.de.