From patchwork Tue Apr 16 10:07:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicusor Liviu Huhulea X-Patchwork-Id: 3493 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 16 Apr 2024 12:09:07 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-oo1-f57.google.com (mail-oo1-f57.google.com [209.85.161.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 43GA90Ye022351 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Apr 2024 12:09:01 +0200 Received: by mail-oo1-f57.google.com with SMTP id 006d021491bc7-5aa26b7b674sf4136068eaf.3 for ; Tue, 16 Apr 2024 03:09:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713262135; cv=pass; d=google.com; s=arc-20160816; b=qJjRAjI41tG42X9ebnWyn4w+NT3bPEFEhvTMUcXXq7SMMGKCm7luC9An3ERMXdz9au 7LLgyTrT4JcKpLZ7LPHi7Ij3GhIQG9tp1WIVUdZ+xYrD2sHw+CPeStKuyWcxpDwrpR8/ lK1XTVI4Uss44ts8prP8wn5OGVV6j1/OFOKRBV6Kcslj7A1rIJs8XRmJQZkY2TRvMLka CHfBoXz3wZErelaPPIhXLh0+fxxogsm0dIpA74oa2zJa7ZgGu4JshQlfDt4KnSdjQRnM l237+Mq3pWJmKOELVS+xjgfRYV0bXDf0TPmKqsT8YvlsbaLJZH8pINeMbz+SRSOaf2NY XDZA== 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:message-id:date :subject:cc:to:from:ironport-sdr:sender:dkim-signature; bh=imOjTjxwAd8ipGsxEHgWiDhtuxRRQw6sP9oRUaMks9Q=; fh=Wb9SAYXsUPXAsgWd4uyMDQsnMenS/kK5kH9hE0Ij9pU=; b=VybAnW7Srfo6SX+bfHlEZ71CTINaWs2nVRtNi7NQ3YpuHgv+jhnC6EONtVaf7jFuah xP17P2x9fxKkp2XQDLUd1k11JmVgOF+Dx1aDzeLegw94HqBNp+0DwO29WnXtCTh+Me3u Wsrj9q9vXf6zeTnjduQ1mQUgQaDtgYDa9K5VI7u/WXUe9hJyv7xahWHGuRJ29jF4Lkzv o7Kli8iy8i813e3xuKmJKoCY/2/yz+vlr0J0cRNUSzMuJnuMa/HNFy3SqAQh8oDjzZaU DHgbWymWhOh1he23NoW4DLUh6wFsMv0XFqOOu38mEiCW2MHsYuHPIVK3Nfvl5895xOB1 Zj2A==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of nicusor_huhulea@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Nicusor_Huhulea@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1713262135; x=1713866935; 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:message-id:date:subject:cc:to:from :ironport-sdr:sender:from:to:cc:subject:date:message-id:reply-to; bh=imOjTjxwAd8ipGsxEHgWiDhtuxRRQw6sP9oRUaMks9Q=; b=jfXHXUQti5jbwTIzEm8gYuWyqMAcOXUblHMf7eRu8tRHEqqdyGlViIxaHxoCsBpzT2 g6UAn9Lo/9SJYDRL7kfPq77WTbQbaKbt0alibhxZpw2buNBP/AweDIJDPTbp6BcQXU3q hT59Rl4WeWujFMdajPqsXsXJYHo+AhNujI779nEUrm2IZlaCr9JhnMI8wE/r60kjjgjy u67SCbcZ7lN15qJvaHAhyYF7i+QQQ1gWzbZ7aoJpjzeCKs8VG6UI+wwIzHOmYfrHqMNj RN5nKniMjJhzbewCUij8rAs1hJhpDbvreQ/Uslz2YAyyMvw6Rz7kXa6U9Aas+ssTpNzQ LNiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713262135; x=1713866935; 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:message-id:date:subject:cc:to:from :ironport-sdr:x-beenthere:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=imOjTjxwAd8ipGsxEHgWiDhtuxRRQw6sP9oRUaMks9Q=; b=G8MwLi2F2YUjzWmKIISx4UDZ+H7VGq5/UppFX7RnOU5XcDFqd45O5BkU/cuvHEZVV/ DPR4JGJ5SV7FaRn3GGcQwZpru873l9KQL69TnXxs/VFNEC+xmtcOw53mNYSqL4Ga6SHq S8Um4Dy6WaO7WOdYSOvXzOhkwli3zPtsvvKCDpa4Z3G8de8WiGfbrFcOy28o09bjLxSJ VfCg2U/NgqWCC2FewNqaWrV9mAW24AlHIlpUZcXy+3yX2d5byvKbd3msVepSWCVFNxyU Mm8kog/eOHBETmORMXUYMB4NaIiuI5X2iYs9vLxnHRb6l+eTQ0A7dC3GbU8oFrMgxcaN vhSQ== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXdzZW7s4X9e3PgblAuAENpUsq8nv+HomuD4GzwC6SKmle6rpjTeQZE5jF0RoDTbM89MD5QFe6D/QvzwevM0/eu2G/YAyw= X-Gm-Message-State: AOJu0Yw1gxKijKu9/lY6XZTWRQnjLN2xYJBkRpF2iEGUKQTTmW43qf6p vyyvKNH3a6PsDdQ9apm5cDl54k19qrdBtFdyH5FN5feP88FGjRW4 X-Google-Smtp-Source: AGHT+IHSJ+oGN3//dGXm8Lfr9owBMjiiJk+xSS22bJ1+7owVXRBHy0yxVK6g6SyYmA3SnUvKa2Kpgw== X-Received: by 2002:a4a:ee84:0:b0:5a1:cefd:73d6 with SMTP id dk4-20020a4aee84000000b005a1cefd73d6mr13040388oob.7.1713262134757; Tue, 16 Apr 2024 03:08:54 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6820:220a:b0:5aa:328b:95c8 with SMTP id cj10-20020a056820220a00b005aa328b95c8ls4425896oob.2.-pod-prod-03-us; Tue, 16 Apr 2024 03:08:54 -0700 (PDT) X-Received: by 2002:a05:6830:2681:b0:6ea:3850:b30e with SMTP id l1-20020a056830268100b006ea3850b30emr396884otu.5.1713262134260; Tue, 16 Apr 2024 03:08:54 -0700 (PDT) Received: by 2002:a05:6808:218e:b0:3c5:e8ff:ff1e with SMTP id 5614622812f47-3c608d34730msb6e; Tue, 16 Apr 2024 03:08:09 -0700 (PDT) X-Received: by 2002:a05:6808:a95:b0:3c5:fce8:26cb with SMTP id q21-20020a0568080a9500b003c5fce826cbmr11918875oij.48.1713262089419; Tue, 16 Apr 2024 03:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713262089; cv=none; d=google.com; s=arc-20160816; b=O7s/8BszuoDn7M53SS1HRugWnF4XzkjqRGBi7WDpnqFaatOWEE3Gg20SiSR6HxG/cf zOt3xO+3CViEc66Gn6MKrucRB6ldwj9JlbI/uVZXCvl7OMNkig6uGJwrvE43FNdOqHDh IU4WVoXIbSL+e+DvD9kiYK9qI/4SyJ0JrrrDWXfs8pD3XPXEtIIgoepWux/NMLpYuoKD wV1mGSxyzRBYm4u/EMcH7miia7aBBbATJJgHdrAVAekaTtxlektqkPebhP4PDzhzcLnq yyTt/3vYzhAetPNwqznXkmT30RYlQUZPpgXixlO4pwzwl8qw2ShXYrYDDEcS/fIXrkaH 29ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:ironport-sdr; bh=Nx8ykXcuJxa5XmSwLoqFUQeEib0UGZ3O/PxQoxsd5sQ=; fh=bgh6wBS8loqnXFOCXAZU71I9Ia6DZTCdmCkjeI89i70=; b=fCQ6bpiSxHxNlmCUg3tMizDNnWOP8px6X43kJnkm0scuVJcOiSoSYzyLsOCrWIru3R +20HpccUsFjxfQ1dU5e06gikwVmqEN9pvvD9tVLA2B+IKMNlfPOg9FyL5k8DJ06qx2s1 ryYKeC0cohDHXRBri1VL3EOh0xbliF8qi98T9Vv+Q1IMDI6wpt6bdTo7+9u7u5NV7j9o ygJKmCQDj5bPQA85Wty3lGhEwwWe/M1ewiKutJLj5UKi94QkZN1RXRdQIzillOgAk9yk S6mRnRChqfZz3zYMHnomlOvci00GpkETWuWj7A2gNTUzmUEZZc9mkhUJcbk2NzvbFik2 KJoQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of nicusor_huhulea@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Nicusor_Huhulea@mentor.com Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id ra19-20020a05620a8c9300b0078eddf5584esi341294qkn.2.2024.04.16.03.08.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2024 03:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of nicusor_huhulea@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; X-CSE-ConnectionGUID: aiMJksHhSJ6NwQ8KibAiog== X-CSE-MsgGUID: 9Xe+lM3eQKKHJ5Ao0KvzEQ== X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="34203079" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 16 Apr 2024 02:08:08 -0800 IronPort-SDR: /TtSda6Z8aawkANT3dNG8ipoT2vpmZ6XrqOtMnY0w8o55xJZAssjerXfpg2jyPvpGGXaG/yJ+Y QhZzuW93vA7M4UL7DoHAKQ6mBJFo8LxIVQ3bNvSyIQTdmhhg/s01ti1zTtSRZJ1oUrV+yTjBWq KNKb83MchjXSDYjJfO6dMS6nKZf1SrP2hTwnojG8lEFgIhRQOIKDlmZiT+8Q48iz3vkRj+m/h1 8Rq0mH3yJM0gQHLzHD0jUGtQizu8lb+snnV4uPWKzHlvxP0b3feCr8wKqEinckbkJhRlpOi11Q eNI= From: Nicusor Liviu Huhulea To: CC: Nicusor Huhulea Subject: [PATCH v2 1/1] copy dtbs into a subdirectory based on image name Date: Tue, 16 Apr 2024 13:07:46 +0300 Message-ID: <20240416100746.5681-1-nicusor_huhulea@mentor.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) X-Original-Sender: nicusor_huhulea@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of nicusor_huhulea@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Nicusor_Huhulea@mentor.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Nicusor Huhulea There are cases when multiple images are build and because the same dtbs are copied in deploydir we have a build failure. The build error is related to files that are installed into a shared area where those files already exists. To solve this situation we will copy each dtb in a subdirectory based on image name thus avoiding the conflicts. Therefore the other areas needs to be updated on the dtbs paths. Signed-off-by: Nicusor Huhulea --- meta/classes/image.bbclass | 21 +++++++++++-------- meta/classes/imagetypes_wic.bbclass | 2 +- .../wic/plugins/source/bootimg-efi-isar.py | 8 +++++-- scripts/lib/wic/plugins/source/bootimg-efi.py | 8 +++++-- .../wic/plugins/source/bootimg-partition.py | 10 ++++++++- 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 98741da0..e90f8fde 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -364,16 +364,19 @@ do_copy_boot_files() { 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 + if [ -n "${DTB_FILES}" ]; then + mkdir -p "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" + 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 + cp -f "$dtb" "${DEPLOYDIR}/${IMAGE_FULLNAME}.dtbs" + done + fi } addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetypes_wic.bbclass index bce881ed..adbde400 100644 --- a/meta/classes/imagetypes_wic.bbclass +++ b/meta/classes/imagetypes_wic.bbclass @@ -107,7 +107,7 @@ WICVARS += "\ ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS TRANSLATED_TARGET_ARCH" # Isar specific vars used in our plugins -WICVARS += "DISTRO DISTRO_ARCH" +WICVARS += "DISTRO DISTRO_ARCH IMAGE_FULLNAME" python do_rootfs_wicenv () { wicvars = d.getVar('WICVARS') diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py index 4bfb70a0..218a7fe7 100644 --- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py +++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py @@ -57,7 +57,9 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd = "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) + image_fullname = get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir = os.path.join(bootimg_dir + "/" + image_fullname + ".dtbs") + cp_cmd = "cp %s/%s %s" % (dtbs_dir, dtb, hdddir) exec_cmd(cp_cmd, True) @classmethod @@ -353,8 +355,10 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") + image_fullname = get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir = os.path.join(deploy_dir + "/" + image_fullname + ".dtbs") dtb_params = '--add-section .dtb=%s/%s --change-section-vma .dtb=0x40000' % \ - (deploy_dir, dtb) + (dtbs_dir, dtb) else: dtb_params = '' diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 634a808d..07b177df 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -51,7 +51,9 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd = "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) + image_fullname = get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir = os.path.join(bootimg_dir + "/" + image_fullname + ".dtbs") + cp_cmd = "cp %s/%s %s" % (dtbs_dir, dtb, hdddir) exec_cmd(cp_cmd, True) @classmethod @@ -334,8 +336,10 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") + image_fullname = get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir = os.path.join(deploy_dir + "/" + image_fullname + ".dtbs") dtb_params = '--add-section .dtb=%s/%s --change-section-vma .dtb=0x40000' % \ - (deploy_dir, dtb) + (dtbs_dir, dtb) else: dtb_params = '' diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py index 5dbe2558..1ae6216f 100644 --- a/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/scripts/lib/wic/plugins/source/bootimg-partition.py @@ -180,10 +180,18 @@ class BootimgPartitionPlugin(SourcePlugin): logger.debug('Kernel dir: %s', bootimg_dir) + image_fullname = get_bitbake_var("IMAGE_FULLNAME") + dtbs_dir = os.path.join(kernel_dir + "/" + image_fullname + ".dtbs/") for task in cls.install_task: src_path, dst_path = task - logger.debug('Install %s as %s', src_path, dst_path) + + dtb_file = os.path.join(dtbs_dir + os.path.basename(src_path)) + + if os.path.exists(dtb_file): + src_path = os.path.join(dtbs_dir + src_path) + + logger.debug('Install %s as %s', (src_path, dst_path)) install_cmd = "install -m 0644 -D %s %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path))