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; Tue, 08 Oct 2024 07:12:50 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-oa1-f63.google.com (mail-oa1-f63.google.com [209.85.160.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4985CnUF019863 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 8 Oct 2024 07:12:50 +0200 Received: by mail-oa1-f63.google.com with SMTP id 586e51a60fabf-287152f3f6bsf4735169fac.1 for ; Mon, 07 Oct 2024 22:12:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728364363; cv=pass; d=google.com; s=arc-20240605; b=k4o6do3vLyOakotKexsBGIICmWi7uU4RLN99X4qsL8Egs5rbSMlLcgPGEfnL+dNDwg WC+PVQKA+oRaDlRfDMCq95eNKqDABF7iNq8OQVtk31woXwUoQaE5tzyzbhz56ofV40Pw IP1CNRlLXAlPJyLob3XnR56lKO9YP5PS6qMk+TdKKJLIFGZ3KP0gFl1dHXm1QD5yFDWX VxLZPj6T5avbQxprtLrUY+3jHtowJaX1kRaDsBE1ViT9Arf6gtdGt6i5wU3GntH+1C68 IWH6M+iNIhEw++ZTLmgkiM6E09Y+e48rPSgGOs0LsbXY8m01inA58Oq/QVtBGWWLwUF9 yMcQ== 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=2dDve7sTKDbDjCS9t/NTuqPEsjgveTQIZnIb/zeLiDg=; fh=9khoRt9hZ7xrUo9/GoTdAl989lPQujFF+v1lhk5zkGI=; b=EDlhRZA/LWkKINNs/G33g/AXqbl+3HvidFayjhSsmL7S0YlYpMVz2bgDicoVUJZvP0 n/ZWK2Mu/cdUI2xkrBq2ewwj2m8PvsackhE+csuNckmOCX6paUGfPkV2ve/A7DYG+ja8 0vTxobfxfZO/XGabLXovRQyVtkFW3VagSIwzDnI7I8taesbQ1GYsVyrIJAOYEYcxglGG uLBXpvUg20vQci4Pqf67/ckfF9SUy7enGDGNHDeYeQxisQPnKqOno9WVvLiceIxGI9K/ WNAd+tRlwP56cNM0rVgubLkOnUBMQjp7Pt0na6JK1bnSS/lnccE93L50G5EaNZMF0pYc kQJw==; 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=1728364363; x=1728969163; 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=2dDve7sTKDbDjCS9t/NTuqPEsjgveTQIZnIb/zeLiDg=; b=Zi2yiWtmzOGC0hZZw1JUzmsDoh67UAVRNYLIrCRHHIlurvXH9wJmUii9BVBAqglif1 pvcCyne5zbWFUnmN6iUTm+XmO1+BKxMtCBAVWTl5IihbC8fpMBZIX1T2G8jgmcxsSCa4 1SF7IqCMEHQplp4aA5RVHSR1IcmH38+9vgvfwxl+xXO3xPPVVLbCHJoZoeGhCL52cjW4 +CKdxzqNp7smLKPoEbVUzGUBjTX3fJXnAlDdUrtd4NGK5HD7/mwBGQdMCKixnqsyb4uC OwNQX7cRV5rbxExfR5B39oftlviQ5T48SDuANi+6YEN43DDG0VnqgefUO5O483Qsh2Ek bCmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728364363; x=1728969163; 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=2dDve7sTKDbDjCS9t/NTuqPEsjgveTQIZnIb/zeLiDg=; b=i/BvHLZ11rwuTM2Dyb/T6+HHigAi8UNFX9FiVoVLCfooiq6nFgvjPgmRmSO9sHca2/ DCehEj1pBvogtSHTPFPm+qP9Jhbg0WpMvXxxrlNfgqq3zKrLm0eO8zvb/t98dwejOsOd cnbptaoaQMGVEtAOn5r6imJz+3/g0mGgJeyGUa2OWuNu8+WIbRn+q8zDIDjd7t9US++J zGSqVn0Wpadmxkp8SSkvKqtI/CG08pd+U5+2Z1TQ9aBCjCT5EV4V89PKrlMnG3gScpE6 eVRhntKsn042fWEI1I89ddVaBAuxIpTTW/nuPehiv1TQclFYVnSHTGCu3pHGomIeTD+w C7Mg== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCW/P8YP5p8GNDwp2Zgryd58/f233pEnHooBvH7i79t1qkfwNp8Jj97CVWPwCikfcSZ9WvjT@ilbers.de X-Gm-Message-State: AOJu0YzTq4XTEFoagL1LVRmK3VTtTC6XWlrvNtvJYD1wGd8V4zAo+15C Y2dsAblSwKSu4fMmfg4VOoOfGwp+BCPXtq/RJmavmm9nDksTrYwg X-Google-Smtp-Source: AGHT+IHYsXbvjYBPQmhSWJr8RqRHglhd84KVTM1fp4RuqxD20n30rJZsMXfclKOfm+JE4hsqAC5vHw== X-Received: by 2002:a05:6870:1682:b0:260:e36f:ef4f with SMTP id 586e51a60fabf-287c1d38d54mr10803995fac.3.1728364363008; Mon, 07 Oct 2024 22:12:43 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:ad0a:b0:27c:a756:f49d with SMTP id 586e51a60fabf-287a4877440ls5171675fac.1.-pod-prod-02-us; Mon, 07 Oct 2024 22:12:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVFxopF7xVr2XHRe8rlCI/XjzIfa/3IrhTTMCFB934WI0euFHfz68tGWdl4I1y6brw8H+1PkgAz0Gch@googlegroups.com X-Received: by 2002:a05:6808:11c8:b0:3e0:5d35:1873 with SMTP id 5614622812f47-3e3c132ae2cmr14148374b6e.20.1728364361733; Mon, 07 Oct 2024 22:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728364361; cv=none; d=google.com; s=arc-20240605; b=RgHzeYdhy1R8+feqvxSzouxYsAw+cfC17+FoO99dDIdibHvRk8n6YPyiiKNwF5HMwQ 2lceci0FIEfEO9W7YeA/zztqvgpvdt5wgQ0vT8ctBjKUNeRPXWuetxECpFzBWNg7KcSy QiFHvqPiz0iHwMCL4gSRP92ZPlBbvZfABs6vBbRehwqRNzgG9BwXGa35oT9fvNX/97Jz TRzJsdmMCF3Q+ZkyTjPRh7rAKEI8ZUsjGJ+nuricnriJkBZMOpi8jaCzkLlNdvBblF6z BHFeBaseULQZ8hHbQyF3e7myeNxs51B1yCQb5iAUbkaBSfixKfo0w4Fjdlr6HMr7w7zZ HxVQ== 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=GqAhiz1U7z70VeRZqNhZxIK29ReRFFlPmIlyRlMfUyQ=; fh=1x/T85rXr8yhgzXWAa7zssXnuyt2jGlhJYPIGFWr6UE=; b=LwZMBWthEiQ3RCARDEcWqteKg3ZXKVS1TuYyiTcuZHs9dvunvVhqYgiDbosv1DBHRm ZCLjkq50JICEos05s92U6Oua5IOLSX4nB4V3lWf9Qsg8V1nTh/8tPVaisCkoj9w+E+YA yksRl/Pr7eIyG8T/5FRsjJm6CUgTep3xpU7aEwkQzotiMliJaJXr8ZC9h6kYd3ndyNJ8 nd65+e8RkXEPwAIZ+mFhECirYvRo1xOKB+7MiLIGvmtdMxifPw7RxTmIh0XOx21EhCOh YhWdHM3pPxr5m9yK5U7JosmPXdn+lX4pewe9WE9SKSboLsZ4VZhyEzlcwffQs5VQwwv7 Gocw==; 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 5614622812f47-3e3c9019f01si312712b6e.1.2024.10.07.22.12.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Oct 2024 22:12:41 -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 4985CbcE019853 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 8 Oct 2024 07:12:38 +0200 Message-ID: <82afb3c7f686dd50a05fa11ae9a2309112dcbe73.camel@ilbers.de> Subject: Re: [PATCH] image: copy .list files from SRC_URI to the image From: Uladzimir Bely To: Cedric Hombourger , isar-users@googlegroups.com Date: Tue, 08 Oct 2024 08:12:37 +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_DNSWL_BLOCKED,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: h4YeK/EbeVVl 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 Applied to next, thanks. --=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/82afb3c7f686dd50a05fa11ae9a2309112dcbe73.camel%40ilbers.de.