* [PATCH] Fix recursive mode -st on BUILDDIR setup @ 2015-09-02 16:36 Alex Franco 2015-09-02 17:51 ` Richard Purdie 2015-09-02 21:47 ` Peter Seebach 0 siblings, 2 replies; 10+ messages in thread From: Alex Franco @ 2015-09-02 16:36 UTC (permalink / raw) To: openembedded-core; +Cc: clarson Removing recursive option from chmod -st on BUILDDIR as it would take very long on existing build directories [YOCTO 7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> --- scripts/oe-setup-builddir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir index f5b7e4e..44c7dcc 100755 --- a/scripts/oe-setup-builddir +++ b/scripts/oe-setup-builddir @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then fi mkdir -p "$BUILDDIR/conf" -chmod -R -st "$BUILDDIR" +chmod -st "$BUILDDIR" if [ ! -d "$BUILDDIR" ]; then echo >&2 "Error: The builddir ($BUILDDIR) does not exist!" -- 2.5.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-02 16:36 [PATCH] Fix recursive mode -st on BUILDDIR setup Alex Franco @ 2015-09-02 17:51 ` Richard Purdie 2015-09-02 18:25 ` Martin Jansa 2015-09-02 21:47 ` Peter Seebach 1 sibling, 1 reply; 10+ messages in thread From: Richard Purdie @ 2015-09-02 17:51 UTC (permalink / raw) To: Alex Franco; +Cc: clarson, openembedded-core On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: > Removing recursive option from chmod -st on BUILDDIR as it would > take very long on existing build directories > > [YOCTO 7669] > > Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> > --- > scripts/oe-setup-builddir | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir > index f5b7e4e..44c7dcc 100755 > --- a/scripts/oe-setup-builddir > +++ b/scripts/oe-setup-builddir > @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then > fi > > mkdir -p "$BUILDDIR/conf" > -chmod -R -st "$BUILDDIR" > +chmod -st "$BUILDDIR" I think you did this so that conf/ gets the right permissions too. Perhaps the best approach is: +chmod -st "$BUILDDIR" $BUILDDIR/conf" ? Cheers, Richard ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-02 17:51 ` Richard Purdie @ 2015-09-02 18:25 ` Martin Jansa 2015-09-02 21:27 ` Alex Franco 0 siblings, 1 reply; 10+ messages in thread From: Martin Jansa @ 2015-09-02 18:25 UTC (permalink / raw) To: Richard Purdie; +Cc: clarson, openembedded-core [-- Attachment #1: Type: text/plain, Size: 1398 bytes --] On Wed, Sep 02, 2015 at 06:51:23PM +0100, Richard Purdie wrote: > On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: > > Removing recursive option from chmod -st on BUILDDIR as it would > > take very long on existing build directories > > > > [YOCTO 7669] > > > > Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> > > --- > > scripts/oe-setup-builddir | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir > > index f5b7e4e..44c7dcc 100755 > > --- a/scripts/oe-setup-builddir > > +++ b/scripts/oe-setup-builddir > > @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then > > fi > > > > mkdir -p "$BUILDDIR/conf" > > -chmod -R -st "$BUILDDIR" > > +chmod -st "$BUILDDIR" > > I think you did this so that conf/ gets the right permissions too. > Perhaps the best approach is: > > +chmod -st "$BUILDDIR" $BUILDDIR/conf" Can we add "|| bbwarn foo" for cases when it doesn't work for whatever reason or check the permissions of these 2 dirs before calling chmod? > > ? > > Cheers, > > Richard > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-02 18:25 ` Martin Jansa @ 2015-09-02 21:27 ` Alex Franco 2015-09-03 0:57 ` Martin Jansa 0 siblings, 1 reply; 10+ messages in thread From: Alex Franco @ 2015-09-02 21:27 UTC (permalink / raw) To: Martin Jansa, Richard Purdie; +Cc: clarson, openembedded-core Checking may be the better approach, as warning here would do little more than what the current failure does (informing that chmod failed) Alex Franco On 09/02/2015 01:25 PM, Martin Jansa wrote: > On Wed, Sep 02, 2015 at 06:51:23PM +0100, Richard Purdie wrote: >> On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: >>> Removing recursive option from chmod -st on BUILDDIR as it would >>> take very long on existing build directories >>> >>> [YOCTO 7669] >>> >>> Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> >>> --- >>> scripts/oe-setup-builddir | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir >>> index f5b7e4e..44c7dcc 100755 >>> --- a/scripts/oe-setup-builddir >>> +++ b/scripts/oe-setup-builddir >>> @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then >>> fi >>> >>> mkdir -p "$BUILDDIR/conf" >>> -chmod -R -st "$BUILDDIR" >>> +chmod -st "$BUILDDIR" >> I think you did this so that conf/ gets the right permissions too. >> Perhaps the best approach is: >> >> +chmod -st "$BUILDDIR" $BUILDDIR/conf" > Can we add "|| bbwarn foo" > > for cases when it doesn't work for whatever reason or check the > permissions of these 2 dirs before calling chmod? > >> ? >> >> Cheers, >> >> Richard >> >> -- >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-02 21:27 ` Alex Franco @ 2015-09-03 0:57 ` Martin Jansa 2015-09-03 20:01 ` Alex Franco 0 siblings, 1 reply; 10+ messages in thread From: Martin Jansa @ 2015-09-03 0:57 UTC (permalink / raw) To: Alex Franco Cc: Christopher Larson, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 1849 bytes --] Warning informing that chmod failed is better than fatal error preventing me to build anything in that setup with tmpfs. On Wed, Sep 2, 2015 at 11:27 PM, Alex Franco < alejandro.franco@linux.intel.com> wrote: > Checking may be the better approach, as warning here would do little more > than what the current failure does (informing that chmod failed) > > Alex Franco > > > On 09/02/2015 01:25 PM, Martin Jansa wrote: > >> On Wed, Sep 02, 2015 at 06:51:23PM +0100, Richard Purdie wrote: >> >>> On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: >>> >>>> Removing recursive option from chmod -st on BUILDDIR as it would >>>> take very long on existing build directories >>>> >>>> [YOCTO 7669] >>>> >>>> Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> >>>> --- >>>> scripts/oe-setup-builddir | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir >>>> index f5b7e4e..44c7dcc 100755 >>>> --- a/scripts/oe-setup-builddir >>>> +++ b/scripts/oe-setup-builddir >>>> @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then >>>> fi >>>> mkdir -p "$BUILDDIR/conf" >>>> -chmod -R -st "$BUILDDIR" >>>> +chmod -st "$BUILDDIR" >>>> >>> I think you did this so that conf/ gets the right permissions too. >>> Perhaps the best approach is: >>> >>> +chmod -st "$BUILDDIR" $BUILDDIR/conf" >>> >> Can we add "|| bbwarn foo" >> >> for cases when it doesn't work for whatever reason or check the >> permissions of these 2 dirs before calling chmod? >> >> ? >>> >>> Cheers, >>> >>> Richard >>> >>> -- >>> _______________________________________________ >>> Openembedded-core mailing list >>> Openembedded-core@lists.openembedded.org >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core >>> >> > [-- Attachment #2: Type: text/html, Size: 3054 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-03 0:57 ` Martin Jansa @ 2015-09-03 20:01 ` Alex Franco 2015-09-03 21:43 ` Martin Jansa 0 siblings, 1 reply; 10+ messages in thread From: Alex Franco @ 2015-09-03 20:01 UTC (permalink / raw) To: Martin Jansa Cc: Christopher Larson, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 2779 bytes --] Hello Martin, so the error you are seeing is related to the chmodding being done in sanity.bbclass, not the chmodding taking place in oe-setup-builddir. I am adding a catch and a warning for that, as I reproduce your setup so I can also reproduce the OSError. Alex On 09/02/2015 07:57 PM, Martin Jansa wrote: > Warning informing that chmod failed is better than fatal error > preventing me to build anything in that setup with tmpfs. > > On Wed, Sep 2, 2015 at 11:27 PM, Alex Franco > <alejandro.franco@linux.intel.com > <mailto:alejandro.franco@linux.intel.com>> wrote: > > Checking may be the better approach, as warning here would do > little more than what the current failure does (informing that > chmod failed) > > Alex Franco > > > On 09/02/2015 01:25 PM, Martin Jansa wrote: > > On Wed, Sep 02, 2015 at 06:51:23PM +0100, Richard Purdie wrote: > > On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: > > Removing recursive option from chmod -st on BUILDDIR > as it would > take very long on existing build directories > > [YOCTO 7669] > > Signed-off-by: Alex Franco > <alejandro.franco@linux.intel.com > <mailto:alejandro.franco@linux.intel.com>> > --- > scripts/oe-setup-builddir | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/oe-setup-builddir > b/scripts/oe-setup-builddir > index f5b7e4e..44c7dcc 100755 > --- a/scripts/oe-setup-builddir > +++ b/scripts/oe-setup-builddir > @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then > fi > mkdir -p "$BUILDDIR/conf" > -chmod -R -st "$BUILDDIR" > +chmod -st "$BUILDDIR" > > I think you did this so that conf/ gets the right > permissions too. > Perhaps the best approach is: > > +chmod -st "$BUILDDIR" $BUILDDIR/conf" > > Can we add "|| bbwarn foo" > > for cases when it doesn't work for whatever reason or check the > permissions of these 2 dirs before calling chmod? > > ? > > Cheers, > > Richard > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > <mailto:Openembedded-core@lists.openembedded.org> > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > [-- Attachment #2: Type: text/html, Size: 6111 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-03 20:01 ` Alex Franco @ 2015-09-03 21:43 ` Martin Jansa 2015-09-03 21:54 ` Alex Franco 0 siblings, 1 reply; 10+ messages in thread From: Martin Jansa @ 2015-09-03 21:43 UTC (permalink / raw) To: Alex Franco Cc: Christopher Larson, Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 3627 bytes --] On Thu, Sep 03, 2015 at 03:01:20PM -0500, Alex Franco wrote: > Hello Martin, so the error you are seeing is related to the chmodding > being done in sanity.bbclass, not the chmodding taking place in > oe-setup-builddir. I am adding a catch and a warning for that, as I > reproduce your setup so I can also reproduce the OSError. Thanks. My point was that even when such setup isn't safe from reasons other people mentioned, the sanity.bbclass shouldn't fail with OSError exception. And as the issue isn't fatal for the build (I was using setup like this for very long time and haven't noticed host-permissions-contamination from this yet), then I would prefer just bbwarn instead of bbfatal - in both cases is should show clear message what's wrong and what user should do about it instead of OSError and user having to read sanity.bbclass to see what and why failed. Regards, > Alex > > On 09/02/2015 07:57 PM, Martin Jansa wrote: > > Warning informing that chmod failed is better than fatal error > > preventing me to build anything in that setup with tmpfs. > > > > On Wed, Sep 2, 2015 at 11:27 PM, Alex Franco > > <alejandro.franco@linux.intel.com > > <mailto:alejandro.franco@linux.intel.com>> wrote: > > > > Checking may be the better approach, as warning here would do > > little more than what the current failure does (informing that > > chmod failed) > > > > Alex Franco > > > > > > On 09/02/2015 01:25 PM, Martin Jansa wrote: > > > > On Wed, Sep 02, 2015 at 06:51:23PM +0100, Richard Purdie wrote: > > > > On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: > > > > Removing recursive option from chmod -st on BUILDDIR > > as it would > > take very long on existing build directories > > > > [YOCTO 7669] > > > > Signed-off-by: Alex Franco > > <alejandro.franco@linux.intel.com > > <mailto:alejandro.franco@linux.intel.com>> > > --- > > scripts/oe-setup-builddir | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scripts/oe-setup-builddir > > b/scripts/oe-setup-builddir > > index f5b7e4e..44c7dcc 100755 > > --- a/scripts/oe-setup-builddir > > +++ b/scripts/oe-setup-builddir > > @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then > > fi > > mkdir -p "$BUILDDIR/conf" > > -chmod -R -st "$BUILDDIR" > > +chmod -st "$BUILDDIR" > > > > I think you did this so that conf/ gets the right > > permissions too. > > Perhaps the best approach is: > > > > +chmod -st "$BUILDDIR" $BUILDDIR/conf" > > > > Can we add "|| bbwarn foo" > > > > for cases when it doesn't work for whatever reason or check the > > permissions of these 2 dirs before calling chmod? > > > > ? > > > > Cheers, > > > > Richard > > > > -- > > _______________________________________________ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > <mailto:Openembedded-core@lists.openembedded.org> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > > > > -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-03 21:43 ` Martin Jansa @ 2015-09-03 21:54 ` Alex Franco 0 siblings, 0 replies; 10+ messages in thread From: Alex Franco @ 2015-09-03 21:54 UTC (permalink / raw) To: Martin Jansa Cc: Christopher Larson, Patches and discussions about the oe-core layer Yes, I agree and in fact the patch is just now shipping Alex Franco On 09/03/2015 04:43 PM, Martin Jansa wrote: > On Thu, Sep 03, 2015 at 03:01:20PM -0500, Alex Franco wrote: >> Hello Martin, so the error you are seeing is related to the chmodding >> being done in sanity.bbclass, not the chmodding taking place in >> oe-setup-builddir. I am adding a catch and a warning for that, as I >> reproduce your setup so I can also reproduce the OSError. > Thanks. > > My point was that even when such setup isn't safe from reasons other > people mentioned, the sanity.bbclass shouldn't fail with OSError > exception. > > And as the issue isn't fatal for the build (I was using setup like this > for very long time and haven't noticed host-permissions-contamination > from this yet), then I would prefer just bbwarn instead of bbfatal - in > both cases is should show clear message what's wrong and what user > should do about it instead of OSError and user having to read > sanity.bbclass to see what and why failed. > > Regards, > >> Alex >> >> On 09/02/2015 07:57 PM, Martin Jansa wrote: >>> Warning informing that chmod failed is better than fatal error >>> preventing me to build anything in that setup with tmpfs. >>> >>> On Wed, Sep 2, 2015 at 11:27 PM, Alex Franco >>> <alejandro.franco@linux.intel.com >>> <mailto:alejandro.franco@linux.intel.com>> wrote: >>> >>> Checking may be the better approach, as warning here would do >>> little more than what the current failure does (informing that >>> chmod failed) >>> >>> Alex Franco >>> >>> >>> On 09/02/2015 01:25 PM, Martin Jansa wrote: >>> >>> On Wed, Sep 02, 2015 at 06:51:23PM +0100, Richard Purdie wrote: >>> >>> On Wed, 2015-09-02 at 11:36 -0500, Alex Franco wrote: >>> >>> Removing recursive option from chmod -st on BUILDDIR >>> as it would >>> take very long on existing build directories >>> >>> [YOCTO 7669] >>> >>> Signed-off-by: Alex Franco >>> <alejandro.franco@linux.intel.com >>> <mailto:alejandro.franco@linux.intel.com>> >>> --- >>> scripts/oe-setup-builddir | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/scripts/oe-setup-builddir >>> b/scripts/oe-setup-builddir >>> index f5b7e4e..44c7dcc 100755 >>> --- a/scripts/oe-setup-builddir >>> +++ b/scripts/oe-setup-builddir >>> @@ -24,7 +24,7 @@ if [ -z "$BUILDDIR" ]; then >>> fi >>> mkdir -p "$BUILDDIR/conf" >>> -chmod -R -st "$BUILDDIR" >>> +chmod -st "$BUILDDIR" >>> >>> I think you did this so that conf/ gets the right >>> permissions too. >>> Perhaps the best approach is: >>> >>> +chmod -st "$BUILDDIR" $BUILDDIR/conf" >>> >>> Can we add "|| bbwarn foo" >>> >>> for cases when it doesn't work for whatever reason or check the >>> permissions of these 2 dirs before calling chmod? >>> >>> ? >>> >>> Cheers, >>> >>> Richard >>> >>> -- >>> _______________________________________________ >>> Openembedded-core mailing list >>> Openembedded-core@lists.openembedded.org >>> <mailto:Openembedded-core@lists.openembedded.org> >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core >>> >>> >>> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-02 16:36 [PATCH] Fix recursive mode -st on BUILDDIR setup Alex Franco 2015-09-02 17:51 ` Richard Purdie @ 2015-09-02 21:47 ` Peter Seebach 2015-09-02 22:28 ` Alex Franco 1 sibling, 1 reply; 10+ messages in thread From: Peter Seebach @ 2015-09-02 21:47 UTC (permalink / raw) To: Alex Franco; +Cc: clarson, openembedded-core On Wed, 2 Sep 2015 11:36:45 -0500 Alex Franco <alejandro.franco@linux.intel.com> wrote: > -chmod -R -st "$BUILDDIR" > +chmod -st "$BUILDDIR" I was about to say! I just did an update to a version with this, and as it happens, my build dir also contains about four full copies of tmp-glibc and sstate-cache corresponding to different versions of pseudo I was comparing between... I'd say maybe both $BUILDDIR and $BUILDDIR/conf. Although it might not be a horrible idea to think about cleaning out sticky bits, because it occurs to me: pseudo is not stripping the set* bits when writing to the filesystem. Which means that a build directory can end up containing files owned by the build user, and setuid, which is maybe a Bad Thing. ... It may be that pseudo should strip those bits from the filesystem. -s -- Listen, get this. Nobody with a good compiler needs to be justified. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Fix recursive mode -st on BUILDDIR setup 2015-09-02 21:47 ` Peter Seebach @ 2015-09-02 22:28 ` Alex Franco 0 siblings, 0 replies; 10+ messages in thread From: Alex Franco @ 2015-09-02 22:28 UTC (permalink / raw) To: Peter Seebach; +Cc: clarson, openembedded-core Yes, it was also suggested to check the directories prior to chmod'ing. But I'm still not so sure about that, or how extensive the checking should be. Perhaps cleaning out sticky bits more extensively could be suggested in the documentation. Alex Franco On 09/02/2015 04:47 PM, Peter Seebach wrote: > On Wed, 2 Sep 2015 11:36:45 -0500 > Alex Franco <alejandro.franco@linux.intel.com> wrote: > >> -chmod -R -st "$BUILDDIR" >> +chmod -st "$BUILDDIR" > I was about to say! I just did an update to a version with this, and as it > happens, my build dir also contains about four full copies of tmp-glibc and > sstate-cache corresponding to different versions of pseudo I was comparing > between... > > I'd say maybe both $BUILDDIR and $BUILDDIR/conf. Although it might not be a > horrible idea to think about cleaning out sticky bits, because it occurs to > me: pseudo is not stripping the set* bits when writing to the filesystem. > Which means that a build directory can end up containing files owned by the > build user, and setuid, which is maybe a Bad Thing. > > ... It may be that pseudo should strip those bits from the filesystem. > > -s ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-09-03 21:54 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-09-02 16:36 [PATCH] Fix recursive mode -st on BUILDDIR setup Alex Franco 2015-09-02 17:51 ` Richard Purdie 2015-09-02 18:25 ` Martin Jansa 2015-09-02 21:27 ` Alex Franco 2015-09-03 0:57 ` Martin Jansa 2015-09-03 20:01 ` Alex Franco 2015-09-03 21:43 ` Martin Jansa 2015-09-03 21:54 ` Alex Franco 2015-09-02 21:47 ` Peter Seebach 2015-09-02 22:28 ` Alex Franco
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox