All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andy Pont" <andy.pont@sdcsystems.com>
To: "'Daniel.'" <danielhilst@gmail.com>
Cc: yocto@yoctoproject.org
Subject: Re: Setting root password
Date: Thu, 24 Sep 2015 14:59:21 +0100	[thread overview]
Message-ID: <004801d0f6d1$36f889c0$a4e99d40$@pont@sdcsystems.com> (raw)
In-Reply-To: <CAF3SDA7SE==bdZO45njNYnbtViyJ1JTH+AKofNM3+brKdW2iAA@mail.gmail.com>

Hi Daniel,

> I didn't know about this EXTRA_USERS_PARAMS. What I do is adding this function to
> my image. 
> # This function sets the password for root based on ROOT_PASSWD variable
> set_root_password () {
>         local p=$(openssl passwd -1 -salt "My salt" "${ROOT_PASSWD}")
>        sed -e "s/root:[^:]*:/root:${p}:/" -i ${IMAGE_ROOTFS}/etc/shadow
> }
> And append it to ROOTFS_POSTPROCESS_COMMAND:
> ROOTFS_POSTPROCESS_COMMAND += "set_root_password; "
> I did all this in a class file which I import on all my images, 

As your method works and the EXTRA_USERS_PARAMS appears not to be doing could you send me your class file to save me having to reinvent the wheel?

> About your problem, can you get the "usermod" error from log.do_rootfs 

The end of the log.do_roots file just contains the following:

NOTE: Executing set_user_group ...
DEBUG: Executing shell function set_user_group
NOTE: Performing usermod with [-R XXXXX/build/tmp/work/intel_core2_32-poky-linux/core-image-minimal-initramfs/1.0-r0/rootfs -P Hkw6rBJlcfhvM root] and 1 times of retry
Server refused shutdown.  Remaining client fds: 2
Client pids: 3878 16245
Server will shut down after all clients exit.
WARNING: usermod command did not succeed. Retrying...
ERROR: Tried running usermod command 1 times without success, giving up
WARNING: XXXXX/build/tmp/work/intel_core2_32-poky-linux/core-image-minimal-initramfs/1.0-r0/temp/run.set_user_group.3878:1 exit 1 from
  exit 1
DEBUG: Python function do_rootfs finished

Thanks,

Andy.



  reply	other threads:[~2015-09-24 13:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5603f9ce.e9d1440a.dc3ac.43adSMTPIN_ADDED_BROKEN@mx.google.com>
2015-09-24 13:45 ` Setting root password Daniel.
2015-09-24 13:59   ` Andy Pont [this message]
     [not found]   ` <560401bd.46256b0a.11836.2eefSMTPIN_ADDED_BROKEN@mx.google.com>
2015-09-24 14:16     ` Daniel.
2015-09-24 14:20       ` Daniel.
2015-09-24 15:17         ` Rudolf J Streif
2015-09-24 16:21           ` Andy Pont
2015-09-29  9:04           ` Paul Eggleton
2015-09-24 13:24 Andy Pont
  -- strict thread matches above, loose matches on Subject: below --
2013-10-11 14:35 Jack Mitchell
2013-10-11 15:08 ` Koen Kooi
2013-10-12  2:04 ` ChenQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004801d0f6d1$36f889c0$a4e99d40$@pont@sdcsystems.com' \
    --to=andy.pont@sdcsystems.com \
    --cc=danielhilst@gmail.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.