Handle virtual a/b sandbox/jkryszyn/virtual-ab
authorJacek Kryszyn <j.kryszyn@samsung.com>
Wed, 24 Jul 2024 05:19:11 +0000 (07:19 +0200)
committerJacek Kryszyn <j.kryszyn@samsung.com>
Thu, 29 Aug 2024 13:12:26 +0000 (15:12 +0200)
This commit changes the way that super is prepared
in order to handle virtual a/b partition schema.

Instead of two slots there is only one and instead
of rootfs_b and hal_b there are rootfs_a_cow and
hal_a_cow.

Change-Id: I9ed2e15df9a20a0e6b59e6f03376ad32b55120bc

scripts/tizen/sd_fusing.py

index e894e01af7faceb018cabf3bd97bf9647aea0270..04e659f412fb48d137eab413dd02ce652f96fd39 100755 (executable)
@@ -1180,7 +1180,7 @@ def do_fuse_file(f, name, target):
 #      be part of some class
 
 def do_fuse_image_super(tmpd, target):
-    metadata_slots = 2
+    metadata_slots = 1
     metadata_size = 65536
     header_size = 1024 * 1024 # default alignment used in lpmake
     super_size = 0
@@ -1194,7 +1194,7 @@ def do_fuse_image_super(tmpd, target):
         logging.error(f"No information found about super partition, cannot create image")
         sys.exit(1)
 
-    group_size = int((super_size - header_size) / 2);
+    group_size = int((super_size - header_size));
     hal_path = os.path.join(tmpd, 'hal.img')
     rootfs_path = os.path.join(tmpd, 'rootfs.img')
     super_path = os.path.join(tmpd, 'super.img')
@@ -1216,16 +1216,13 @@ def do_fuse_image_super(tmpd, target):
             f"--device-size={super_size}",
             f"--metadata-size={metadata_size}",
             f"--metadata-slots={metadata_slots}",
-            "-g", f"tizen_a:{group_size}",
-            "-p", f"rootfs_a:none:{rootfs_size}:tizen_a",
-            "-p", f"hal_a:none:{hal_size}:tizen_a",
-            "-g", f"tizen_b:{group_size}",
-            "-p", f"rootfs_b:none:{rootfs_size}:tizen_b",
-            "-p", f"hal_b:none:{hal_size}:tizen_b",
+            "-g", f"tizen:{group_size}",
+            "-p", f"rootfs_a:none:{rootfs_size}:tizen",
+            "-p", f"rootfs_a_cow:none:{rootfs_size}:tizen",
+            "-p", f"hal_a:none:{hal_size}:tizen",
+            "-p", f"hal_a_cow:none:{hal_size}:tizen",
             "-i", f"rootfs_a={rootfs_path}",
-            "-i", f"rootfs_b={rootfs_path}",
-            "-i", f"hal_a={hal_path}",
-            "-i", f"hal_b={hal_path}"]
+            "-i", f"hal_a={hal_path}"]
     logging.debug(" ".join(argv))
     proc = subprocess.run(argv,
                           stdin=subprocess.DEVNULL,