debian: Improve disk cleanup from previous installs
In cases when a previous installation has a different partition layout and the persistent backup partition does not align, make sure we recreate the persistent backup partition. This now covers scenarios when: - The persistent backup partition is discovered but on a different partition than expected - The filesystem on the aligned and expected persistent backup partition is missing or not compliant with ext4 Test Plan: PASS - Successful install with misaligned partition schemes: 22.06 CentOS -> 22.12 Debian PASS - Successful install with an aligned partition scheme but missing filesystem Change-Id: I44b9c24ae6d220eefa617304b49d7f984b73cf22 Story: 2009303 Task: 46190 Signed-off-by: Robert Church <robert.church@windriver.com>
This commit is contained in:
parent
c26aacc831
commit
777d13e985
@ -1176,13 +1176,21 @@ do
|
||||
part_type_flags=$(echo "$sgdisk_part_info" | grep "$part_type_flags_str" | awk '{print $3;}')
|
||||
BACKUP_PART_FLAGS=${part_type_flags}
|
||||
|
||||
ilog "Platform Backup: ${BACKUP_PART_NAME}:${BACKUP_PART_FIRST}:${BACKUP_PART_END}:${BACKUP_PART_SIZE}:${part_type_guid}"
|
||||
ilog "Discovered Platform Backup: ${BACKUP_PART_NAME}:${BACKUP_PART_FIRST}:${BACKUP_PART_END}:${BACKUP_PART_SIZE}:${part_type_guid}"
|
||||
|
||||
part_fstype=$(exec_retry 5 0.5 "blkid -s TYPE -o value $part")
|
||||
if [ "${part_fstype}" == "ext4" ]; then
|
||||
ilog "Skipping wipe of persistent partition $part"
|
||||
BACKUP_CREATED=1
|
||||
continue
|
||||
# Only keep a backup partition that is in the expected location
|
||||
# and contains a proper filesystem
|
||||
if [ "${part_number}" == "${BACKUP_PART_NO}" ] ; then
|
||||
part_fstype=$(exec_retry 5 0.5 "blkid -s TYPE -o value $part")
|
||||
if [ "${part_fstype}" == "ext4" ]; then
|
||||
ilog "Skipping wipe of discovered persistent backup partition ${part}"
|
||||
BACKUP_CREATED=1
|
||||
continue
|
||||
else
|
||||
ilog "Discovered persistent backup partition at ${part}, filesystem is not ext4. Recreating."
|
||||
fi
|
||||
else
|
||||
ilog "Discovered persistent backup partition at ${part}, expected ${BACKUP_PART}. Recreating."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user