calamares / calamares-extensions

Examples of Calamares branding
36 stars 19 forks source link

New username feature breaks Mobile install #25

Closed Undef-a closed 1 year ago

Undef-a commented 1 year ago

On testing the new release while packing for Debian I noticed that the Mobile module now cannot get past the User Password screen. No matter whether the default username is left unchanged or replaced with a custom one the user cannot continue the install.

The following log line is seen on pressing "continue":

qrc:/user_pass.qml:138: TypeError: Cannot assign to read-only property "username"

Looking at the code, this is exactly what I'd expect.

  1. https://github.com/calamares/calamares-extensions/blob/349acad491a083479d59d40c8364df3c1c4f2bae/modules/mobile/Config.h#L27 is marked CONSTANT FINAL, so attempting to write it from QML will always fail.
  2. There is no setUsername( QString username ) function defined in https://github.com/calamares/calamares-extensions/blob/calamares/modules/mobile/Config.cpp
  3. There is no code in https://github.com/calamares/calamares-extensions/blob/349acad491a083479d59d40c8364df3c1c4f2bae/modules/mobile/UsersJob.cpp#L52 to deal with the new username. Even if 1 and 2 were working correctly the UsersJob would fail because the custom user does not exist on the system.

@nmschulte: Sorry I couldn't review the PR at the time. Are you interested in taking on the last bit to get username changing working? Otherwise I'll probably propose a patch to disable the feature.

nmschulte commented 1 year ago

Thanks for the details; I'll look into this soon, yes.

nmschulte commented 1 year ago

3. Even if 1 and 2 were working correctly the UsersJob would fail because the custom user does not exist on the system.

How is the user setup presently? I guess m_username doesn't control the created user, but identifies it so the password can be managed?

Undef-a commented 1 year ago

That's it exactly. The username (the original config option) was only there to allow distributions to configure the user that would have their password set on install. The user itself is created when the image is created, not at install time.

To actually change the name of the user you'd need to do something like this:

https://wiki.mobian.org/doku.php?id=tweaks&s[]=username#changing-the-default-username-from-mobian (note this is an example and really isn't ready for use as-is)

nmschulte commented 1 year ago

I haven't tested #26, but it's where my mind's at currently about it ; I haven't checked any Mobian images yet either for initial content.

saedmohmed commented 1 year ago

https://github.com/calamares/calamares-extensions/issues/25#issue-1796327294