[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ImageBuilder v2 1/2] Refactor sanity_check_partial_dts


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 13 Sep 2022 14:09:17 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MEXWX4yZaSQA0d1dChkxu1twPiiUlC11JnRmnwZf8V0=; b=Kab2njFk0k3r2FPF09olu7XxApf5K10OjQAryDGNldot/JZTnq87RPqCnxW4KfIZXXb/YYzNtRDITlXkitfugP4aYUnmDlgryLRXZy+FIBLiO7SJIYCyQnc0VcY1jxHwP1AGhzSeKtgcattcjWBQdvsttUC3DGtN8kfRNyxhf94hF9L/OCngCx7vReTggSHg7ROqsS8H1LJWO5eQ+XdQsC99EUUkDgYP7LaL34VJzpiU2wCO3s/B/NziG12tUt6Jn9tBBV0VofQB8D1Ku+6kw6mW2dDXYVaQm7TDtTyExOUA8dJ1UJgxMhBmbfOfqL5lGcnhPGXT+4b1zzk1nYiw4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XdTVpN6Cnl6mCo9qmBVSjK4vgNuKEKgycPzdr918sRDIOmKuNjHqa3wjoA0ntd8YeoP0qGaHdSlF6Eho3dDz0VH9yxggCQdLz9mXW0Ukgjy3+JKsbVqwkF79D5ZQJE5Idn9vVnd9PzzyR+j8hlLtR/UEzaawnZBs3rH6PG3aHZ+iiUpr8/sKWvGjCCQ9bMo2ppOmT0/2E2NWy4UDN4Ssg8i5bEgkI6sMtQv3izVVhDknGRp739reVAKwrIsc+jFI91/boz+bi5KmFheEDknu1eYyPooES/+fjTV8M1ElKzK4dP4IpiftJzN6TuonBDoP3B1S3kv/C6uaGXKzDM+g+Q==
  • Cc: <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Ayan Kumar Halder" <ayankuma@xxxxxxx>
  • Delivery-date: Tue, 13 Sep 2022 12:09:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Currently function sanity_check_partial_dts from scripts/common takes
three arguments where the last two (repo, dir) are used always in
conjuction to form a path to a directory storing partial dts. Modify the
function to take only two arguments where the second one is to be a path
to a directory storing partial dts. This will help reusing this function
in the future to perform sanity checks on partial dts that do not
originate from a repository.

Modify compile_merge_partial_dts to take this change into account.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Reviewed-by: Ayan Kumar Halder <ayankuma@xxxxxxx>
Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
Changes in v2:
- none
---
 scripts/common | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/common b/scripts/common
index 25c041270c29..ccad03d82b30 100644
--- a/scripts/common
+++ b/scripts/common
@@ -40,8 +40,7 @@ function get_next_phandle()
 function sanity_check_partial_dts()
 {
     local domU_passthrough_path="$1"
-    local repo="$2"
-    local dir="$3"
+    local partial_dts_dir="$2"
     local address_cells_val
     local size_cells_val
     local tmpdtb
@@ -51,7 +50,7 @@ function sanity_check_partial_dts()
     for devpath in $domU_passthrough_path
     do
         file=${devpath##*/}
-        file="$repo"/"$dir"/"$file".dts
+        file="$partial_dts_dir"/"$file".dts
 
         if ! test -f "$file"
         then
@@ -96,6 +95,7 @@ function compile_merge_partial_dts()
     local dtb_dir=$1
     local repo=$(echo "$2" | awk '{print $1}')
     local dir=$(echo "$2" | awk '{print $2}')
+    local partial_dts_dir
     local tmp
     local tmpdts
     local file
@@ -123,6 +123,7 @@ function compile_merge_partial_dts()
         dir="."
     fi
 
+    partial_dts_dir="$repo"/"$dir"
     i=0
     while test $i -lt $NUM_DOMUS
     do
@@ -132,7 +133,7 @@ function compile_merge_partial_dts()
             return 1
         fi
 
-        sanity_check_partial_dts "${DOMU_PASSTHROUGH_PATHS[$i]}" "$repo" "$dir"
+        sanity_check_partial_dts "${DOMU_PASSTHROUGH_PATHS[$i]}" 
"$partial_dts_dir"
         if test $? -ne 0
         then
             return 1
@@ -146,7 +147,7 @@ function compile_merge_partial_dts()
         for devpath in ${DOMU_PASSTHROUGH_PATHS[$i]}
         do
             file=${devpath##*/}
-            file="$repo"/"$dir"/"$file".dts
+            file="$partial_dts_dir"/"$file".dts
 
             # All the subsequent dts files should not have dts version 
mentioned
             if test $j -gt 1
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.