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; Mon, 23 Sep 2024 16:27:30 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f60.google.com (mail-qv1-f60.google.com [209.85.219.60]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 48NERTfe002986 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 23 Sep 2024 16:27:30 +0200 Received: by mail-qv1-f60.google.com with SMTP id 6a1803df08f44-6c3702d3ecfsf81061056d6.0 for ; Mon, 23 Sep 2024 07:27:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727101644; cv=pass; d=google.com; s=arc-20240605; b=BZKIqQZhQBoAk0SABMut3oZV+8f33y+wwt+Qher3uk9z517znvsQDyZNG67iH1ulTG IBG/hnfsOjQcTymQAYZTfEVqIOOXV1AMhpSHSZrStyD5q0vGMgz9e1aCLRe28h8FJaKS GgEV6VhcsFWMx79bkqCZ0yGYU98gRLT/cVeJLozAHygy79l2RnlGi6BY0uxd1v9ua/eN OjDPXjl2Fub/QeAd3c1v9eKQ5471V5bh6earA+fBxgTXO+571WgKYNGNtmbthVe6WjZG bDeIaLTaD5cyobTKu91Nm36Wj2oWUeL3ZcRCcHchyaDuO78Jpf3WgYlNVMup5k56dGfg KGRA== 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:reply-to:feedback-id:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kJ2IHzvLfzZ3itGbeoRveLp4F/se99YDn1BmGacTY7s=; fh=V13S+TcdQTabhiIPueT+BzUxGtKhW/kO0vcal5P5jwg=; b=bIC4jO+XeU8I2QShpPB7oADXO2pkAYntUgdgPmIPuZ6D/k4EN7S5x78XiyuVaxgFQS J0porNPjll0WTG8IQaHMtkpC+dOu7rk5n7hiHhndh0jJtLiRL1CshVM1KEm0kFA/4O3F 1le0CGg1fZCSBDhZX2jY5cdgh7dryKDNNX2kA/P4GdYpJHn3p+wjGdWiodJ5SkaqwhVA f1KIeOBISFVrP9VSF0CDfKoZDky9zbdLknEJosOrXNfyknxe6bqRQ2K30DzjJ802BmPn WgnBO1Oz/yTYYmUL6DvRLslSQ+7ytGnFrs4GHyDFDpURlmTh/M9lMwpnDAtseZYzlsxH ef3g==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=MRQCc2+n; spf=pass (google.com: domain of fm-1212295-20240923142721cd482e180dd51d059f-ufhpbx@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1212295-20240923142721cd482e180dd51d059f-UFhPbX@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1727101644; x=1727706444; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=kJ2IHzvLfzZ3itGbeoRveLp4F/se99YDn1BmGacTY7s=; b=l7970IpkxG2UAclgS0NDCxX3cboyUPRtj+giImn6MU9uXGeyK7DbxWFv9FwU7f8e1X xc/MAcWlbPwUFlX6s1N32YyAjuuE3WQaa8Ba//TISMbGtj8gcdLV+jrQ65xZp+iCoxkb fjlx0sYZFOunorLiwsD5KL9wtIt0eFset8kssQtkgYUM/wmhfxDftzTHEJfld0PcOq4Y qeAX6IYrv/2J6AtLqpSXm1G7WIP/SGYuTo0iS1+6q3Ku3k2AtOnQPyNRavPUNKYqdrUs PkOY6F2H0KXd9yNzfqmOrKbDiqoMTe6bKdCZR5OaA2fCouL5p9sW0EQkl7wZqpNEHVTW tySA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727101644; x=1727706444; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kJ2IHzvLfzZ3itGbeoRveLp4F/se99YDn1BmGacTY7s=; b=mDnx0I1jMa8zErO4yDSUGFIy1sqvdmoq+h6i6r8/9+BLYttQ6doON8XcPnyaUeim20 ngraDOzins+1khiUA3J+w67+lVZA/rN1lJevKKp2MiqmOcSAfZ0zBjh1W3UQT0TPZNmc 8I60GXwswpaYKCuqjJK8r/S/WD++UXYGKhzszdGK1FWblfHtUAGRLVGKktjQwtaJkCqi bQnHdX6E7cVdKJJL8BqUyXgEA1rnYzWnG0skfNZ8XDYcMH1mooEsX1JsOLrOanizgTzL uaczdpTgVPHm+qP0eM4M7X6uCsHYsO8AIo2ZPbGEj/UmjNRM4Liv3tT1E0/5EaU72p9K LoeA== X-Forwarded-Encrypted: i=2; AJvYcCV3vl8r0YzTvdo8MWg8Pa9eFHbruD/Tk4yu/k7Vl8bfeSuqUmnGW+pG7q0yFq+wuKpv3QZE@ilbers.de X-Gm-Message-State: AOJu0YxhkDwhVV9YEKK/jrgmuCin+ccKqQcxA2qPPhBR05nfFXAXP8tb fjcYdEo+kZctxttnakTrRFFG1C79BBnl99GpNVaq+L4Z7LTM1auf X-Google-Smtp-Source: AGHT+IEHQREL1yU+ZeXIKm7JcrOtZodRZv1Pay7oLDNgAoghKe+2nGDVRkMSNZ6CfZXqCCR5KsACFQ== X-Received: by 2002:a05:6214:3990:b0:6c3:5dcf:bf5a with SMTP id 6a1803df08f44-6c7bd5e2475mr182982556d6.37.1727101643593; Mon, 23 Sep 2024 07:27:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:2302:b0:6b0:7204:3b2 with SMTP id 6a1803df08f44-6c6b482082bls474946d6.2.-pod-prod-09-us; Mon, 23 Sep 2024 07:27:22 -0700 (PDT) X-Received: by 2002:a05:620a:4482:b0:7a1:d73f:53d2 with SMTP id af79cd13be357-7acb8d8ae73mr1919265185a.20.1727101642731; Mon, 23 Sep 2024 07:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727101642; cv=none; d=google.com; s=arc-20240605; b=gm2CmfMumfJ8yObFYRTotgemj24h19ObJfvjCUQWZ84pwXn7m9Wmwvw4Rc5hwj7ASV E9p6ZD3xnFkYh04WLMsCc6wnE5XCxOpa8HmUHQ1K+4hg14P/fgb2yU7f+xzv4seAme86 OYEB4pbVtrHxCS/mXpQS6EYlYUvrnvZsyhDKqOT4j2DpkMIeCOqbawH4Cdg35g6YA+3v 4NHIfqFrg2SNic3XE8BB3+SGEvNwHpYsqHxscG9OhonFEEg/Ni22+8ch/bP6zlcEmFia ZTPNWl7yjyaP3aTuoz9G5uBCqt3fIVCZlS/pRq9dujVOh7iTOmkh0AiJJJ2vd0DSgPdv lC3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=bTSON0SSup0PZayWX7CzAbWyxpgtmmgFMuArDGHA1gw=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=ckKmTpCFwowyHjgzkPFyYUfGbJ0nuE5atCPTwNp22sErxaJQlnUZhIEH6SxgT4hXSl DjkHh1n+unt+oFELYw2n/nVact4Z/mQpXeubfZCSq05XV5BhMsRfLxEfGqegEusE6jAl GdBYh7DlnWasLtK2NioK3VExUOedNUoo3hQ7ILAPPhs/PhUm/7V0DkdxIRV+tgdoTqjJ f0SqlipoJXjqhTvwqBLY1GgfJK1Ahm4Po0YgB+MSaNIWwFX5jTyDIS2MRI2NxftkYAzg KnHxr0Srqjn2+zmzvcLnrgsCbqBY3oTzOFkkv2hh8hkBD1XWQUWic+ALb6/ySumzaUTw NW1A==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=MRQCc2+n; spf=pass (google.com: domain of fm-1212295-20240923142721cd482e180dd51d059f-ufhpbx@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1212295-20240923142721cd482e180dd51d059f-UFhPbX@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id af79cd13be357-7acb08db638si44341285a.5.2024.09.23.07.27.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Sep 2024 07:27:22 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1212295-20240923142721cd482e180dd51d059f-ufhpbx@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20240923142721cd482e180dd51d059f for ; Mon, 23 Sep 2024 16:27:21 +0200 From: "'Cedric Hombourger' via isar-users" To: isar-users@googlegroups.com Cc: Cedric Hombourger Subject: [PATCH] image: copy .list files from SRC_URI to the image Date: Mon, 23 Sep 2024 16:27:04 +0200 Message-Id: <20240923142704.389438-1-cedric.hombourger@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-Original-Sender: cedric.hombourger@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=MRQCc2+n; spf=pass (google.com: domain of fm-1212295-20240923142721cd482e180dd51d059f-ufhpbx@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1212295-20240923142721cd482e180dd51d059f-UFhPbX@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Cedric Hombourger Reply-To: Cedric Hombourger Content-Type: text/plain; charset="UTF-8" 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-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-TUID: 6pnh1jBCELir 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. Signed-off-by: Cedric Hombourger --- doc/user_manual.md | 14 ++++++++++++++ meta/classes/image.bbclass | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) 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 ``` +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). + ### Additional Notes The 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() { } addtask deploy before do_build after do_image +def apt_list_files(d): + lists = [] + sources = d.getVar("SRC_URI").split() + for s in sources: + _, _, local, _, _, parm = bb.fetch.decodeurl(s) + base, ext = os.path.splitext(os.path.basename(local)) + if ext and ext in (".list"): + lists.append(local) + return lists + +IMAGE_LISTS = "${@ ' '.join(apt_list_files(d)) }" + do_rootfs_finalize() { sudo -s <<'EOSUDO' set -e @@ -429,6 +441,12 @@ do_rootfs_finalize() { mv "${ROOTFSDIR}/etc/apt/sources-list" \ "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" fi + if [ -n "${IMAGE_LISTS}" ]; then + rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" + for l in ${IMAGE_LISTS}; do + cp "${WORKDIR}"/${l} "${ROOTFSDIR}/etc/apt/sources.list.d/" + done + fi rm -f "${ROOTFSDIR}/run/blkid/blkid.tab" rm -f "${ROOTFSDIR}/run/blkid/blkid.tab.old" -- 2.39.2 -- 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 email to isar-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240923142704.389438-1-cedric.hombourger%40siemens.com.