Skip to content

Commit 603c432

Browse files
authored
Warn when a desktop profile's greeter can't log in without a regular user (#4331)
1 parent e3e9563 commit 603c432

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

archinstall/lib/global_menu.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import override
22

3+
from archinstall.default_profiles.profile import GreeterType
34
from archinstall.lib.applications.application_menu import ApplicationMenu
45
from archinstall.lib.args import ArchConfig
56
from archinstall.lib.authentication.authentication_menu import AuthenticationMenu
@@ -207,13 +208,30 @@ def has_superuser() -> bool:
207208
return any([u.sudo for u in auth_config.users])
208209
return False
209210

211+
def has_regular_user() -> bool:
212+
if auth_config and auth_config.users:
213+
return len(auth_config.users) > 0
214+
return False
215+
210216
missing = set()
211217

212218
if (auth_config is None or auth_config.root_enc_password is None) and not has_superuser():
213219
missing.add(
214220
tr('Either root-password or at least 1 user with sudo privileges must be specified'),
215221
)
216222

223+
# These greeters only show users with UID >= 1000 and have no manual login by default
224+
if not has_regular_user():
225+
profile_item: MenuItem = self._item_group.find_by_key('profile_config')
226+
profile_config: ProfileConfiguration | None = profile_item.value
227+
228+
if profile_config and profile_config.profile and profile_config.profile.is_desktop_profile():
229+
problematic_greeters = {GreeterType.Sddm}
230+
if any(p.default_greeter_type in problematic_greeters for p in profile_config.profile.current_selection):
231+
missing.add(
232+
tr('The selected desktop profile requires a regular user to log in via the greeter'),
233+
)
234+
217235
for item in self._item_group.items:
218236
if item.mandatory:
219237
assert item.key is not None

0 commit comments

Comments
 (0)