calamares / calamares-extensions

Examples of Calamares branding
36 stars 19 forks source link

add usermod command about default username #26

Closed nmschulte closed 1 year ago

nmschulte commented 1 year ago

attempts to fix #25

Undef-a commented 1 year ago

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 https://github.com/calamares/calamares-extensions/pull/23, it's slightly shorter).

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

nmschulte commented 1 year ago
  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 commented 1 year ago

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.

Undef-a commented 1 year ago

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

Just tested it, this isn't an issue.

nmschulte commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

nmschulte commented 1 year ago

Thank you. Sorry for the break.

ollieparanoid commented 1 year ago

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?