All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Strange error when set root password in buildroot
@ 2013-07-25  2:42 Woody Wu
  2013-07-25  8:25 ` Thomas De Schampheleire
  0 siblings, 1 reply; 9+ messages in thread
From: Woody Wu @ 2013-07-25  2:42 UTC (permalink / raw)
  To: buildroot

Hi, 

Today I just set the root password in buildroot. Then I got strange
error when building:

/usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
/usr/bin/sed: -e expression #1, char 109: unknown option to `s'
make: *** [target-root-passwd] Error 1

What's the problem? Thanks.

-- 
I can't go back to yesterday - because I was a different person then

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-25  2:42 [Buildroot] Strange error when set root password in buildroot Woody Wu
@ 2013-07-25  8:25 ` Thomas De Schampheleire
  2013-07-26  8:11   ` Woody Wu
  2013-07-26  9:31   ` Woody Wu
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-07-25  8:25 UTC (permalink / raw)
  To: buildroot

Hi,

On Thu, Jul 25, 2013 at 4:42 AM, Woody Wu <narkewoody@gmail.com> wrote:
> Hi,
>
> Today I just set the root password in buildroot. Then I got strange
> error when building:
>
> /usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
> /usr/bin/sed: -e expression #1, char 109: unknown option to `s'
> make: *** [target-root-passwd] Error 1
>
> What's the problem? Thanks.

It seems that the mkpasswd on your system is not the same type as
buildroot expects.
Buildroot runs mkpasswd with '-m <method>', which does not seem to be
present on your mkpasswd.

What Linux system is this?
What is the output of:
which mkpasswd
and
mkpasswd -V

(I think the latter will not work in your case anyway, in my case it's:

$ mkpasswd -V
mkpasswd 5.0.19

Copyright (C) 2001-2008 Marco d'Itri
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Thanks,
Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-25  8:25 ` Thomas De Schampheleire
@ 2013-07-26  8:11   ` Woody Wu
  2013-07-26  8:23     ` Thomas De Schampheleire
  2013-07-26  9:31   ` Woody Wu
  1 sibling, 1 reply; 9+ messages in thread
From: Woody Wu @ 2013-07-26  8:11 UTC (permalink / raw)
  To: buildroot

On Thu, Jul 25, 2013 at 10:25:38AM +0200, Thomas De Schampheleire wrote:
> Hi,
> 
> On Thu, Jul 25, 2013 at 4:42 AM, Woody Wu <narkewoody@gmail.com> wrote:
> > Hi,
> >
> > Today I just set the root password in buildroot. Then I got strange
> > error when building:
> >
> > /usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
> > /usr/bin/sed: -e expression #1, char 109: unknown option to `s'
> > make: *** [target-root-passwd] Error 1
> >
> > What's the problem? Thanks.
> 
> It seems that the mkpasswd on your system is not the same type as
> buildroot expects.
> Buildroot runs mkpasswd with '-m <method>', which does not seem to be
> present on your mkpasswd.
> 
> What Linux system is this?
> What is the output of:
> which mkpasswd
> and
> mkpasswd -V
> 
> (I think the latter will not work in your case anyway, in my case it's:
> 
> $ mkpasswd -V
> mkpasswd 5.0.19
> 

Maybe you don't understand what I mean.  The build error are build-root
build error, which happened on my host, not on the target.

> Copyright (C) 2001-2008 Marco d'Itri
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> 
> 
> Thanks,
> Thomas

-- 
I can't go back to yesterday - because I was a different person then

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-26  8:11   ` Woody Wu
@ 2013-07-26  8:23     ` Thomas De Schampheleire
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-07-26  8:23 UTC (permalink / raw)
  To: buildroot

On Fri, Jul 26, 2013 at 10:11 AM, Woody Wu <narkewoody@gmail.com> wrote:
> On Thu, Jul 25, 2013 at 10:25:38AM +0200, Thomas De Schampheleire wrote:
>> Hi,
>>
>> On Thu, Jul 25, 2013 at 4:42 AM, Woody Wu <narkewoody@gmail.com> wrote:
>> > Hi,
>> >
>> > Today I just set the root password in buildroot. Then I got strange
>> > error when building:
>> >
>> > /usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
>> > /usr/bin/sed: -e expression #1, char 109: unknown option to `s'
>> > make: *** [target-root-passwd] Error 1
>> >
>> > What's the problem? Thanks.
>>
>> It seems that the mkpasswd on your system is not the same type as
>> buildroot expects.
>> Buildroot runs mkpasswd with '-m <method>', which does not seem to be
>> present on your mkpasswd.
>>
>> What Linux system is this?
>> What is the output of:
>> which mkpasswd
>> and
>> mkpasswd -V
>>
>> (I think the latter will not work in your case anyway, in my case it's:
>>
>> $ mkpasswd -V
>> mkpasswd 5.0.19
>>
>
> Maybe you don't understand what I mean.  The build error are build-root
> build error, which happened on my host, not on the target.

Yes, I perfectly understand.
During the buildroot build, mkpasswd from the host is called to
generate a hashed version of the root password. For this, 'mkpasswd -m
<method>' is called, but it seems that mkpasswd on your host does not
accept the '-m' option.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-25  8:25 ` Thomas De Schampheleire
  2013-07-26  8:11   ` Woody Wu
@ 2013-07-26  9:31   ` Woody Wu
  2013-07-26 10:25     ` Thomas De Schampheleire
  1 sibling, 1 reply; 9+ messages in thread
From: Woody Wu @ 2013-07-26  9:31 UTC (permalink / raw)
  To: buildroot

On Thu, Jul 25, 2013 at 10:25:38AM +0200, Thomas De Schampheleire wrote:
> Hi,
> 
> On Thu, Jul 25, 2013 at 4:42 AM, Woody Wu <narkewoody@gmail.com> wrote:
> > Hi,
> >
> > Today I just set the root password in buildroot. Then I got strange
> > error when building:
> >
> > /usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
> > /usr/bin/sed: -e expression #1, char 109: unknown option to `s'
> > make: *** [target-root-passwd] Error 1
> >
> > What's the problem? Thanks.
> 
> It seems that the mkpasswd on your system is not the same type as
> buildroot expects.
> Buildroot runs mkpasswd with '-m <method>', which does not seem to be
> present on your mkpasswd.
> 
> What Linux system is this?
> What is the output of:
> which mkpasswd
> and
> mkpasswd -V
> 
> (I think the latter will not work in your case anyway, in my case it's:
> 
> $ mkpasswd -V
> mkpasswd 5.0.19
> 

sorry, now I understand what you mean.  My linux is slackware linux, the
mkpasswd located in /usr/bin/mkpasswd, which even don't support -V or
--version to check its version number. And, yes, you are right, my
'mkpasswd' does not recognize '-m' option.

Thank you very much!  And, is there a work around?

-- 
I can't go back to yesterday - because I was a different person then

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-26  9:31   ` Woody Wu
@ 2013-07-26 10:25     ` Thomas De Schampheleire
  2013-07-27  5:42       ` Woody Wu
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-07-26 10:25 UTC (permalink / raw)
  To: buildroot

On Fri, Jul 26, 2013 at 11:31 AM, Woody Wu <narkewoody@gmail.com> wrote:
> On Thu, Jul 25, 2013 at 10:25:38AM +0200, Thomas De Schampheleire wrote:
>> Hi,
>>
>> On Thu, Jul 25, 2013 at 4:42 AM, Woody Wu <narkewoody@gmail.com> wrote:
>> > Hi,
>> >
>> > Today I just set the root password in buildroot. Then I got strange
>> > error when building:
>> >
>> > /usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
>> > /usr/bin/sed: -e expression #1, char 109: unknown option to `s'
>> > make: *** [target-root-passwd] Error 1
>> >
>> > What's the problem? Thanks.
>>
>> It seems that the mkpasswd on your system is not the same type as
>> buildroot expects.
>> Buildroot runs mkpasswd with '-m <method>', which does not seem to be
>> present on your mkpasswd.
>>
>> What Linux system is this?
>> What is the output of:
>> which mkpasswd
>> and
>> mkpasswd -V
>>
>> (I think the latter will not work in your case anyway, in my case it's:
>>
>> $ mkpasswd -V
>> mkpasswd 5.0.19
>>
>
> sorry, now I understand what you mean.  My linux is slackware linux, the
> mkpasswd located in /usr/bin/mkpasswd, which even don't support -V or
> --version to check its version number. And, yes, you are right, my
> 'mkpasswd' does not recognize '-m' option.

I'm not sure. Either we have to change buildroot to detect whether -m
is available before using it (if not, it will probably default to
md5). Or we need to find another solution.

Just a wild guess, can you check if there are other mkpasswd's available?
ls -l /bin/mkpasswd /usr/bin/mkpasswd /sbin/mkpasswd /usr/sbin/mkpasswd

A workaround for you is to change buildroot to remove the -m thing,
but it's better if we fix it completely, I think.

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-26 10:25     ` Thomas De Schampheleire
@ 2013-07-27  5:42       ` Woody Wu
  2013-07-27  8:00         ` Thomas De Schampheleire
  0 siblings, 1 reply; 9+ messages in thread
From: Woody Wu @ 2013-07-27  5:42 UTC (permalink / raw)
  To: buildroot

On Fri, Jul 26, 2013 at 12:25:33PM +0200, Thomas De Schampheleire wrote:
> On Fri, Jul 26, 2013 at 11:31 AM, Woody Wu <narkewoody@gmail.com> wrote:
> > On Thu, Jul 25, 2013 at 10:25:38AM +0200, Thomas De Schampheleire wrote:
> >> Hi,
> >>
> >> On Thu, Jul 25, 2013 at 4:42 AM, Woody Wu <narkewoody@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > Today I just set the root password in buildroot. Then I got strange
> >> > error when building:
> >> >
> >> > /usr/bin/sed -i -e 's,^root:[^:]*:,root:usage: mkpasswd [args] [user]   where arguments are:     -l #      (length of password, default = 9)     -d #      (min # of digits, default = 2)     -c #      (min # of lowercase chars, default = 2)     -C #      (min # of uppercase chars, default = 2)     -s #      (min # of special chars, default = 1)     -v        (verbose, show passwd interaction)     -p prog   (program to set password, default = passwd):,' /home/woody/src/buildroot-2013.05/output/target/etc/shadow
> >> > /usr/bin/sed: -e expression #1, char 109: unknown option to `s'
> >> > make: *** [target-root-passwd] Error 1
> >> >
> >> > What's the problem? Thanks.
> >>
> >> It seems that the mkpasswd on your system is not the same type as
> >> buildroot expects.
> >> Buildroot runs mkpasswd with '-m <method>', which does not seem to be
> >> present on your mkpasswd.
> >>
> >> What Linux system is this?
> >> What is the output of:
> >> which mkpasswd
> >> and
> >> mkpasswd -V
> >>
> >> (I think the latter will not work in your case anyway, in my case it's:
> >>
> >> $ mkpasswd -V
> >> mkpasswd 5.0.19
> >>
> >
> > sorry, now I understand what you mean.  My linux is slackware linux, the
> > mkpasswd located in /usr/bin/mkpasswd, which even don't support -V or
> > --version to check its version number. And, yes, you are right, my
> > 'mkpasswd' does not recognize '-m' option.
> 
> I'm not sure. Either we have to change buildroot to detect whether -m
> is available before using it (if not, it will probably default to
> md5). Or we need to find another solution.
> 
> Just a wild guess, can you check if there are other mkpasswd's available?
> ls -l /bin/mkpasswd /usr/bin/mkpasswd /sbin/mkpasswd /usr/sbin/mkpasswd
> 
> A workaround for you is to change buildroot to remove the -m thing,
> but it's better if we fix it completely, I think.
> 
> Thanks,
> Thomas

There is no other mkpasswd on my slackware box. The only one comes from
the expect package. Would you please where to change the '-m' in
buildroot and how?  Thanks.

-- 
I can't go back to yesterday - because I was a different person then

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-27  5:42       ` Woody Wu
@ 2013-07-27  8:00         ` Thomas De Schampheleire
  2013-07-27 13:00           ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-07-27  8:00 UTC (permalink / raw)
  To: buildroot

>> >
>> > sorry, now I understand what you mean.  My linux is slackware linux, the
>> > mkpasswd located in /usr/bin/mkpasswd, which even don't support -V or
>> > --version to check its version number. And, yes, you are right, my
>> > 'mkpasswd' does not recognize '-m' option.
>>
>> I'm not sure. Either we have to change buildroot to detect whether -m
>> is available before using it (if not, it will probably default to
>> md5). Or we need to find another solution.
>>
>> Just a wild guess, can you check if there are other mkpasswd's available?
>> ls -l /bin/mkpasswd /usr/bin/mkpasswd /sbin/mkpasswd /usr/sbin/mkpasswd
>>
>> A workaround for you is to change buildroot to remove the -m thing,
>> but it's better if we fix it completely, I think.
>>
>> Thanks,
>> Thomas
>
> There is no other mkpasswd on my slackware box. The only one comes from
> the expect package. Would you please where to change the '-m' in
> buildroot and how?  Thanks.

In system/system.mk, if you change line

TARGET_GENERIC_ROOT_PASSWD_HASH = $(shell mkpasswd -m
"$(TARGET_GENERIC_PASSWD_METHOD)" "$(TARGET_GENERIC_ROOT_PASSWD)")

in

TARGET_GENERIC_ROOT_PASSWD_HASH = $(shell mkpasswd
"$(TARGET_GENERIC_ROOT_PASSWD)")

I guess it will work for you. But this is not an acceptable final solution.

Input from others would be great here.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Strange error when set root password in buildroot
  2013-07-27  8:00         ` Thomas De Schampheleire
@ 2013-07-27 13:00           ` Thomas Petazzoni
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2013-07-27 13:00 UTC (permalink / raw)
  To: buildroot

Dear Thomas De Schampheleire,

On Sat, 27 Jul 2013 10:00:59 +0200, Thomas De Schampheleire wrote:

> I guess it will work for you. But this is not an acceptable final solution.
> 
> Input from others would be great here.

I guess the only option would be to build our own mkpasswd and use it
when the user enters a non-empty root password in the configuration.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-27 13:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-25  2:42 [Buildroot] Strange error when set root password in buildroot Woody Wu
2013-07-25  8:25 ` Thomas De Schampheleire
2013-07-26  8:11   ` Woody Wu
2013-07-26  8:23     ` Thomas De Schampheleire
2013-07-26  9:31   ` Woody Wu
2013-07-26 10:25     ` Thomas De Schampheleire
2013-07-27  5:42       ` Woody Wu
2013-07-27  8:00         ` Thomas De Schampheleire
2013-07-27 13:00           ` Thomas Petazzoni

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.