From patchwork Fri Jul 12 05:09:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzimir Bely X-Patchwork-Id: 3678 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 12 Jul 2024 07:43:44 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f58.google.com (mail-wm1-f58.google.com [209.85.128.58]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 46C5hhF7020532 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 12 Jul 2024 07:43:43 +0200 Received: by mail-wm1-f58.google.com with SMTP id 5b1f17b1804b1-426724679f0sf13496895e9.0 for ; Thu, 11 Jul 2024 22:43:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720763018; cv=pass; d=google.com; s=arc-20160816; b=l2b4WSsIndvJylozUbKRsr0S1ZHc7UVG2S9rQmwyr/jCE2n7wILSyxad0qqlp3Yz+e GU99SKi+6L8FpfvrFnspScK/+JqRufw24AqgZ92Cl1XIgBUXxjcC6syqesj5rr/+zNps tmpAVOSZBc4gEiqRWUXOZCX6qWs16/fmOXH5VCwy3CagBcDx/kQCmF0woUWdgWDTUh1L sJRe8wCvmPJEjbeZ8l5yW6I9kCpsgQuew/Uv9CNAktVsWYHyH2ebErhFi0SL+iItDFN/ r+CAJUTtsLYDXI2L7GJjnCYmaWdtUqc2wAiiYC/9uzsWb304BgQyEpKOkL4+uyPmGLJ+ JdGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=KyI+INZKz66Zgtf3OyOOwbFkz56JAiJm6A8veMeZCV4=; fh=g31F5OX17WriiFRevppDJeoh/SshLQrA0uqWyfTFR2U=; b=BDXap0/VslMm76CtsFDpInLkCyoI/m28XgSp0FBNVKSrRGjz0SznA6CFoQX3Fik/SD hdglpXgBhHb8XFBZP5VEbrTBzgml6uFlAuIsq34bajpgusIpFl9v0W+ONoXIi3ETs1Cc hm6S1U2kBBWkMZqPVdKA3xLoArYzL+nZfTNjK1U+LYlWSAa2MFDeRTSTRdOFJ5CPsuPn +DXodiRsOMqK9b/IKPNbFuJLha9apYkHIUYpP8PZRvhb1tRIHk+KCVYSS8FqEkFV10rV eGWurkLJh/hNcGNcp7/7wxEPbsqQgKtacEoHrnvN1QEcbKBGF9ZLFUyKvx12CH8X3zNS ybqA==; darn=isar-build.org 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=1720763018; x=1721367818; darn=isar-build.org; 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:references:in-reply-to:message-id :date:subject:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=KyI+INZKz66Zgtf3OyOOwbFkz56JAiJm6A8veMeZCV4=; b=AcXnpVvqfUZKZw/qcpDIzcy5TE5YhmBCVsvq1E8hJCXuROwbIbP0+sfL7u8BbbEAd/ iOVJwmToaEfhZxo0zajF1WTFyfFCT/0MFOq6JVoy151K/bhNcIRM3XUEWTnipRbSUjpq LavbBvFdRQX6Wz0T3wIfV6w+njqSO4Bw9IBi6g1WINnRACKi3zCusw5J/QhW6z6VkasO mrBn7YtnxkmvQu6AByvBO9L74l7euW7yeITL6eebog3pQ8zrX3aeIPQvADu1L9iWMwFn jm2qkymJsVf69eokaEtsOJ+HnxtCb2uzoYteHHpBrxX5mlo5D2HXrGrE8rsj3I8JSTQD ZYRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720763018; x=1721367818; 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 :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=KyI+INZKz66Zgtf3OyOOwbFkz56JAiJm6A8veMeZCV4=; b=k1G34kuGp2PygkwEOtUDKz5qN8tL5G9CmN76FS0WYUBoQq5Ocy9v3fgS2xEul++2Fa Ythi4fR66Ebz/XEdXTfEvNb+L/Opx9L+vR0x6E/Tx0W685g8KIC/UvYEEzqt8PqAFCtb 1NvGtjxg8R/jD9Zr563P3sRxUIKztp78zACDRBDc4fZX/3UmwzwTuvdyIudg/63ygo4u bp5Y5R+9r37JXAZMU6qKl2Io7LSjKZ/t6d2wmqyRAgbPY0JhwAeQ1mBTOCgMZQztV919 tg0ADYSxXsCF/XC53cMXPMKJyayPHT2C7fVNhBYaAEjhVjXvzD2n57C6qM0KZih4fffJ eZ7w== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWk/bAx1ktLk56rVbb9cjieGu83e+mbM/0GiBo6UGqxjEKZgNm16QyaGhRmwXzOlc9rQdstfzoH8B4zovppr+XHVN+rxnU= X-Gm-Message-State: AOJu0YwegUw5zYsl8RsGoJJ9YiYOzp22HZYMjNeJeTTseN2vyzqKG2az 1eSKMk0ZtHBs5jGNmoYpjvVMWJ2vJdKHjteVg+ns6Q/zv49iwUA2 X-Google-Smtp-Source: AGHT+IGOlXGCJdQ1biqglQdmzHQHbdxEEaYoYzbsYao7dw7ZpXtJ7/gfskkaC0q4Pl53FC6jT5BBFQ== X-Received: by 2002:a05:600c:1c1c:b0:424:8be4:f2c with SMTP id 5b1f17b1804b1-4279dabdfa1mr13873115e9.2.1720763018004; Thu, 11 Jul 2024 22:43:38 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:5118:b0:426:ab3f:fafd with SMTP id 5b1f17b1804b1-427989fd568ls6928535e9.0.-pod-prod-00-eu; Thu, 11 Jul 2024 22:43:36 -0700 (PDT) X-Received: by 2002:a05:600c:33a5:b0:426:6fb1:6b64 with SMTP id 5b1f17b1804b1-4279da024e6mr12998185e9.7.1720763015833; Thu, 11 Jul 2024 22:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720763015; cv=none; d=google.com; s=arc-20160816; b=Y4FA9OcEzLmG/OeUke4laWdnpx9nzx8Xw28iTE01HHdrT40OcbAOigFQ0Sm3XhoZs+ 8qNcVU2BUxI4jdT5lxFSCEiRpS7PZ6w9yOr0SxS2pGSQzdLzKqbpQTSLMXCl+Jc7Z9G1 BwFglDJcMa+jMMSvS0G2ej/XTcxZJadatFwP8+StSkFTeARI3wekNz16gcQweO2609UV WLayWt5mjR9qs6N3rHp2f9GN/SxUe2S2eOheH3GsM2YaLkbmkd2B+egKG5jEf/TFNeyx 6NKBBQ2InZo5wxUIjwFceC3Mr1xRdtSGoKiKhAUtCyylQxikgq4zWrayZ5/9/Yi3Eact oQlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=IyGH6Pl1zOahJo1VivY/FOyEaagrViJOppPLbyhSZrw=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=h5IeSYm4C4kvorDkM5BrVjPEl1L6a8NzFvbBYCQyobZUe14Xnw21MP9T8kyTUZwG6R pjCTmD07KSGLMhlx3DOzxLQfw1zoLXwDXoZ9+TnZScsepzYpNYBNFcEvFhKhvLXB/iRr yDAMwG0ND/HNe6NiumyAweU/t9G4ZICDjJTlM/SsZ0cKAvvTfBpwp/FvgJlAMHheFqOl NGMqUzhSRN1z74Zhi5l34iZiIu8eyJREg/TVyQ4iNoziqPRDNsL5OEfXA4u2ip0PlzrA vBXlkXylKsLuYAt0WszpMATIE7kvCYe4Y9FWOdZNmcdMEEPpTWbzSoh1zCkeGg0K4QHw 4W9Q==; 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 5b1f17b1804b1-426725585f2si3636045e9.0.2024.07.11.22.43.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jul 2024 22:43:35 -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 hp15.promwad.com (mm-89-47-121-178.gomel.dynamic.pppoe.byfly.by [178.121.47.89]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 46C5hWxw020492 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 12 Jul 2024 07:43:35 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v2 3/3] meta: Move DTB deployment to a separate dtb-files recipe Date: Fri, 12 Jul 2024 08:09:34 +0300 Message-ID: <20240712054327.9526-4-ubely@ilbers.de> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240712054327.9526-1-ubely@ilbers.de> References: <20240712054327.9526-1-ubely@ilbers.de> 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Task do_copy_boot_files deploys DTB files into the same location for different images (e.g. -base or -debug). This causes build issue. Introduce `dtb-files` recipe responcible for extraction DTBs from linux-image package (distro or self-built) and their deployment. Different images for the same machine now depend on this recipe and don't cause parallell execution issue. Signed-off-by: Uladzimir Bely --- meta/classes/image.bbclass | 16 +++----- meta/recipes-kernel/dtb-files/dtb-files.bb | 45 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 meta/recipes-kernel/dtb-files/dtb-files.bb diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index c29d9e26..3644183e 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -328,6 +328,11 @@ INITRD_IMG = "${PP_DEPLOY}/${INITRD_DEPLOY_FILE}" # only one dtb file supported, pick the first DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}" +python() { + if d.getVar('DTB_FILES'): + d.appendVarFlag("do_copy_boot_files", "depends", "dtb-files-${MACHINE}:do_deploy") +} + do_copy_boot_files[cleandirs] += "${DEPLOYDIR}" do_copy_boot_files[sstate-inputdirs] = "${DEPLOYDIR}" do_copy_boot_files[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" @@ -351,17 +356,6 @@ do_copy_boot_files() { cp -f "$initrd" '${DEPLOYDIR}/${INITRD_DEPLOY_FILE}' fi fi - - for file in ${DTB_FILES}; do - dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \ - -iwholename '*linux-image-*/'${file} | head -1)" - - if [ -z "$dtb" -o ! -e "$dtb" ]; then - die "${file} not found" - fi - - cp -f "$dtb" "${DEPLOYDIR}/" - done } addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install diff --git a/meta/recipes-kernel/dtb-files/dtb-files.bb b/meta/recipes-kernel/dtb-files/dtb-files.bb new file mode 100644 index 00000000..49f0d584 --- /dev/null +++ b/meta/recipes-kernel/dtb-files/dtb-files.bb @@ -0,0 +1,45 @@ +# This software is a part of Isar. +# Copyright (C) 2024 ilbers GmbH + +inherit dpkg-raw + +PN:append = "-${MACHINE}" + +KERNEL_IMAGE_PKG ??= "${@ ("linux-image-" + d.getVar("KERNEL_NAME")) if d.getVar("KERNEL_NAME") else ""}" + +DEPENDS = "${KERNEL_IMAGE_PKG}" +DEBIAN_BUILD_DEPENDS = "${KERNEL_IMAGE_PKG}" + +do_prepare_build:prepend() { + mkdir -p ${D}/usr/lib/${PN} +} + +do_prepare_build:append() { + cat <> ${S}/debian/rules + +override_dh_auto_build: +EOF + for dtb in ${DTB_FILES}; do + mkdir -p ${D}/usr/lib/${PN}/$(dirname ${dtb}) + ppdir=${PP}/image/usr/lib/${PN}/$(dirname ${dtb}) + cat <> ${S}/debian/rules + find /usr/lib/linux-image* -path "*${dtb}" -print -exec cp {} ${ppdir} \; +EOF + done +} + +DTB_PACKAGE ??= "${PN}_${CHANGELOG_V}_${DISTRO_ARCH}.deb" + +do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}" +do_deploy[cleandirs] = "${WORKDIR}/deploy" +do_deploy() { + dpkg --fsys-tarfile ${WORKDIR}/${DTB_PACKAGE} | \ + tar --wildcards --extract --directory ${WORKDIR}/deploy ./usr/lib/${PN} + for dtb in ${DTB_FILES}; do + mkdir -p ${DEPLOY_DIR_IMAGE}/$(dirname ${dtb}) + find ${WORKDIR}/deploy/usr/lib/${PN} -path "*${dtb}" -print \ + -exec cp {} ${DEPLOY_DIR_IMAGE}/${dtb} \; + done +} + +addtask deploy before do_deploy_deb after do_dpkg_build