Skip to content

Commit

Permalink
Working
Browse files Browse the repository at this point in the history
  • Loading branch information
gmileka committed Dec 20, 2024
1 parent c7159ae commit 417e632
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions toolkit/tools/pkg/imagecustomizerlib/grubcfgutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,16 +817,17 @@ func regenerateInitrd(imageChroot *safechroot.Chroot) error {

err := imageChroot.UnsafeRun(func() error {
// The 'mkinitrd' command was removed in Azure Linux 3.0 in favor of using 'dracut' directly.
mkinitrdExists, err := file.CommandExists("mkinitrd")
if err != nil {
return fmt.Errorf("failed to search for mkinitrd command:\n%w", err)
}

if mkinitrdExists {
return shell.ExecuteLiveWithErr(1, "mkinitrd")
} else {
return shell.ExecuteLiveWithErr(1, "dracut", "--force", "--regenerate-all")
}
// mkinitrdExists, err := file.CommandExists("mkinitrd")
// if err != nil {
// return fmt.Errorf("failed to search for mkinitrd command:\n%w", err)
// }

// if mkinitrdExists {
// return shell.ExecuteLiveWithErr(1, "mkinitrd")
// } else {
return shell.ExecuteLiveWithErr(1, "dracut", "--force", "--regenerate-all",
"--include", "/usr/lib/locale", "/usr/lib/locale")
// }
})
if err != nil {
return fmt.Errorf("failed to rebuild initramfs file:\n%w", err)
Expand Down

0 comments on commit 417e632

Please sign in to comment.