Skip to content

Commit

Permalink
Add handling of ESD files
Browse files Browse the repository at this point in the history
Signed-off-by: foxtrotcz <[email protected]>
  • Loading branch information
foxtrotcz authored and stgraber committed Sep 4, 2024
1 parent cd17c8c commit bd27600
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions distrobuilder/main_repack-windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,18 @@ func (c *cmdRepackWindows) run(cmd *cobra.Command, args []string, overlayDir str
logger := c.global.logger
bootWim, err := shared.FindFirstMatch(overlayDir, "sources", "boot.wim")
if err != nil {
return fmt.Errorf("Unable to find boot.wim: %w", err)
bootWim, err = shared.FindFirstMatch(overlayDir, "sources", "boot.esd")
if err != nil {
return fmt.Errorf("Unable to find boot.wim or boot.esd: %w", err)
}
}

installWim, err := shared.FindFirstMatch(overlayDir, "sources", "install.wim")
if err != nil {
return fmt.Errorf("Unable to find install.wim: %w", err)
installWim, err = shared.FindFirstMatch(overlayDir, "sources", "install.esd")
if err != nil {
return fmt.Errorf("Unable to find install.wim or install.esd: %w", err)
}
}

bootWimInfo, err := c.getWimInfo(bootWim)
Expand Down Expand Up @@ -375,8 +381,7 @@ func (c *cmdRepackWindows) modifyWimIndex(wimFile string, index int, name string
wimIndex := strconv.Itoa(index)
wimPath := filepath.Join(c.global.flagCacheDir, "wim", wimIndex)
wimName := filepath.Base(wimFile)
logger := c.global.logger.WithFields(logrus.Fields{"wim": strings.TrimSuffix(wimName, ".wim"),
"idx": wimIndex + ":" + name})
logger := c.global.logger.WithFields(logrus.Fields{"wim": wimName, "idx": wimIndex + ":" + name})
if !incus.PathExists(wimPath) {
err := os.MkdirAll(wimPath, 0755)
if err != nil {
Expand Down

0 comments on commit bd27600

Please sign in to comment.