[yocto] Setting Default User Accounts

Akash Bhatnagar actiononmail at gmail.com
Thu Aug 21 05:32:32 PDT 2014


Hi I have added new user in following way:-

S = "${WORKDIR}"

inherit useradd

USERADD_PACKAGES = "${PN}"

USERADD_PARAM_${PN} = "-u 1200 -d /home/test -r -s /bin/bash -P 'test123'
test "


GROUPADD_PARAM_${PN} = "-g 880 testgrp"


do_install () {
        install -d -m 755 ${D}/home/test

        install -p -m 644 <ANYFILE> ${D}/home/test/

        chown -R cli ${D}/home/test

        chgrp -R cligrp ${D}/home/test
}

FILES_${PN} = "/home/test/* "

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"





On Thu, Aug 21, 2014 at 3:51 PM, ChenQi <Qi.Chen at windriver.com> wrote:

>  How about add in local.conf:
>
> INHERIT += "extrausers"
> EXTRA_USERS_PARAMS = "usermod -L root; \
>                       useradd -P 'test' test;"
>
> //Chen Qi
>
>
> On 08/21/2014 03:13 AM, Crast, Nicholas wrote:
>
>  All,
>
>
>
> I am currently in the middle of a battle with yocto, trying to accomplish
> the following:
>
>
>
> 1.)    Disable root user account
>
> 2.)    Create default user account with default password
>
>
>
> I currently have the following a recipe:
>
> USERADD_PACKAGES = "${PN}"
>
> USERADD_PARAM_${PN} = "-d /home/nick -r -s /bin/bash nick "
>
>
>
> In order to try to add a user account. I have this in my image recipe:
>
>
>
> ROOTFS_POSTPROCESS_COMMAND += "set_nick_passwd;"
>
> set_nick_passwd() {
>
>    sed 's%^ nick:[^:]*:% nick:adySxRKMiPvjA:%' \
>
>        < ${IMAGE_ROOTFS}/etc/shadow \
>
>        > ${IMAGE_ROOTFS}/etc/shadow.new;
>
>    mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ;
>
> }
>
>
>
> This is to edit the /etc/shadow file and insert a new (hashed) password.
> What I’m looking for is a cleaner way to do this. When I run bitbake I get
> a lot of warnings because the “nick” account is already an account on my
> build machine. This seems like a fairly common use case, and I think I am
> likely going about it wrong.
>
>
>
> Does anybody have any advice?
>
>
>
> -Nick
>
> ----------------------------------------
>
> Nick Crast
>
> Associate Software Engineer
>
> Saab Sensis Corporation
>
> Phone: 315-445-5703
>
> Email: Nicholas.Crast at saabsensis.com
>
>
>
> *This message is intended only for the addressee and may contain
> information that is company confidential or privileged. Any technical data
> in this message may be exported only in accordance with the U.S.
> International Traffic in Arms Regulations (22 CFR Parts 120-130) or the
> Export Administration Regulations (15 CFR Parts 730-774). Unauthorized use
> is strictly prohibited and may be unlawful. If you are not the intended
> recipient, or the person responsible for delivering to the intended
> recipient, you should not read, copy, disclose or otherwise use this
> message. If you have received this email in error, please delete it, and
> advise the sender immediately. *
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20140821/011829a2/attachment.html>


More information about the yocto mailing list