Skip to content

Consume Disks section from attendedconfig.json in ISO attendedinstaller#17897

Open
chriso-ms wants to merge 1 commit into
microsoft:3.0-devfrom
chriso-ms:ongchris/attendedinstaller-preserve-partition
Open

Consume Disks section from attendedconfig.json in ISO attendedinstaller#17897
chriso-ms wants to merge 1 commit into
microsoft:3.0-devfrom
chriso-ms:ongchris/attendedinstaller-preserve-partition

Conversation

@chriso-ms

Copy link
Copy Markdown

The autopartitionwidget in the ISO attended installer uses its hardcoded size of 8MB for the esp partition and does not consume the configs in the Disks section. As a result, the size of the esp partition of the installed ISO cannot be changed.

Update attendedinstaller to include the Disks section and adjust partitions in the autopartitionwidget according to the config.

@chriso-ms chriso-ms requested a review from a team as a code owner July 2, 2026 19:44
bootPartitionFsType = "fat32"
bootPartitionStartMiB = 1
bootPartitionEndMiB = 9
defaultBootStartMiB = 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatter isn't happy here, run make go-tidy-all and should update, or apply:

diff --git a/toolkit/tools/imagegen/attendedinstaller/views/diskview/autopartitionwidget/autopartitionwidget.go b/toolkit/tools/imagegen/attendedinstaller/views/diskview/autopartitionwidget/autopartitionwidget.go
index 34d8507325..a6a62e78ce 100644
--- a/toolkit/tools/imagegen/attendedinstaller/views/diskview/autopartitionwidget/autopartitionwidget.go
+++ b/toolkit/tools/imagegen/attendedinstaller/views/diskview/autopartitionwidget/autopartitionwidget.go
@@ -132,10 +132,10 @@ func (ap *AutoPartitionWidget) mustUpdateConfiguration(sysConfig *configuration.
 		targetDiskType     = "path"
 		partitionTableType = "gpt"
 
-		bootPartitionName     = "esp"
-		bootPartitionFsType   = "fat32"
-		defaultBootStartMiB   = 1
-		defaultBootEndMiB     = 9
+		bootPartitionName   = "esp"
+		bootPartitionFsType = "fat32"
+		defaultBootStartMiB = 1
+		defaultBootEndMiB   = 9
 
 		rootPartitionName = "rootfs"
 		rootFsType        = "ext4"

Comment on lines +152 to +164
switch partition.ID {
case bootPartitionName:
if partition.Start > 0 {
bootPartitionStartMiB = partition.Start
}
if partition.End > partition.Start {
bootPartitionEndMiB = partition.End
}
case rootPartitionName:
if partition.Start > 0 {
rootPartitionStartMiB = partition.Start
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunch of our configs use a different name, this is probably more stable long-term.

Suggested change
switch partition.ID {
case bootPartitionName:
if partition.Start > 0 {
bootPartitionStartMiB = partition.Start
}
if partition.End > partition.Start {
bootPartitionEndMiB = partition.End
}
case rootPartitionName:
if partition.Start > 0 {
rootPartitionStartMiB = partition.Start
}
}
switch {
case partition.HasFlag(configuration.PartitionFlagESP):
if partition.Start > 0 {
bootPartitionStartMiB = partition.Start
}
if partition.End > partition.Start {
bootPartitionEndMiB = partition.End
}
case partition.ID == rootPartitionName:
if partition.Start > 0 {
rootPartitionStartMiB = partition.Start
}
}

// New creates and returns a new AttendedInstaller.
func New(cfg configuration.Config, installationFunc func(configuration.Config, chan int, chan string) error, calamaresInstallFunc func() error) (attendedInstaller *AttendedInstaller, err error) {
finalConfig := configuration.Config{
Disks: append([]configuration.Disk{}, cfg.Disks...),

@dmcilvaney dmcilvaney Jul 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably out of scope for this fix, but the partition customization tool ignores these (manualpartitionwidget.go). @chriso-ms do you care about that use case at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants