Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling of ESD files for Windows repacking #879

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading