Skip to content
Merged
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
18 changes: 18 additions & 0 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import override

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

def has_regular_user() -> bool:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should be part of the AuthenticationConfiguration class rather than in here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are you sure? I put it directly after this block:


		def has_superuser() -> bool:
			if auth_config and auth_config.users:
				return any([u.sudo for u in auth_config.users])
			return False

I think logically these should go together. Should we move both?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hmm yeah that one should also be in the respective config class, those don't make sense in here, but lets leave that for a new refactor PR

if auth_config and auth_config.users:
return len(auth_config.users) > 0
return False

missing = set()

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

# These greeters only show users with UID >= 1000 and have no manual login by default
if not has_regular_user():
profile_item: MenuItem = self._item_group.find_by_key('profile_config')
profile_config: ProfileConfiguration | None = profile_item.value

if profile_config and profile_config.profile and profile_config.profile.is_desktop_profile():
problematic_greeters = {GreeterType.Sddm}
if any(p.default_greeter_type in problematic_greeters for p in profile_config.profile.current_selection):
missing.add(
tr('The selected desktop profile requires a regular user to log in via the greeter'),
)

for item in self._item_group.items:
if item.mandatory:
assert item.key is not None
Expand Down
Loading