From 9c5815f00ebd5c64f97808a48b849e0c766b6ae8 Mon Sep 17 00:00:00 2001 From: Cabbie Team Date: Mon, 13 Jul 2026 14:55:26 -0700 Subject: [PATCH] Update cabbie's reboot logic so that if it detects a driver/firmware update requires a reboot (that may not have a KB number), it properly sets a reboot time based on active hours or configured delays. PiperOrigin-RevId: 947259206 --- install.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.go b/install.go index 1aabda8..bc45025 100644 --- a/install.go +++ b/install.go @@ -302,6 +302,7 @@ func (i *installCmd) installUpdates(ctx context.Context) error { installMsgPopped := i.virusDef installingMinOneUpdate := false + anyRebootRequired := false kbs := NewKBSet(i.kbs) if err := initDriverExclusion(); err != nil { @@ -450,6 +451,7 @@ outerLoop: deck.InfofA("Install of KB %s; Reboot Required: %t", u.KBArticleIDs, rsp.rebootRequired).With(eventID(cablib.EvtRebootRequired)).Go() if rsp.rebootRequired && !u.InCategories([]string{"Definition Updates"}) { + anyRebootRequired = true deck.InfofA("Adding KB %s to reboot list.", u.KBArticleIDs).With(eventID(cablib.EvtRebootRequired)).Go() rebootList = append(rebootList, u.KBArticleIDs...) } @@ -475,9 +477,11 @@ outerLoop: } } - if len(rebootList) > 0 { - if err := cablib.AddRebootUpdates(rebootList); err != nil { - deck.ErrorfA("Failed to write updates requiring reboot to registry: %v", err).With(eventID(cablib.EvtRebootRequired)).Go() + if anyRebootRequired || len(rebootList) > 0 { + if len(rebootList) > 0 { + if err := cablib.AddRebootUpdates(rebootList); err != nil { + deck.ErrorfA("Failed to write updates requiring reboot to registry: %v", err).With(eventID(cablib.EvtRebootRequired)).Go() + } } // Use active hours if enabled and available, otherwise use the standard reboot delay.