From 009d835bbab1ae51f5e783c0d0685b5e823d0679 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 24 Sep 2019 15:17:54 +0800 Subject: [PATCH] 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 Acked-by: Victor Sun --- misc/acrn-config/target/parser_lib.py | 18 +++++++++++++----- misc/acrn-config/xmls/board-xmls/apl-mrb.xml | 3 ++- .../xmls/board-xmls/apl-up2-n3350.xml | 5 +++-- misc/acrn-config/xmls/board-xmls/apl-up2.xml | 5 +++-- misc/acrn-config/xmls/board-xmls/nuc6cayh.xml | 2 +- misc/acrn-config/xmls/board-xmls/nuc7i7dnb.xml | 2 +- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/misc/acrn-config/target/parser_lib.py b/misc/acrn-config/target/parser_lib.py index 4bb9d7d9e..adc41f554 100644 --- a/misc/acrn-config/target/parser_lib.py +++ b/misc/acrn-config/target/parser_lib.py @@ -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) diff --git a/misc/acrn-config/xmls/board-xmls/apl-mrb.xml b/misc/acrn-config/xmls/board-xmls/apl-mrb.xml index 661d2bd9d..e9335596d 100644 --- a/misc/acrn-config/xmls/board-xmls/apl-mrb.xml +++ b/misc/acrn-config/xmls/board-xmls/apl-mrb.xml @@ -294,7 +294,8 @@ - /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" diff --git a/misc/acrn-config/xmls/board-xmls/apl-up2-n3350.xml b/misc/acrn-config/xmls/board-xmls/apl-up2-n3350.xml index 910584199..7ab028e90 100644 --- a/misc/acrn-config/xmls/board-xmls/apl-up2-n3350.xml +++ b/misc/acrn-config/xmls/board-xmls/apl-up2-n3350.xml @@ -274,8 +274,9 @@ - /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" diff --git a/misc/acrn-config/xmls/board-xmls/apl-up2.xml b/misc/acrn-config/xmls/board-xmls/apl-up2.xml index 69d78cfb9..388019fa2 100644 --- a/misc/acrn-config/xmls/board-xmls/apl-up2.xml +++ b/misc/acrn-config/xmls/board-xmls/apl-up2.xml @@ -274,8 +274,9 @@ - /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" diff --git a/misc/acrn-config/xmls/board-xmls/nuc6cayh.xml b/misc/acrn-config/xmls/board-xmls/nuc6cayh.xml index cc2c17bfa..6e7d56257 100644 --- a/misc/acrn-config/xmls/board-xmls/nuc6cayh.xml +++ b/misc/acrn-config/xmls/board-xmls/nuc6cayh.xml @@ -232,7 +232,7 @@ - /dev/sda3: LABEL="root" UUID="b8352fb7-25f5-481d-aa6f-015a7c76c5aa" TYPE="ext4" PARTLABEL="/" PARTUUID="9a305316-3c78-436c-9c21-3be1b324428d" + /dev/sda3: TYPE="ext4" diff --git a/misc/acrn-config/xmls/board-xmls/nuc7i7dnb.xml b/misc/acrn-config/xmls/board-xmls/nuc7i7dnb.xml index 93c9a025f..ecca206cd 100644 --- a/misc/acrn-config/xmls/board-xmls/nuc7i7dnb.xml +++ b/misc/acrn-config/xmls/board-xmls/nuc7i7dnb.xml @@ -226,7 +226,7 @@ - /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"