diff --git a/cmd/install.go b/cmd/install.go index 06b707a7298..acdf140bde0 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -24,8 +24,10 @@ import ( "github.com/rancher/elemental-toolkit/cmd/config" "github.com/rancher/elemental-toolkit/pkg/action" + "github.com/rancher/elemental-toolkit/pkg/constants" elementalError "github.com/rancher/elemental-toolkit/pkg/error" v1 "github.com/rancher/elemental-toolkit/pkg/types/v1" + "github.com/rancher/elemental-toolkit/pkg/utils" ) // NewInstallCmd returns a new instance of the install subcommand and appends it to @@ -79,6 +81,9 @@ func NewInstallCmd(root *cobra.Command, addCheckRoot bool) *cobra.Command { return elementalError.New("at least a target device must be supplied", elementalError.InvalidTarget) } + // If the device path is a symlink, resolve it (e.g., /dev/disk/by-path/platform-fe340000.mmc-part1) + spec.Target, _ = utils.ResolveLink(cfg.Fs, spec.Target, "/", constants.MaxLinkDepth) + cfg.Logger.Infof("Install called") install, err := action.NewInstallAction(cfg, spec) if err != nil {