From fef5746ee329eb560d740132895ed29a44e44d10 Mon Sep 17 00:00:00 2001 From: Andrej Shadura Date: Thu, 16 Jan 2020 15:25:17 +0100 Subject: New upstream version 1.0.0+git20191223.292995b --- actions/image_partition_action.go | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'actions/image_partition_action.go') 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 { -- cgit v1.2.3