Ensure magic strings that are visible for libblkid are erased

In the case when the root disk partition table is wiped but individual
partitions are not wiped correctly, this will leave previous physical
volume metadata intact on the disk.

When a new LVM partition is created and assigned as a newly created
physical volume the old LVM metadata on the disk partition will prevent
the cgts-vg volume group from being created.

This update will wipe all the magic strings present in the new physical
volume partition established by the kickstart by executing 'wipefs -a'
prior to creating the cgts-vg.

Test Plan:
PASS - Successfully install an ISO with this change on a system that did
       not cleanup the LVM metatadata from a previous install. Log in to
       the installed system and confirm that the cgts-vg is properly
       configured.

Change-Id: I63f4235a27cb40a4283f0f4c34f63564a4f18cdd
Partial-Bug: #1998204
Signed-off-by: Robert Church <robert.church@windriver.com>
This commit is contained in:
Robert Church 2022-11-28 19:55:12 -06:00
parent d4aaeb5836
commit 651bd76566
2 changed files with 8 additions and 0 deletions

View File

@ -1810,6 +1810,10 @@ ilog "LV_SZ_ROOT (cgts--vg-root--lv) : ${LV_SZ_ROOT} MB"
ilog "LV_SZ_SCRATCH (cgts--vg-scratch--lv) : ${LV_SZ_SCRATCH} MB"
ilog "LV_SZ_VAR (cgts--vg-var--lv) : ${LV_SZ_VAR} MB"
ilog "Wipe any previous signatures from the platform physical volume ${pv_part}"
wipefs -a ${pv_part}
[ ${?} -ne 0 ] && report_failure_with_msg "Failed to wipe signatures from ${pv_part}, rc=${?}"
ilog "Create ${vg} 'cgts-vg' ${pv_part} ; $STOR_DEV_FDS"
exec_no_fds "$STOR_DEV_FDS" "vgcreate -y --force cgts-vg ${pv_part} 2>/dev/null" 5 0.5
[ ${?} -ne 0 ] && report_failure_with_msg "Failed to create ${vg} 'cgts-vg' ${pv_part}"

View File

@ -1900,6 +1900,10 @@ ilog "LV_SZ_ROOT (cgts--vg-root--lv) : ${LV_SZ_ROOT} MB"
ilog "LV_SZ_SCRATCH (cgts--vg-scratch--lv) : ${LV_SZ_SCRATCH} MB"
ilog "LV_SZ_VAR (cgts--vg-var--lv) : ${LV_SZ_VAR} MB"
ilog "Wipe any previous signatures from the platform physical volume ${pv_part}"
wipefs -a ${pv_part}
[ ${?} -ne 0 ] && report_failure_with_msg "Failed to wipe signatures from ${pv_part}, rc=${?}"
ilog "Create ${vg} 'cgts-vg' ${pv_part} ; $STOR_DEV_FDS"
exec_no_fds "$STOR_DEV_FDS" "vgcreate -y --force cgts-vg ${pv_part} 2>/dev/null" 5 0.5
[ ${?} -ne 0 ] && report_failure_with_msg "Failed to create ${vg} 'cgts-vg' ${pv_part}"