|
|
|
|
@ -80,8 +80,19 @@ func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multi
|
|
|
|
|
return multistep.ActionHalt
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO: Check the symlink created
|
|
|
|
|
deviceMount := device
|
|
|
|
|
//Check the symbolic link for the device to get the real device name
|
|
|
|
|
cmd := ShellCommand(fmt.Sprintf("lsblk -no pkname $(readlink -f %s)", device))
|
|
|
|
|
|
|
|
|
|
realDeviceName, err := cmd.Output()
|
|
|
|
|
if err != nil {
|
|
|
|
|
err := fmt.Errorf(
|
|
|
|
|
"Error retrieving the symlink of the device %s.\n", device)
|
|
|
|
|
state.Put("error", err)
|
|
|
|
|
ui.Error(err.Error())
|
|
|
|
|
return multistep.ActionHalt
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deviceMount := fmt.Sprintf("/dev/%s", strings.Replace(string(realDeviceName), "\n", "", -1))
|
|
|
|
|
|
|
|
|
|
log.Printf("[DEBUG] s.MountPartition = %s", s.MountPartition)
|
|
|
|
|
|
|
|
|
|
@ -108,7 +119,7 @@ func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multi
|
|
|
|
|
return multistep.ActionHalt
|
|
|
|
|
}
|
|
|
|
|
log.Printf("[DEBUG] (step mount) mount command is %s", mountCommand)
|
|
|
|
|
cmd := ShellCommand(mountCommand)
|
|
|
|
|
cmd = ShellCommand(mountCommand)
|
|
|
|
|
cmd.Stderr = stderr
|
|
|
|
|
if err := cmd.Run(); err != nil {
|
|
|
|
|
err := fmt.Errorf(
|
|
|
|
|
|