mbox series

[v2,0/2] handlers: diskpart: Add check for existing filesystem

Message ID 20210728142146.8970-1-roland.gaudig-oss@weidmueller.com
Headers show
Series handlers: diskpart: Add check for existing filesystem | expand

Message

Roland Gaudig July 28, 2021, 2:21 p.m. UTC
From: Roland Gaudig <roland.gaudig@weidmueller.com>


In contrast to the previous version I corrected the identities of the
Author and Signed-off-by field. I accidentally configured the wrong
e-mail address. Sorry for the inconvenience.

This patch series adds two changes.

The first changes allows switching off the check if partition table has
been altered and not creating a file system if not,
wich was introduces with commit 3c70984c6880
"diskpart: format filesystem only if partition table is changed".

The reason for this change is, there are situations when there is an
unused and unformatted partition, which shall be made usable by a later
update. In this situation it is necessary to have the possebility to
format that partition even though the partition table remains unchanged.

It is controlled with the config DISKFORMAT_IGNORE_PT_CHANGE option.

The second patch introduces a check whether already a file system
exists on a partition before creating a new file system.

Before creating a file system it is checked if the requested file system
already exists on that partition.

In case the requested file system is of different type than the existing
file system, the existing file system will be overwritten.

The reason for this change is, there are situations when there was
an unformated partition in the past which shall be used after an update.
Therefore the sw-description contains a fstype option. Now it can happen
such an update is run more than once. In such case already existing data
on that partition would be erased.

This option is controlled with config DISKFORMAT_CHECK_OVERWRITE

Changes in v2:
 - corrected identity of Author and Signed-off-by


(no changes since v1)

Roland Gaudig (2):
  diskpart: format partition anyway
  diskpart: format only if filesystem not exists

 Makefile.flags              |  6 +++-
 handlers/Config.in          | 21 ++++++++++++++
 handlers/diskpart_handler.c | 58 ++++++++++++++++++++++++++++++++++++-
 3 files changed, 83 insertions(+), 2 deletions(-)