Skip to content

Commit 09edc14

Browse files
authored
iso: fix media ejection in text-based finishview (#72)
In text-based installation mode, removing the installation media in the finishview causes boot-up errors due to incomplete processes. This commit adds an eject operation in the finishview to complete pending write operations and properly close the file system, allowing the user to remove the installation media in finishview. Signed-off-by: Mun Chun Yep <mun.chun.yep@intel.com>
1 parent a2fe2b0 commit 09edc14

File tree

1 file changed

+9
-0
lines changed
  • toolkit/tools/imagegen/attendedinstaller/views/finishview

1 file changed

+9
-0
lines changed

toolkit/tools/imagegen/attendedinstaller/views/finishview/finishview.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/microsoft/azurelinux/toolkit/tools/imagegen/attendedinstaller/uiutils"
1616
"github.com/microsoft/azurelinux/toolkit/tools/imagegen/configuration"
1717
"github.com/microsoft/azurelinux/toolkit/tools/internal/logger"
18+
"github.com/microsoft/azurelinux/toolkit/tools/internal/shell"
1819
)
1920

2021
// UI constants.
@@ -136,6 +137,14 @@ func (fv *FinishView) OnShow() {
136137
// since the installation time is not known during Initialize().
137138
// Force a focus change as the flex box has just been initialized in updateTextSize().
138139
fv.app.SetFocus(fv.centeredFlex)
140+
141+
const squashErrors = false
142+
program := "eject"
143+
commandArgs := []string{
144+
"--cdrom",
145+
"--force",
146+
}
147+
shell.ExecuteLive(squashErrors, program, commandArgs...)
139148
}
140149

141150
func (fv *FinishView) updateTextSize() {

0 commit comments

Comments
 (0)