mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-06 17:21:22 +00:00
acrn-config: modify board info of block device info
As the blkid info contains 'UUID' information, which easy to lead to
confuse with the vm 'UUID'. So refine the format for block device.
v1-v2:
1). align the style in BLOCK_DEVICE_INFO tag
2). add 'mmcblk1p3' in BLOCK_DEVICE_INFO tag
v2-v3:
1). correct the commit message.
2). refine the api of handle_block_dev
Tracked-On: #3754
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
@@ -83,15 +83,23 @@ def cmd_execute(cmd):
|
||||
return res
|
||||
|
||||
|
||||
def handle_root_dev(line):
|
||||
def handle_block_dev(line):
|
||||
"""Handle if it match root device information pattern
|
||||
:param line: one line of information which had decoded to 'ASCII'
|
||||
"""
|
||||
block_format = ''
|
||||
for root_type in line.split():
|
||||
if "ext4" in root_type or "ext3" in root_type:
|
||||
return True
|
||||
block_type = ''
|
||||
block_dev = line.split()[0]
|
||||
for type_str in line.split():
|
||||
if "TYPE=" in type_str:
|
||||
block_type = type_str
|
||||
|
||||
return False
|
||||
block_format = block_dev + " " + block_type
|
||||
return block_format
|
||||
|
||||
return block_format
|
||||
|
||||
|
||||
def dump_execute(cmd, desc, config):
|
||||
@@ -132,8 +140,8 @@ def dump_execute(cmd, desc, config):
|
||||
continue
|
||||
|
||||
if desc == "BLOCK_DEVICE_INFO":
|
||||
ret = handle_root_dev(line)
|
||||
if not ret:
|
||||
line = handle_block_dev(line)
|
||||
if not line:
|
||||
continue
|
||||
|
||||
print("\t{}".format(line.strip()), file=config)
|
||||
|
||||
@@ -294,7 +294,8 @@
|
||||
</SYSTEM_RAM_INFO>
|
||||
|
||||
<BLOCK_DEVICE_INFO>
|
||||
/dev/mmcblk1p1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4" PARTLABEL="sos_rootfs" PARTUUID="5bd5afa7-ab7e-46f3-85ad-0cfd285d5d76"
|
||||
/dev/mmcblk1p1: TYPE="ext4"
|
||||
/dev/mmcblk1p3: TYPE="ext4"
|
||||
/dev/mmcblk0p1: TYPE="ext4"
|
||||
/dev/sda3: TYPE="ext4"
|
||||
</BLOCK_DEVICE_INFO>
|
||||
|
||||
@@ -274,8 +274,9 @@
|
||||
</SYSTEM_RAM_INFO>
|
||||
|
||||
<BLOCK_DEVICE_INFO>
|
||||
/dev/sda3: LABEL="root" UUID="7de2c654-069b-4a56-b93f-70b2f7662bd0" TYPE="ext4" PARTLABEL="/" PARTUUID="712932d4-3420-4cca-b361-3606a40f3b89"
|
||||
/dev/mmcblk0p3: LABEL="root" UUID="045f2013-b4c4-4817-a1aa-dc4416ca800f" TYPE="ext4" PARTLABEL="/" PARTUUID="517bf93d-1cb5-4d72-9550-a0144a2fcdbc"
|
||||
/dev/sda3: TYPE="ext4"
|
||||
/dev/mmcblk0p1: TYPE="ext4"
|
||||
/dev/mmcblk0p3: TYPE="ext4"
|
||||
</BLOCK_DEVICE_INFO>
|
||||
|
||||
<TTYS_INFO>
|
||||
|
||||
@@ -274,8 +274,9 @@
|
||||
</SYSTEM_RAM_INFO>
|
||||
|
||||
<BLOCK_DEVICE_INFO>
|
||||
/dev/sda3: LABEL="root" UUID="7de2c654-069b-4a56-b93f-70b2f7662bd0" TYPE="ext4" PARTLABEL="/" PARTUUID="712932d4-3420-4cca-b361-3606a40f3b89"
|
||||
/dev/mmcblk0p3: LABEL="root" UUID="07c59c89-7796-429c-aad5-75f16193747c" TYPE="ext4" PARTLABEL="/" PARTUUID="f768183d-c825-4b18-be2d-45e67d27e71d"
|
||||
/dev/sda3: TYPE="ext4"
|
||||
/dev/mmcblk0p1: TYPE="ext4"
|
||||
/dev/mmcblk0p3: TYPE="ext4"
|
||||
</BLOCK_DEVICE_INFO>
|
||||
|
||||
<TTYS_INFO>
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
</SYSTEM_RAM_INFO>
|
||||
|
||||
<BLOCK_DEVICE_INFO>
|
||||
/dev/sda3: LABEL="root" UUID="b8352fb7-25f5-481d-aa6f-015a7c76c5aa" TYPE="ext4" PARTLABEL="/" PARTUUID="9a305316-3c78-436c-9c21-3be1b324428d"
|
||||
/dev/sda3: TYPE="ext4"
|
||||
</BLOCK_DEVICE_INFO>
|
||||
|
||||
<TTYS_INFO>
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
</SYSTEM_RAM_INFO>
|
||||
|
||||
<BLOCK_DEVICE_INFO>
|
||||
/dev/nvme0n1p3: LABEL="root" UUID="deb9eba1-9ab6-4d1e-95b9-aa1d2f7b660e" TYPE="ext4" PARTLABEL="/" PARTUUID="80521cfb-cce4-4ccc-8cf8-46a045196c73"
|
||||
/dev/nvme0n1p3: TYPE="ext4"
|
||||
/dev/sda3: TYPE="ext4"
|
||||
</BLOCK_DEVICE_INFO>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user