Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add usermod command about default username #26

Merged

Conversation

nmschulte
Copy link
Contributor

attempts to fix #25

cmdUsermod supports changing the default username

in case any extra initial state needs updated, cmdUsermod can be amended to run additional commands
modules/mobile/Config.cpp Outdated Show resolved Hide resolved
@Undef-a
Copy link

Undef-a commented Jul 11, 2023

Overall this looks reasonable, but I'd like to test it out. My two main worries here are:

  1. The Mobian wiki page I linked in the issue describes changing the username appearing in files under /home/mobian. I'm not sure whether those are there even on an unused install but if they are they might cause problems.
  2. The height of the page might be too big for the Librem5 (see mobile: Reflow confirm page to fit smaller screens #23, it's slightly shorter).

I'll get back when I've tested these two. Thanks for fixing this one!

@nmschulte
Copy link
Contributor Author

  1. I'm not sure whether those are there even on an unused install but if they are they might cause problems.

I looked at this; the current mobian-pinephonepro-phosh-20230606.img e.g. does not contain any references to the mobian user in /home/mobian.

@Undef-a
Copy link

Undef-a commented Jul 12, 2023

Could I ask that you please build and run your commits? I just built it and the install fails because it's trying to change the user's password before creating that user.

modules/mobile/Config.cpp Outdated Show resolved Hide resolved
@Undef-a
Copy link

Undef-a commented Jul 12, 2023

The height of the page might be too big for the Librem5

Just tested it, this isn't an issue.

@nmschulte
Copy link
Contributor Author

@Undef-a, @adriaandegroot -- I have confirmed that these changes resolve #25, completing the desires of #22.

In Mobian, where I tested, the user's full-name is still "mobian" I believe; I don't know if this is behavior of Mobian or of the mobile module: if the latter, this could be updated to change the full-name to match the given username.

P1010056

P1010058

As noted above, the new cmdUsermod will need to match any change to username config, otherwise an error like this will present:

P1010057

@Undef-a
Copy link

Undef-a commented Jul 29, 2023

Just got the chance to test this. It's working pretty much as expected now.

As for the fullname, chfn seems to be the command you want, although according to the man page and some research usermod -c <new name> might do the same. If chfn is run after the username change it shouldn't require a configurable command as it should only need the new username.

Thanks for fixing this one up! It's very nearly there.

@Undef-a
Copy link

Undef-a commented Aug 6, 2023

With that last commit LGTM. After install I have a newly named user with no sight of "Mobian" anywhere. Thanks.
@adriaandegroot unless @ollieparanoid or @PureTryOut think these commands will cause issues on pmOS I'd say this one is good to go.

@PureTryOut
Copy link

We need to make sure shadow is installed, but otherwise this will not cause us problems. Go ahead 👍

@adriaandegroot adriaandegroot merged commit ea762b0 into calamares:calamares Aug 6, 2023
1 check passed
@nmschulte
Copy link
Contributor Author

Thank you. Sorry for the break.

@nmschulte nmschulte deleted the nms/fix-username-prompt branch August 6, 2023 16:42
@ollieparanoid
Copy link
Contributor

I've just verified that this also fixes the bug on postmarketOS, and creating the user with a custom username works. Thanks for fixing it @nmschulte!

@adriaandegroot: can you please tag a fixup release?

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Aug 8, 2023
Backport patches to fix a regression from the 1.3.0 release that cause
the mobile installer to be stuck at the "new user" screen.

Related: calamares/calamares-extensions#26
Related: calamares/calamares-extensions#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New username feature breaks Mobile install
5 participants