From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 4AC9FE00807; Thu, 21 Aug 2014 03:21:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.1.11 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id D532FE004F5 for ; Thu, 21 Aug 2014 03:21:03 -0700 (PDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id s7LAL16V001614 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 21 Aug 2014 03:21:01 -0700 (PDT) Received: from [128.224.162.187] (128.224.162.187) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 21 Aug 2014 03:21:01 -0700 Message-ID: <53F5C828.4090509@windriver.com> Date: Thu, 21 Aug 2014 18:21:28 +0800 From: ChenQi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: References: <36A43B0E1E88D84791516F9D44BC48331B3C8D01@corpmail01.corp.sensis.com> In-Reply-To: <36A43B0E1E88D84791516F9D44BC48331B3C8D01@corpmail01.corp.sensis.com> X-Originating-IP: [128.224.162.187] Subject: Re: Setting Default User Accounts X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2014 10:21:10 -0000 Content-Type: multipart/alternative; boundary="------------050700040008010703050000" --------------050700040008010703050000 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit 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@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. / > > --------------050700040008010703050000 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 8bit
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@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.


--------------050700040008010703050000--