From b2ced7173fe3c41817a9eb17a8110bd3b5859ea0 Mon Sep 17 00:00:00 2001
From: Itxaka <itxaka@kairos.io>
Date: Fri, 4 Apr 2025 11:27:49 +0200
Subject: [PATCH] Allow skipping the users check via sentinel

Signed-off-by: Itxaka <itxaka@kairos.io>
(cherry picked from commit b45d95c25674f6e3ea7c7cd7cb3db3c7b1f04c50)
---
 pkg/config/config.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 11c96d8..7a2ac99 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -213,6 +213,13 @@ func contains(s []string, str string) bool {
 func (c Config) CheckForUsers() (err error) {
 	// If nousers is enabled we do not check for the validity of the users and such
 	// At this point, the config should be fully parsed and the yip stages ready
+
+	// Check if the sentinel is present
+	_, sentinel := c.Fs.Stat("/etc/kairos/.nousers")
+	if sentinel == nil {
+		c.Logger.Logger.Debug().Msg("Sentinel file found, skipping user check")
+		return nil
+	}
 	if !c.Install.NoUsers {
 		anyAdmin := false
 		cc, _ := c.Config.String()