Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ run-live-gui: $(SWTPM) GETTY $(DEVICETREE_DTB)
run-target: $(SWTPM) GETTY
$(QEMU_SYSTEM) $(QEMU_OPTS) -drive file=$(TARGET_IMG),format=$(IMG_FORMAT)

run-target-live-gui: $(SWTPM) GETTY $(DEVICETREE_DTB)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsfakian , please, put Makefile changes into a dedicated commit.....

$(QEMU_SYSTEM) $(QEMU_OPTS_GUI) -drive file=$(TARGET_IMG),format=$(IMG_FORMAT)

run-rootfs%: $(SWTPM) GETTY
(echo 'set devicetree="(hd0,msdos1)/eve.dtb"' ; echo 'set rootfs_root=/dev/vdb' ; echo 'set root=hd1' ; echo 'export rootfs_root' ; echo 'export devicetree' ; echo 'configfile /EFI/BOOT/grub.cfg' ) > $(EFI_PART)/BOOT/grub.cfg
$(QEMU_SYSTEM) $(QEMU_OPTS) -drive file=$(ROOTFS_IMG_BASE)$*.img,format=raw -drive file=fat:rw:$(EFI_PART)/..,label=CONFIG,id=uefi-disk,format=vvfat
Expand Down Expand Up @@ -1353,6 +1356,7 @@ help:
@echo " run-installer-raw runs installer.raw (via qemu) and 'installs' EVE into (initially blank) target.img"
@echo " run-installer-net runs installer.net (via qemu/iPXE) and 'installs' EVE into (initially blank) target.img"
@echo " run-target runs a full fledged virtual device on qemu from target.img (similar to run-live)"
@echo " run-target-live-gui same as run-target but with an emulated graphics card"
@echo
@echo "make run is currently an alias for make run-live"
@echo
14 changes: 12 additions & 2 deletions pkg/pillar/cmd/monitor/ipc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,25 @@ func (s *monitorIPCServer) sendIpcMessage(t string, msg any) error {

ipcMessage := ipcMessage{Type: t, Message: json.RawMessage(data)}

// re-marshal with the ipcMessage wrapper
if data, err = json.Marshal(ipcMessage); err != nil {
log.Errorf("Failed to Marshal IPC message: %v", err)
return err
}

// Log only metadata for large messages to avoid logging system issues
if t == "TpmLogs" {
log.Noticef("Sending IPC message: %s", t)
log.Noticef("Sending IPC message: type=%s (TpmLogs - large binary data)", t)
} else if t == "EvalStatus" {
log.Noticef("Sending IPC message: type=%s (EvalStatus - evaluation status update)", t)
} else {
log.Noticef("Sending IPC message: %s", string(data))
// For smaller messages, truncate if needed
msgStr := string(data)
if len(msgStr) > 500 {
log.Noticef("Sending IPC message: type=%s, size=%d bytes (message truncated)", t, len(msgStr))
} else {
log.Noticef("Sending IPC message: %s", msgStr)
}
}

_, err = s.codec.Write(data)
Expand Down
47 changes: 47 additions & 0 deletions pkg/pillar/cmd/monitor/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,32 @@ func handleGlobalConfigImpl(ctxArg interface{}, key string,
log.Functionf("handleGlobalConfigImpl done for %s", key)
}

func handleEvalStatusCreate(ctxArg interface{}, key string, statusArg interface{}) {
log.Functionf("handleEvalStatusCreate called: key=%s, type=%T", key, statusArg)
handleEvalStatusUpdate(ctxArg, key, statusArg)
}

func handleEvalStatusModify(ctxArg interface{}, key string, statusArg interface{}, oldStatusArg interface{}) {
log.Functionf("handleEvalStatusModify called: key=%s, type=%T", key, statusArg)
oldStatus := oldStatusArg.(types.EvalStatus)
newStatus := statusArg.(types.EvalStatus)
log.Functionf("handleEvalStatusModify: old phase=%s -> new phase=%s, allowOnboard %t -> %t",
oldStatus.Phase, newStatus.Phase, oldStatus.AllowOnboard, newStatus.AllowOnboard)
handleEvalStatusUpdate(ctxArg, key, statusArg)
}

func handleEvalStatusDelete(ctxArg interface{}, key string, statusArg interface{}) {
log.Functionf("handleEvalStatusDelete called: key=%s", key)
}

func handleEvalStatusUpdate(ctxArg interface{}, key string, statusArg interface{}) {
ctx := ctxArg.(*monitor)
status := statusArg.(types.EvalStatus)
log.Functionf("handleEvalStatusUpdate: EvalStatus details - platform=%t, slot=%s, phase=%s, allowOnboard=%t, inventory=%t",
status.IsEvaluationPlatform, status.CurrentSlot, status.Phase, status.AllowOnboard, status.InventoryCollected)
ctx.IPCServer.sendIpcMessage("EvalStatus", status)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsfakian , quick question, I don't see any updates on eve-monitor... does the current version have support for these messages?

}

func (ctx *monitor) subscribe(ps *pubsub.PubSub) error {
var err error

Expand Down Expand Up @@ -441,6 +467,26 @@ func (ctx *monitor) subscribe(ps *pubsub.PubSub) error {
ErrorTime: errorTime,
})
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error handling for GlobalConfig subscription. The error returned from ps.NewSubscription should be checked before proceeding to create the EvalStatus subscription. This is inconsistent with all other subscriptions in this function which check errors immediately after creation.

Suggested change
})
})
if err != nil {
log.Error("Cannot create subscription for GlobalConfig")
return err
}

Copilot uses AI. Check for mistakes.

log.Noticef("Creating subscription for EvalStatus from evalmgr")
subEvalStatus, err := ps.NewSubscription(pubsub.SubscriptionOptions{
AgentName: "evalmgr",
MyAgentName: agentName,
TopicImpl: types.EvalStatus{},
Persistent: true,
Activate: false,
Ctx: ctx,
CreateHandler: handleEvalStatusCreate,
ModifyHandler: handleEvalStatusModify,
DeleteHandler: handleEvalStatusDelete,
WarningTime: warningTime,
ErrorTime: errorTime,
})
if err != nil {
log.Errorf("Cannot create subscription for EvalStatus: %v", err)
return err
}
log.Noticef("Successfully created subscription for EvalStatus")

ctx.subscriptions["IOAdapters"] = subPhysicalIOAdapter
ctx.subscriptions["VaultStatus"] = subVaultStatus
ctx.subscriptions["OnboardingStatus"] = subOnboardStatus
Expand All @@ -452,6 +498,7 @@ func (ctx *monitor) subscribe(ps *pubsub.PubSub) error {
ctx.subscriptions["LedBlinkCounter"] = subLedBlinkCounter
ctx.subscriptions["ZedAgentStatus"] = subZedAgentStatus
ctx.subscriptions["GlobalConfig"] = subGlobalConfig
ctx.subscriptions["EvalStatus"] = subEvalStatus
return nil
}

Expand Down
Loading