* [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf
@ 2014-06-10 9:23 cem akpolat
2014-06-10 9:33 ` Jeremy Rosen
2014-06-10 9:38 ` Samuel Martin
0 siblings, 2 replies; 9+ messages in thread
From: cem akpolat @ 2014-06-10 9:23 UTC (permalink / raw)
To: buildroot
Dear all,
I am attempting right now to copy some files through Root overlay to my
file system image, however, as some of them requires root permission I
cannot copy them to the related place. For instance, openvpn files such as
server.key, ta.keys, etc raise the following issue:
cp: cannot access
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/easy-rsa/2.0/keys?:
Permission denied
cp: cannot access
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/easy-rsa/2.0/keys?:
Permission denied
cp: cannot open
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/server.conf?
for reading: Permission denied
cp: cannot open
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/server.key?
for reading: Permission denied
cp: cannot open
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/samples/client.conf?
for reading: Permission denied
cp: cannot open
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/ta.key?
for reading: Permission denied
cp: cannot open
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/server.key?
for reading: Permission denied
cp: cannot open
?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/samples/client.conf?
for reading: Permission denied
The script that I have written in post-build.sh as below:
fakeroot cp -r $BOARD_DIR/root-additions/etc/openvpn $TARGET_DIR/etc/
fakeroot cp -r $BOARD_DIR/root-additions/etc/snmp $TARGET_DIR/etc/
Obviously, there is a permission issue, but I have no idea how to handle
it. it seems that sudo doesn't work, since buildroot uses fakeroot.
Thanks
Cem
Cem Akpolat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140610/9a390d62/attachment.html>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf
2014-06-10 9:23 [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf cem akpolat
@ 2014-06-10 9:33 ` Jeremy Rosen
2014-06-10 9:48 ` Thomas Petazzoni
2014-06-10 9:38 ` Samuel Martin
1 sibling, 1 reply; 9+ messages in thread
From: Jeremy Rosen @ 2014-06-10 9:33 UTC (permalink / raw)
To: buildroot
All file ownership are given to root in the fakeroot container,
the fakeroot container is applied after the overlay
So, (assuming I understant correctly what's going on) you don't neet to have these files owned by root in the overlay. Ownership will be changed while the final image is built
----- Mail original -----
>
>
>
> Dear all,
>
>
> I am attempting right now to copy some files through Root overlay to
> my file system image, however, as some of them requires root
> permission I cannot copy them to the related place. For instance,
> openvpn files such as server.key, ta.keys, etc raise the following
> issue:
>
>
>
> cp: cannot access
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/easy-rsa/2.0/keys?:
> Permission denied
> cp: cannot access
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/easy-rsa/2.0/keys?:
> Permission denied
> cp: cannot open
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/server.conf?
> for reading: Permission denied
> cp: cannot open
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/server.key?
> for reading: Permission denied
> cp: cannot open
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/samples/client.conf?
> for reading: Permission denied
> cp: cannot open
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/ta.key?
> for reading: Permission denied
> cp: cannot open
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/server.key?
> for reading: Permission denied
> cp: cannot open
> ?/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/samples/client.conf?
> for reading: Permission denied
>
>
> The script that I have written in post-build.sh as below:
>
>
>
> fakeroot cp -r $BOARD_DIR/root-additions/etc/openvpn $TARGET_DIR/etc/
> fakeroot cp -r $BOARD_DIR/root-additions/etc/snmp $TARGET_DIR/etc/
>
>
>
>
> Obviously, there is a permission issue, but I have no idea how to
> handle it. it seems that sudo doesn't work, since buildroot uses
> fakeroot.
>
>
> Thanks
> Cem
>
>
>
>
>
> Cem Akpolat
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf
2014-06-10 9:33 ` Jeremy Rosen
@ 2014-06-10 9:48 ` Thomas Petazzoni
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2014-06-10 9:48 UTC (permalink / raw)
To: buildroot
Dear Jeremy Rosen,
On Tue, 10 Jun 2014 11:33:37 +0200 (CEST), Jeremy Rosen wrote:
>
> All file ownership are given to root in the fakeroot container,
>
> the fakeroot container is applied after the overlay
>
>
> So, (assuming I understant correctly what's going on) you don't neet to have these files owned by root in the overlay. Ownership will be changed while the final image is built
Could you please learn about the usual rules about replying on mailing
lists, and make sure to not top-post, and to use an e-mail that wraps
lines to a reasonable length.
As a hint, I would suggest to not use Zimbra as your e-mail client,
from what I've seen all the people using it can only send e-mails
improperly formatted.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf
2014-06-10 9:23 [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf cem akpolat
2014-06-10 9:33 ` Jeremy Rosen
@ 2014-06-10 9:38 ` Samuel Martin
[not found] ` <CAMm5YqotyZ9y6c3vFXME+rh860RiB1X0RUFE=10k40yrzbM+fg@mail.gmail.com>
1 sibling, 1 reply; 9+ messages in thread
From: Samuel Martin @ 2014-06-10 9:38 UTC (permalink / raw)
To: buildroot
Hi Cem,
On Tue, Jun 10, 2014 at 11:23 AM, cem akpolat <akpolatcem@gmail.com> wrote:
> Dear all,
>
> I am attempting right now to copy some files through Root overlay to my file
> system image, however, as some of them requires root permission I cannot
> copy them to the related place. For instance, openvpn files such as
> server.key, ta.keys, etc raise the following issue:
>
> cp: cannot access
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/easy-rsa/2.0/keys':
> Permission denied
> cp: cannot access
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/easy-rsa/2.0/keys':
> Permission denied
> cp: cannot open
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/server.conf'
> for reading: Permission denied
> cp: cannot open
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/server.key'
> for reading: Permission denied
> cp: cannot open
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/samples/client.conf'
> for reading: Permission denied
> cp: cannot open
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/openvpn/ta.key'
> for reading: Permission denied
> cp: cannot open
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/server.key'
> for reading: Permission denied
> cp: cannot open
> '/home/cem/buildroot/board/myboard/root-additions/etc/openvpn/samples/client.conf'
> for reading: Permission denied
>
> The script that I have written in post-build.sh as below:
>
> fakeroot cp -r $BOARD_DIR/root-additions/etc/openvpn $TARGET_DIR/etc/
> fakeroot cp -r $BOARD_DIR/root-additions/etc/snmp $TARGET_DIR/etc/
Here is how I would handle such a use-case:
1- make sure the source files can be accessed (i.e. you can read
everything in $BOARD_DIR/root-additions/etc/{openvpn,snmp})
2- create dummy package containing the install rules of these files
(you can also move these files under this package directory)
3- use the _PERMISSION infra, as explained at [1].
(I have not tested this myself)
Hope this help.
Regards,
[1] http://nightly.buildroot.org/manual.html#_the_literal_mk_literal_file
--
Samuel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-06-10 11:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 9:23 [Buildroot] Some files to be copied to root file systems such as openvpn keys, conf cem akpolat
2014-06-10 9:33 ` Jeremy Rosen
2014-06-10 9:48 ` Thomas Petazzoni
2014-06-10 9:38 ` Samuel Martin
[not found] ` <CAMm5YqotyZ9y6c3vFXME+rh860RiB1X0RUFE=10k40yrzbM+fg@mail.gmail.com>
2014-06-10 9:53 ` cem akpolat
2014-06-10 10:06 ` Samuel Martin
2014-06-10 10:23 ` Thomas Petazzoni
2014-06-10 11:34 ` Samuel Martin
2014-06-10 10:21 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox