* [Buildroot] How to login as root without password
@ 2013-07-30 10:43 zhou qiang
2013-07-30 12:39 ` Thomas De Schampheleire
0 siblings, 1 reply; 8+ messages in thread
From: zhou qiang @ 2013-07-30 10:43 UTC (permalink / raw)
To: buildroot
Hi , guys
I am working on a server (no root permision) , my intention is to create a
root filesystem for arm board ,and
login as root ,directly to /bin/sh(no login window ).
From the document , I know that it is not possible to use target/ , then I
create a rootfs.tar in images/ , and
extract it .what I did is as following :
(1) "fakeroot tar -xvf images/rootfs.tar -C work/rootfs " to extract it to
rootfs directory ,
since no root permision , fakeroot does a great job.
(2) Adding "ttyS0:respawn:~/bin/sh " to avoid requiring login .
After burning the filesystem to development board.
The problem is coming , current login is a ordinary user , what I expected
is root user .
Can someone help to fix this issue , any input would be great appreciated .
Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130730/ba67a5e2/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-30 10:43 [Buildroot] How to login as root without password zhou qiang
@ 2013-07-30 12:39 ` Thomas De Schampheleire
2013-07-30 13:40 ` zhou qiang
0 siblings, 1 reply; 8+ messages in thread
From: Thomas De Schampheleire @ 2013-07-30 12:39 UTC (permalink / raw)
To: buildroot
Hi Zhou Qiang,
On Tue, Jul 30, 2013 at 12:43 PM, zhou qiang <zhouqiang.search@gmail.com> wrote:
> Hi , guys
>
> I am working on a server (no root permision) , my intention is to create a
> root filesystem for arm board ,and
> login as root ,directly to /bin/sh(no login window ).
> From the document , I know that it is not possible to use target/ , then I
> create a rootfs.tar in images/ , and
> extract it .what I did is as following :
>
> (1) "fakeroot tar -xvf images/rootfs.tar -C work/rootfs " to extract it to
> rootfs directory ,
> since no root permision , fakeroot does a great job.
>
> (2) Adding "ttyS0:respawn:~/bin/sh " to avoid requiring login .
>
>
> After burning the filesystem to development board.
> The problem is coming , current login is a ordinary user , what I expected
> is root user .
Are you using busybox or not?
By default, on a busybox system, you login as the root user. If this
is not the case, then something about your configuration will be
different.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-30 12:39 ` Thomas De Schampheleire
@ 2013-07-30 13:40 ` zhou qiang
2013-07-30 14:02 ` Thomas De Schampheleire
0 siblings, 1 reply; 8+ messages in thread
From: zhou qiang @ 2013-07-30 13:40 UTC (permalink / raw)
To: buildroot
Hi , Thomas
Thank you for your reply .
Yes , I am using busybox .
And if using "sudo" instead of "fakeroot" to extract root filesystem .
then burn to the board , It login as root ,even execute "chown -R user:user
rootfs" .
before burning .
But I can not give sudo permission to other users on ther server.
Regards ,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130730/672bad7d/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-30 13:40 ` zhou qiang
@ 2013-07-30 14:02 ` Thomas De Schampheleire
2013-07-31 15:03 ` zhou qiang
0 siblings, 1 reply; 8+ messages in thread
From: Thomas De Schampheleire @ 2013-07-30 14:02 UTC (permalink / raw)
To: buildroot
On Tue, Jul 30, 2013 at 3:40 PM, zhou qiang <zhouqiang.search@gmail.com> wrote:
> Hi , Thomas
>
> Thank you for your reply .
>
> Yes , I am using busybox .
>
> And if using "sudo" instead of "fakeroot" to extract root filesystem .
> then burn to the board , It login as root ,even execute "chown -R user:user
> rootfs" .
> before burning .
>
> But I can not give sudo permission to other users on ther server.
What exactly does the burning step imply? How exactly are you putting
the rootfs on target?
You should normally not extract the rootfs and make modifications to
it after it has been packaged. Any change you want to make to the
rootfs, for example to change /etc/inittab, should be done before the
image is created.
The following section in the manual describes different ways to
accomplish that:
http://buildroot.uclibc.org/downloads/manual/manual.html#rootfs-custom
A post-build script is a convenient solution for this type of change.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-30 14:02 ` Thomas De Schampheleire
@ 2013-07-31 15:03 ` zhou qiang
2013-07-31 15:11 ` Thomas De Schampheleire
2013-07-31 15:17 ` Thomas Petazzoni
0 siblings, 2 replies; 8+ messages in thread
From: zhou qiang @ 2013-07-31 15:03 UTC (permalink / raw)
To: buildroot
Hi , Thomas
We have an internal jffs2 image making process , which requires a pure
target from buildroot ,
and follow the steps as below :
(1) extract rootfs.tar to designated target directory (rootfs) , this is
done by post-script .
(2) Adding functional script and application to rootfs .
(3) make a new jffs2 image
(4)burn this image to arm board
Of course , if extract rootfs.tar as root , everything works pretty well ,
busybox login as root .
But in the server , there is no root permission .
So the issue is how to login as root without "operation of extract
rootfs.tar as root".
Regards ,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130731/b39c5319/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-31 15:03 ` zhou qiang
@ 2013-07-31 15:11 ` Thomas De Schampheleire
2013-07-31 15:17 ` Thomas Petazzoni
1 sibling, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2013-07-31 15:11 UTC (permalink / raw)
To: buildroot
On Wed, Jul 31, 2013 at 5:03 PM, zhou qiang <zhouqiang.search@gmail.com> wrote:
> Hi , Thomas
>
> We have an internal jffs2 image making process , which requires a pure
> target from buildroot ,
> and follow the steps as below :
>
> (1) extract rootfs.tar to designated target directory (rootfs) , this is
> done by post-script .
> (2) Adding functional script and application to rootfs .
> (3) make a new jffs2 image
> (4)burn this image to arm board
>
> Of course , if extract rootfs.tar as root , everything works pretty well ,
> busybox login as root .
> But in the server , there is no root permission .
>
> So the issue is how to login as root without "operation of extract
> rootfs.tar as root".
>
What is the input to step 4, an extracted directory, or just the image?
In general, when you want to add custom elements to the rootfs, you would do:
a. 'make' in buildroot
b. copy custom files to <buildroot>/output/target
c. 'make' in buildroot again, this will create a new image
d. burn image to board
Is there a reason why you do not do it this way?
Best regards,
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-31 15:03 ` zhou qiang
2013-07-31 15:11 ` Thomas De Schampheleire
@ 2013-07-31 15:17 ` Thomas Petazzoni
2013-08-01 8:09 ` zhou qiang
1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2013-07-31 15:17 UTC (permalink / raw)
To: buildroot
Dear zhou qiang,
On Wed, 31 Jul 2013 23:03:18 +0800, zhou qiang wrote:
> Of course , if extract rootfs.tar as root , everything works pretty well ,
> busybox login as root .
> But in the server , there is no root permission .
>
> So the issue is how to login as root without "operation of extract
> rootfs.tar as root".
As Thomas De Schampheleire suggested, you should write a Buildroot
post-build script that copies your application into the root
filesystem, and let Buildroot do the fakeroot game to finally generate
your ready-to-use JFFS2 image.
Another option is to use fakeroot manually outside of Buildroot, but
beware that you have to execute *all* the commands manipulating the
root filesystem under a *single* fakeroot session. Since you apparently
don't fully understand the implications of fakeroot, I'd really suggest
you to use a Buildroot post-build script instead.
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] 8+ messages in thread
* [Buildroot] How to login as root without password
2013-07-31 15:17 ` Thomas Petazzoni
@ 2013-08-01 8:09 ` zhou qiang
0 siblings, 0 replies; 8+ messages in thread
From: zhou qiang @ 2013-08-01 8:09 UTC (permalink / raw)
To: buildroot
Hi ,Thomas
Thank you for your suggestion and explanation .
Using post-script is a good choice in current situation and seems to work
well
on arm board for me .
But let Buildroot to generate final jffs2 image is not my expected way.
Just as explained
before we have an internal application to generate final jffs2 image .
Fakeroot could not
be used in patch script , manually inputting command sequence in fakeroot
session is not
accepted in our development rule .
Anyway , I am going to use post-script and thank you very much .
Regards ,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130801/e84e8c10/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-08-01 8:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-30 10:43 [Buildroot] How to login as root without password zhou qiang
2013-07-30 12:39 ` Thomas De Schampheleire
2013-07-30 13:40 ` zhou qiang
2013-07-30 14:02 ` Thomas De Schampheleire
2013-07-31 15:03 ` zhou qiang
2013-07-31 15:11 ` Thomas De Schampheleire
2013-07-31 15:17 ` Thomas Petazzoni
2013-08-01 8:09 ` zhou qiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox