From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] btrfs filesystem image creation using TARGET_DIR path
Date: Thu, 1 Aug 2019 09:43:45 +0200 [thread overview]
Message-ID: <20190801094345.11611680@windsurf.home> (raw)
In-Reply-To: <CAP8JTaY_9cS7vTMK_hxJsn2USEuKVZnNjj-s1bXP8fkXbipLMA@mail.gmail.com>
Hello,
On Thu, 1 Aug 2019 12:19:49 +0530
chalil jitesh <chaliljitesh@gmail.com> wrote:
> Thanks for reviewing and providing the information.
>
> The following is the issue i am facing when using the TARGET_DIR.
> Suppose we set any capabilities to the files in the BASE_TARGET_DIR
> (./target in the below example) during the buildroot compilation. Example
> if we set some capabilities to the tool ping in BASE_TARGET_DIR as in
> example below.
> example : setcap cap_net_raw=ei ./target/bin/ping
> If we use BASE_TARGET_DIR with the -r option in buildroot/fs/btrfs/btrfs.mk
> (buildroot/fs/btrfs/btrfs.mk : -r '$(BASE_TARGET_DIR)')
> After the rootfs.btrfs image is generated from buildroot, if we mount the
> btrfs file sytem and check the capability of the file ping, the capability
> is getting retained in the btrfs file system generated as in example below
> (if BASE_TARGET_DIR is used btrfs.mk).
> [root at localhost images]# mkdir test
> [root at localhost images]# mount -t btrfs ./rootfs.btrfs test
> [root at localhost images]# getcap ./test/bin/ping
> ./test/bin/ping = cap_net_raw+ei
> [root at localhost images]#
The correct way to assign capabilities is to use the <pkg>_PERMISSIONS
variable, which allows to define extended attributes for any file
installed by a package.
You might want to have a look at the current discussion in the
following patches:
http://patchwork.ozlabs.org/patch/1140027/
http://patchwork.ozlabs.org/patch/1140026/
Especially the second patch is very relevant, because it's precisely
taking care of setting the right capabilities for ping.
Also, from the above, it seems like you are doing your Buildroot build
as root, which is really not recommended. We strongly recommend to do
Buildroot builds as a normal user.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-08-01 7:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 13:03 [Buildroot] btrfs filesystem image creation using TARGET_DIR path chalil jitesh
2019-07-31 12:45 ` Thomas Petazzoni
2019-08-01 6:49 ` chalil jitesh
2019-08-01 7:43 ` Thomas Petazzoni [this message]
2019-08-22 13:30 ` chalil jitesh
2019-08-22 16:31 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190801094345.11611680@windsurf.home \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox