diff options
author | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2020-01-16 15:25:17 +0100 |
---|---|---|
committer | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2020-01-16 15:25:17 +0100 |
commit | abc4a2e11c94fd948c684d678701cc90bc7a7ab6 (patch) | |
tree | e36dcbc5e5cf210700d52cfc8bdabc9a094ee50e /actions/image_partition_action.go | |
parent | 84c12c16ed094874a058bac6aaf70dfa25ace1d6 (diff) | |
parent | fef5746ee329eb560d740132895ed29a44e44d10 (diff) |
Update upstream source from tag 'upstream/1.0.0+git20191223.292995b'
Update to upstream version '1.0.0+git20191223.292995b'
with Debian dir f7f3a5ade924e6cb45402aac0b363e5f82aa5ae4
Diffstat (limited to 'actions/image_partition_action.go')
-rw-r--r-- | actions/image_partition_action.go | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/actions/image_partition_action.go b/actions/image_partition_action.go index b4f0cd2..0850990 100644 --- a/actions/image_partition_action.go +++ b/actions/image_partition_action.go @@ -41,6 +41,7 @@ Yaml syntax for partitions: fs: filesystem start: offset end: offset + features: list of filesystem features flags: list of flags fsck: bool @@ -62,6 +63,9 @@ form -- '32MB', '1GB' or as disk percentage -- '100%'. Optional properties: +- features -- list of additional filesystem features which need to be enabled +for partition. + - flags -- list of additional flags for partition compatible with parted(8) 'set' command. @@ -138,14 +142,15 @@ import ( ) type Partition struct { - number int - Name string - Start string - End string - FS string - Flags []string - Fsck bool "fsck" - FSUUID string + number int + Name string + Start string + End string + FS string + Flags []string + Features []string + Fsck bool "fsck" + FSUUID string } type Mountpoint struct { @@ -268,6 +273,9 @@ func (i ImagePartitionAction) formatPartition(p *Partition, context debos.DebosC case "btrfs": // Force formatting to prevent failure in case if partition was formatted already cmdline = append(cmdline, "mkfs.btrfs", "-L", p.Name, "-f") + if len(p.Features) > 0 { + cmdline = append(cmdline, "-O", strings.Join(p.Features, ",")) + } case "hfs": cmdline = append(cmdline, "mkfs.hfs", "-h", "-v", p.Name) case "hfsplus": @@ -279,6 +287,9 @@ func (i ImagePartitionAction) formatPartition(p *Partition, context debos.DebosC case "none": default: cmdline = append(cmdline, fmt.Sprintf("mkfs.%s", p.FS), "-L", p.Name) + if len(p.Features) > 0 { + cmdline = append(cmdline, "-O", strings.Join(p.Features, ",")) + } } if len(cmdline) != 0 { |