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, 13 Aug 2024 13:56:36 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f192.google.com (mail-lj1-f192.google.com [209.85.208.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 47DBuYxe015822 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2024 13:56:35 +0200 Received: by mail-lj1-f192.google.com with SMTP id 38308e7fff4ca-2f16a786316sf37128491fa.1 for ; Tue, 13 Aug 2024 04:56:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1723550189; cv=pass; d=google.com; s=arc-20160816; b=Odfqk+UR6gqX0o8LDqY2tus8zSxhNUQ3eOCr1QrF7VpQGeNezchsFyTtWDjInNAAA7 z6rrj8qCCAKAwbRMmD4XNVUe78xUmFwiDWv+fcv52TDqtyvpnx8zmDYcSpWOzUkCILMJ cgRY3b4GiFm3Wuz6ewDysRKB6VxiGLjzwBXy/o4oYWGYT6k7W0CM+/HuMrs6NSCzBlBf CyX1ugtiw1vVS6OTVbVGqrqqoq7lbwDfbal5ZitnwWJAPrer+M7UqJz/ghnghKbtcl1l /hAeoymwOEAOvq9SQgL4nFj7otAL4a+qOuZHxFPg2mzp8i5tyhjdKdT7WMJVpQBalXkG QM1A== 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:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zY6lH3TPjseLCeyP/6lV1dQr98SJ4j04FtRoG+6C6Lw=; fh=KOEhVNRT7zbtb4v8VRHrDBQmyG6/QJB/aweh5wXGOMY=; b=fqjVZOFbd54+s76dR1ZzyGqEhxIzHkrwYd4hWlKNVCMX+Icokm0FAHUJCy8qavADqE SCeooMYpyoChMG4W6rdLBLb7wpfRK9Cm+pNUzgF/a46Rjk5+drhIFRL7fb9nfxihByWi FRyVqekGs5QPv0eDyg6Uap2CyXwRWcNrhtU4a92Q2wf7NUNiJ9XbpjTxncYttXGa0u6t 3mmxrihqaVe3qa91wW2cNdY8k3fkZSFS6U0jJdLMunhI3ZVd0+PjfMAVuwSg2z32pDQ4 m1sAquPlSNZM1Fxlrmk1O1d9ccY6jXfNPUib5HA4bo8qUoNe/ljAcGMPDDscd4x1DePU bdYg==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fjCAmlTE; spf=pass (google.com: domain of fm-1327153-202408131156253b26fe288a19371416-dp9npq@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1327153-202408131156253b26fe288a19371416-dp9NPQ@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=1723550189; x=1724154989; 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:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=zY6lH3TPjseLCeyP/6lV1dQr98SJ4j04FtRoG+6C6Lw=; b=sFgvjoLcAZcVUqKhZ5EPHcQIFXdUfmn3YfUITSnv/9VH5L1LoCCHl1ENg+OT6VZi6d bBBWzlrSmeREkgRH+kRWx5hLxsEs8lEcKUbuxMkJnoddWrclAGmJSM7px3iWzBVG6Dwu 6dbpPXydfJjg8IaHuqw6pjFxglNYqJOLeFLS+7mZmy65lO0eLBMPoKZEaYe38j1i3RzO PFuk9q8H95UCFZiqfWtkBJ6fXBU3UQoPvPWiGxODTMi3CJH1R5fhQZf9R/1ZeWas6mMd CGUiLnHmYnpQOSizltoPF9FXAxuEhgQVDtb4rt+yXnwhoZUThpv7G9Fvg5knL8iHk75h O2nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723550189; x=1724154989; 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:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zY6lH3TPjseLCeyP/6lV1dQr98SJ4j04FtRoG+6C6Lw=; b=bE62VCR5BriC9fljSbBvtwMwtanq0DQwKrDW0CMGDQ+EvvyaKwNx+eNfbo7RLFf2pq YusBQuYxErkBRaijL3FG8nODIkaeoKx3v8IqOS8ByEhTKV3QtJJxSlWaZJSpZ3Kj58RS bKrb0iwQVKmaapDDhCp6L2VF84ppimO7l0N2CQvZlILXij8YtT0PX1LNuYuE5xfuLnpn ZRWViglHiLR+3vh4eCFIgqHAy2tLxp8l1i7YFZTCvV1VxkY6plWjTQ6ewGKdGBGuOWe/ E+5EbkMWanQUFt8UqSMKttyp8QxS8M9xhi66vd2iLNHZOf+IAxeo0lXTlzHLrO4QFydf qvrw== X-Forwarded-Encrypted: i=2; AJvYcCX9Ey+O0QyF+Q8vO3ESIrbZvI1Fs00fkxhkWyhFBd4tqw6ODMq/FSQbjy5xyKbndeENSOl12E00kh5ALVERwA== X-Gm-Message-State: AOJu0YxnvauPYQMPGvYo/BabwGD5RP6fRAAn5SL+DG+7uWsGCXuMueq2 P7pex/UWCn9Qymxv8FNoS/20tba0sxeFtkw2c51rBecHSAqX2oub X-Google-Smtp-Source: AGHT+IEDz+n1Q7DJdkZidPlPyyr/0W1JUQpayL2rq2hxOv2hr+GtmL69M9OrZc/ryxTySFiCrwEfEg== X-Received: by 2002:a2e:b891:0:b0:2f0:1d1d:f2ce with SMTP id 38308e7fff4ca-2f2b8f3f8bdmr9049731fa.26.1723550188556; Tue, 13 Aug 2024 04:56:28 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:2a41:0:b0:2f0:1e8f:d12e with SMTP id 38308e7fff4ca-2f19bc6242fls8700911fa.1.-pod-prod-00-eu; Tue, 13 Aug 2024 04:56:26 -0700 (PDT) X-Received: by 2002:a05:6512:2207:b0:52e:f9f1:c132 with SMTP id 2adb3069b0e04-53213d977a9mr776030e87.4.1723550186224; Tue, 13 Aug 2024 04:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723550186; cv=none; d=google.com; s=arc-20160816; b=Cz1hYH4312l/SZudZYTU6Nr7sPdp322SkvF6cG6+SgpuSzhXqBvm6ijbibU6MH1tWt qg5oPyzT/u5nRODr5/uDJyTLUAQyZN4bZp30H1PdH7SB+BbwDdV3pAur+j/soYCkRr3C BjTlNX6L1jXdKG7dfbD5otWVbKuNm100TB1AGCldcMT6J+Jr1pU6+CCHJ7a17T0/jrfE +E9SSqeHMV5m/sx1f2kcjBlcaTJ8GINpR0ysIaJ/CKPZiAvnY02RWtIBid0eAlDTDN6U 41YM52sUmLN9yz3g9nCJzbctzMaYMk9JIktJe6QgrzRto1demcMrXwYgi2wBMLEHT/Om Djag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=XU15djdN5hfKpXPsTMiLkMgCmlnklFthZK1yc8PzVrY=; fh=uEpizMaC9FZ5RjhWZ8Q38YHTDXG+3EPxv68QQHJHPnI=; b=oPDQeLZpK/GjtU5uSiqZBMK6AUgEOj4wW3YVORWyKEbvV3aLCPleyN74+LbcyUlEXm LCFMgwzY/3LyLTEHYXAca9xlU8sHXp3gB0V0sYVrKjd7hAIsR04sLJq/uzRH7Cw1YMEr qkOUgdWNsIPVxtrFpVHxNK0pDtYABZmtISNyaGyKfIgcc6eYs/4nw9t8cQO+uYCsf3NE NtXzfMPLCJtXqbtxMrtcRzfUuX+t2XetlzCh1QAsO4xJs/jyZVgxUNKIdfDKO66OsScQ 78tZACgNfyfhf/PWYResRV8Xjf1hQ+ceHdBUAZPx0dHgrV3gMAOmtzvlQzSJitG/ZoKY BiOw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fjCAmlTE; spf=pass (google.com: domain of fm-1327153-202408131156253b26fe288a19371416-dp9npq@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1327153-202408131156253b26fe288a19371416-dp9NPQ@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-53200ea4d92si158493e87.5.2024.08.13.04.56.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2024 04:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1327153-202408131156253b26fe288a19371416-dp9npq@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202408131156253b26fe288a19371416 for ; Tue, 13 Aug 2024 13:56:25 +0200 From: "'Nicusor Huhulea' via isar-users" To: isar-users@googlegroups.com Cc: Nicusor Huhulea Subject: [PATCH 2/3] linux-custom: compile only those specified dtbs Date: Tue, 13 Aug 2024 14:55:20 +0300 Message-Id: <20240813115521.381481-2-nicusor.huhulea@siemens.com> In-Reply-To: <20240813115521.381481-1-nicusor.huhulea@siemens.com> References: <20240802114105.1767411-1-nicusor.huhulea@siemens.com> <20240813115521.381481-1-nicusor.huhulea@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1327153:519-21489:flowmailer X-Original-Sender: nicusor.huhulea@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=fjCAmlTE; spf=pass (google.com: domain of fm-1327153-202408131156253b26fe288a19371416-dp9npq@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1327153-202408131156253b26fe288a19371416-dp9NPQ@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Nicusor Huhulea Reply-To: Nicusor Huhulea 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: dEW+64JECn+6 The current implementation makes a full kernel build and that means it will compile all dtbs specified by the bsp makefile e.g arch/arm64/boot/dts/ti/Makefile Currently the required dtbs are given by the DTB_FILES. These changes are checking if the DTB_FILES is specified, compile only those and avoids compiling all the dtbs from the bsp directory. Otherwise build all dtbs specified by the kernel source. Preventing the automatic dtb builds is made by using target specific build commands e.g KERNEL_IMAGETYPE The compilation of the dtbs accepts the following formats e.g: Kernel Post 6.x: a) full path from the architecture directory: arch/${ARCH}/boot/dts/bsp_dir/test.dts arch/${ARCH}/boot/dts/bsp_dir/test.dtb b) relative path from the dts directory: bsp_dir/test.dts c) device tree blob file: bsp_dir/test.dtb Kernel Pre 6.x: The same as on Kernel Post 6.x but without the bsp_dir The differences when building a full build and when using a specific target build are:(tests were made on the machine phyboard-mira on 6.x and 4.x versions) specific target: Build needed 00:02:08, 2219688k disk space linux-phy 6.x full build: Build needed 00:02:14, 2271528k disk space linux-phy 6.x The time difference: the full build took 6s longer than the specific target build The disk space difference: the full build used 50.6MB more disk space than the specific target build. In conclusion the specific target build is slightly faster and uses less disk space. For now the DTB_FILES variable should accept only Device Tree Blobs(.dtb) because some areas still depends on it e.g: do_copy_boot_files, plugins Signed-off-by: Nicusor Huhulea --- .../linux/files/debian/isar/build.tmpl | 56 ++++++++++++++++++- .../linux/files/debian/isar/install.tmpl | 12 +++- meta/recipes-kernel/linux/linux-custom.inc | 6 ++ 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl index 1fd6f948..15201686 100644 --- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl +++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl @@ -22,8 +22,13 @@ do_build() { sed -i "s/@KR@/${KR}/g" ${S}/debian/control ${S}/debian/linux-image-${KERNEL_NAME_PROVIDED}.* MAKE_COMMON_ARGS="O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS=${KCFLAGS} KAFLAGS=${KAFLAGS}" - if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then # Full build - ${MAKE} ${MAKE_COMMON_ARGS} ${KERNEL_EXTRA_BUILDARGS} + if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then + if [ -n "${KERNEL_IMAGETYPE}" ]; then # Override the default compilation + ${MAKE} ${MAKE_COMMON_ARGS} ${KERNEL_EXTRA_BUILDARGS} ${KERNEL_IMAGETYPE} modules + compile_dtbs + else # Full build + ${MAKE} ${MAKE_COMMON_ARGS} ${KERNEL_EXTRA_BUILDARGS} + fi elif echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild"; then # Build kernel scripts and tools ${MAKE} ${MAKE_COMMON_ARGS} ${KERNEL_EXTRA_BUILDARGS} scripts if grep -q -E "CONFIG_STACK_VALIDATION=y|CONFIG_HAVE_OBJTOOL=y" ${KERNEL_BUILD_DIR}/.config && [ -d "tools/objtool" ]; then @@ -38,6 +43,53 @@ do_build() { set +x } +compile_dtbs() { + local prefix="arch/${ARCH}/boot/dts/" + + for dtb in ${DTB_FILES}; do + # Handle the case where a standalone(with no path .dtb/.dts) file may reside within + # a specific BSP directory or not(kernel pre-6.x) + if [[ ("${dtb}" == *.dtb || "${dtb}" == *.dts) && "${dtb}" != */* ]]; then + bsp_dir="" + dts_path="" + if [[ "${dtb}" == *.dtb ]]; then + dts="${dtb%.dtb}.dts" + else + dts="${dtb}" + fi + + # recursively search for the dts file in all possible BSP directories + while IFS= read -r dts_path; do + if [ -n "${dts_path}" ]; then + # Eliminate the prefix and dts to get only the bsp_dir + bsp_dir="${dts_path#${prefix}}" + bsp_dir="${bsp_dir%${dts}}" + + relative_dtb_path="${bsp_dir}${dtb}" + else + relative_dtb_path="${prefix}${dtb}" + fi + done < <(find "${prefix}" -type f -name "${dts}") + + # Check if the path is relative (starts with arch/${ARCH}/) + # and if it does then extract the relative path from the architecture specific path + elif [[ "${dtb}" == "${prefix}"* ]]; then + relative_dtb_path="${dtb#${prefix}}" + else + # directly use the given dtb + relative_dtb_path="${dtb}" + fi + + # Check if it's a .dts file + if [[ "${relative_dtb_path}" == *.dts ]]; then + # Change .dts to .dtb + relative_dtb_path="${relative_dtb_path%.dts}.dtb" + fi + + ${MAKE} ${MAKE_COMMON_ARGS} ${relative_dtb_path} + done +} + print_settings() { cat <