Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include proper iso volume label when running docker run eve installer…
Browse files Browse the repository at this point in the history
…_iso

The mkimage-iso-efi can override the default iso volume label based on the env variable
VOLUME_LABEL. We use this when we call tools/makeiso.sh to set the label to EVEISO.
The installer in turn looks for this label to find its installer iso to use for installs.
This label-setting did not, however, get carried over to eve/runme.sh, which means that
`docker run lfedge/eve installer_iso` creates an iso with the wrong volume label,
and thus install fails.

This fixes it so that it sets the volume label correctly.

Signed-off-by: Avi Deitcher <avi@deitcher.net>

fix wrong comment

update PR, adding unknown state to the map
deitch authored and cperakis committed Jan 29, 2025
1 parent 9f08e27 commit dff6543
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/eve/runme.sh
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ do_installer_raw() {
create_installer_iso() {
mkdir -p /installer_root
unsquashfs -f -d /installer_root /bits/installer.img 1>&2
tar -C /installer_root -cf - . | /make-efi installer
tar -C /installer_root -cf - . | VOLUME_LABEL=EVEISO /make-efi installer
rm -rf /installer_root
}

2 changes: 0 additions & 2 deletions pkg/pillar/containerd/containerd.go
Original file line number Diff line number Diff line change
@@ -493,8 +493,6 @@ func (client *Client) CtrGetContainerMetrics(ctx context.Context, containerID st
// For tasks that are in the running, pausing or paused state the PID is also provided
// and the exit code is set to 0. For tasks in the stopped state, exit code is provided
// and the PID is set to 0.

// cperakis sos
func (client *Client) CtrContainerInfo(ctx context.Context, name string) (int, int, string, error) {
if err := client.verifyCtr(ctx, true); err != nil {
return 0, 0, "", fmt.Errorf("CtrContainerInfo: exception while verifying ctrd client: %s", err.Error())
20 changes: 10 additions & 10 deletions pkg/pillar/hypervisor/containerd.go
Original file line number Diff line number Diff line change
@@ -237,14 +237,6 @@ func (ctx ctrdContext) Info(domainName string) (int, types.SwState, error) {
return 0, types.UNKNOWN, logError("containerd looking up domain %s resulted in %v", domainName, err)
}

stateMap := map[string]types.SwState{
"created": types.INSTALLED,
"running": types.RUNNING,
"pausing": types.PAUSING,
"paused": types.PAUSED,
"stopped": types.HALTED,
}

// if the VM state is unknown, we will retry 10 times to get the state. This is to handle the case
// where the VM is in a transient state.
if status == "unknown" {
@@ -256,7 +248,7 @@ func (ctx ctrdContext) Info(domainName string) (int, types.SwState, error) {
return 0, types.UNKNOWN, logError("containerd looking up domain %s resulted in %v", domainName, err)
}
// if the VM state will change, we exit the loop.
if _, matched := stateMap[status]; matched {
if status != "unknown" {
break
}
}
@@ -272,7 +264,15 @@ func (ctx ctrdContext) Info(domainName string) (int, types.SwState, error) {
if status == "unknown" {
logrus.Errorf("task %s is in %s state, after %d retries", domainName, status, retryCount)
}
stateMap["unknown"] = types.UNKNOWN

stateMap := map[string]types.SwState{
"created": types.INSTALLED,
"running": types.RUNNING,
"pausing": types.PAUSING,
"paused": types.PAUSED,
"stopped": types.HALTED,
"unknown": types.UNKNOWN,
}

if effectiveDomainState, matched := stateMap[status]; !matched {
err := fmt.Errorf("task %s happens to be in an unexpected state %s",

0 comments on commit dff6543

Please sign in to comment.