* [PATCH 0/1] sstate.bbclass: update the timestamps after install @ 2014-09-04 7:05 Robert Yang 2014-09-04 7:05 ` [PATCH 1/1] " Robert Yang 0 siblings, 1 reply; 9+ messages in thread From: Robert Yang @ 2014-09-04 7:05 UTC (permalink / raw) To: openembedded-core The following changes since commit 4c0a9ccbad2889b27b4b1d2ab91215a4bdcca3ce: python-numpy: Fix build for mips64 (2014-09-01 18:00:32 +0100) are available in the git repository at: git://git.openembedded.org/openembedded-core-contrib rbt/ss http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/ss Robert Yang (1): sstate.bbclass: update the timestamps after install meta/classes/sstate.bbclass | 1 + 1 file changed, 1 insertion(+) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 7:05 [PATCH 0/1] sstate.bbclass: update the timestamps after install Robert Yang @ 2014-09-04 7:05 ` Robert Yang 2014-09-04 8:27 ` Richard Purdie 0 siblings, 1 reply; 9+ messages in thread From: Robert Yang @ 2014-09-04 7:05 UTC (permalink / raw) To: openembedded-core Update the sstate file's timestamps after it is installed, it will be very useful for removing the old sstate file, especially, it's not easy to remove when use the shared SSTATE_DIR, we can easily remove them with this change, for example: $ find state-cache -type f -ctime +10 -exec rm -f {} \; Will remove the sstate file which isn't used by recent 10 days. We can use the -atime, but it is not always available, for example, when mounted with "-o noatime". The touch is a very light weight action, and the scripts/sstate-cache-management.sh also requires this. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- meta/classes/sstate.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index ead829e..885912d 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -618,6 +618,7 @@ sstate_unpack_package () { mkdir -p ${SSTATE_INSTDIR} cd ${SSTATE_INSTDIR} tar -xmvzf ${SSTATE_PKG} + touch --no-dereference ${SSTATE_PKG} } BB_HASHCHECK_FUNCTION = "sstate_checkhashes" -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 7:05 ` [PATCH 1/1] " Robert Yang @ 2014-09-04 8:27 ` Richard Purdie 2014-09-04 8:49 ` Robert Yang 0 siblings, 1 reply; 9+ messages in thread From: Richard Purdie @ 2014-09-04 8:27 UTC (permalink / raw) To: Robert Yang; +Cc: openembedded-core On Thu, 2014-09-04 at 00:05 -0700, Robert Yang wrote: > Update the sstate file's timestamps after it is installed, it will be > very useful for removing the old sstate file, especially, it's not easy > to remove when use the shared SSTATE_DIR, we can easily remove them with > this change, for example: > > $ find state-cache -type f -ctime +10 -exec rm -f {} \; > > Will remove the sstate file which isn't used by recent 10 days. > > We can use the -atime, but it is not always available, for example, > when mounted with "-o noatime". > > The touch is a very light weight action, and the > scripts/sstate-cache-management.sh also requires this. > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > --- > meta/classes/sstate.bbclass | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass > index ead829e..885912d 100644 > --- a/meta/classes/sstate.bbclass > +++ b/meta/classes/sstate.bbclass > @@ -618,6 +618,7 @@ sstate_unpack_package () { > mkdir -p ${SSTATE_INSTDIR} > cd ${SSTATE_INSTDIR} > tar -xmvzf ${SSTATE_PKG} > + touch --no-dereference ${SSTATE_PKG} > } > > BB_HASHCHECK_FUNCTION = "sstate_checkhashes" At the very least we need to consider read only files here... Cheers, Richard ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 8:27 ` Richard Purdie @ 2014-09-04 8:49 ` Robert Yang 2014-09-04 8:53 ` Richard Purdie 0 siblings, 1 reply; 9+ messages in thread From: Robert Yang @ 2014-09-04 8:49 UTC (permalink / raw) To: Richard Purdie; +Cc: openembedded-core On 09/04/2014 04:27 PM, Richard Purdie wrote: > On Thu, 2014-09-04 at 00:05 -0700, Robert Yang wrote: >> Update the sstate file's timestamps after it is installed, it will be >> very useful for removing the old sstate file, especially, it's not easy >> to remove when use the shared SSTATE_DIR, we can easily remove them with >> this change, for example: >> >> $ find state-cache -type f -ctime +10 -exec rm -f {} \; >> >> Will remove the sstate file which isn't used by recent 10 days. >> >> We can use the -atime, but it is not always available, for example, >> when mounted with "-o noatime". >> >> The touch is a very light weight action, and the >> scripts/sstate-cache-management.sh also requires this. >> >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> >> --- >> meta/classes/sstate.bbclass | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass >> index ead829e..885912d 100644 >> --- a/meta/classes/sstate.bbclass >> +++ b/meta/classes/sstate.bbclass >> @@ -618,6 +618,7 @@ sstate_unpack_package () { >> mkdir -p ${SSTATE_INSTDIR} >> cd ${SSTATE_INSTDIR} >> tar -xmvzf ${SSTATE_PKG} >> + touch --no-dereference ${SSTATE_PKG} >> } >> >> BB_HASHCHECK_FUNCTION = "sstate_checkhashes" > > At the very least we need to consider read only files here... Hello, did you mean the SSTATE_MIRRORS ? I thought that I had considered it since I used the "touch --no-dereference", make a clear check is reasonable if I understand correctly, so updated the code in the repo: (The --no-dereference is not need any more since the "test -w" follows symlink). diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index ead829e..7cb43b1 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -618,6 +618,8 @@ sstate_unpack_package () { mkdir -p ${SSTATE_INSTDIR} cd ${SSTATE_INSTDIR} tar -xmvzf ${SSTATE_PKG} + # Use "! test -w ||" to return true for read only files + [ ! test -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} } // Robert > > Cheers, > > Richard > > > ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 8:49 ` Robert Yang @ 2014-09-04 8:53 ` Richard Purdie 2014-09-04 10:27 ` Robert Yang 0 siblings, 1 reply; 9+ messages in thread From: Richard Purdie @ 2014-09-04 8:53 UTC (permalink / raw) To: Robert Yang; +Cc: openembedded-core On Thu, 2014-09-04 at 16:49 +0800, Robert Yang wrote: > > On 09/04/2014 04:27 PM, Richard Purdie wrote: > > On Thu, 2014-09-04 at 00:05 -0700, Robert Yang wrote: > >> Update the sstate file's timestamps after it is installed, it will be > >> very useful for removing the old sstate file, especially, it's not easy > >> to remove when use the shared SSTATE_DIR, we can easily remove them with > >> this change, for example: > >> > >> $ find state-cache -type f -ctime +10 -exec rm -f {} \; > >> > >> Will remove the sstate file which isn't used by recent 10 days. > >> > >> We can use the -atime, but it is not always available, for example, > >> when mounted with "-o noatime". > >> > >> The touch is a very light weight action, and the > >> scripts/sstate-cache-management.sh also requires this. > >> > >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > >> --- > >> meta/classes/sstate.bbclass | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass > >> index ead829e..885912d 100644 > >> --- a/meta/classes/sstate.bbclass > >> +++ b/meta/classes/sstate.bbclass > >> @@ -618,6 +618,7 @@ sstate_unpack_package () { > >> mkdir -p ${SSTATE_INSTDIR} > >> cd ${SSTATE_INSTDIR} > >> tar -xmvzf ${SSTATE_PKG} > >> + touch --no-dereference ${SSTATE_PKG} > >> } > >> > >> BB_HASHCHECK_FUNCTION = "sstate_checkhashes" > > > > At the very least we need to consider read only files here... > > Hello, did you mean the SSTATE_MIRRORS ? I thought that I had > considered it since I used the "touch --no-dereference", > make a clear check is reasonable if I understand correctly, > so updated the code in the repo: (The --no-dereference is not > need any more since the "test -w" follows symlink). We need the --no-dereferece but this could also be a readonly directory or set of readonly files (think an ISO shipped with WR Linux or locked sstate cache). Cheers, Richard ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 8:53 ` Richard Purdie @ 2014-09-04 10:27 ` Robert Yang 2014-09-04 10:29 ` Robert Yang 2014-09-24 22:37 ` Burton, Ross 0 siblings, 2 replies; 9+ messages in thread From: Robert Yang @ 2014-09-04 10:27 UTC (permalink / raw) To: Richard Purdie; +Cc: openembedded-core On 09/04/2014 04:53 PM, Richard Purdie wrote: > On Thu, 2014-09-04 at 16:49 +0800, Robert Yang wrote: >> >> On 09/04/2014 04:27 PM, Richard Purdie wrote: >>> On Thu, 2014-09-04 at 00:05 -0700, Robert Yang wrote: >>>> Update the sstate file's timestamps after it is installed, it will be >>>> very useful for removing the old sstate file, especially, it's not easy >>>> to remove when use the shared SSTATE_DIR, we can easily remove them with >>>> this change, for example: >>>> >>>> $ find state-cache -type f -ctime +10 -exec rm -f {} \; >>>> >>>> Will remove the sstate file which isn't used by recent 10 days. >>>> >>>> We can use the -atime, but it is not always available, for example, >>>> when mounted with "-o noatime". >>>> >>>> The touch is a very light weight action, and the >>>> scripts/sstate-cache-management.sh also requires this. >>>> >>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> >>>> --- >>>> meta/classes/sstate.bbclass | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass >>>> index ead829e..885912d 100644 >>>> --- a/meta/classes/sstate.bbclass >>>> +++ b/meta/classes/sstate.bbclass >>>> @@ -618,6 +618,7 @@ sstate_unpack_package () { >>>> mkdir -p ${SSTATE_INSTDIR} >>>> cd ${SSTATE_INSTDIR} >>>> tar -xmvzf ${SSTATE_PKG} >>>> + touch --no-dereference ${SSTATE_PKG} >>>> } >>>> >>>> BB_HASHCHECK_FUNCTION = "sstate_checkhashes" >>> >>> At the very least we need to consider read only files here... >> >> Hello, did you mean the SSTATE_MIRRORS ? I thought that I had >> considered it since I used the "touch --no-dereference", >> make a clear check is reasonable if I understand correctly, >> so updated the code in the repo: (The --no-dereference is not >> need any more since the "test -w" follows symlink). > > We need the --no-dereferece but this could also be a readonly directory Under more thoughts, yes, we need the --no-dereferece otherwise the touch may update the file in the SSTATE_MIRRORS, and it's safe to touch a symlink itself (though "test -w" follows symlink) since the permissions of symbolic links are never used. For readonly_dir/ssfile, we can touch the ssfile if "test -w ssfile", it doesn't care about the dir's write permission. Or do we have to check the permission of "dirname ${SSTATE_PKG}" and ${SSTATE_DIR} ? I don't think that we need unless it causes errors. For the ISO, the "test -w {SSTATE_PKG}" would fail so that no touch, here is the updated code, also in the repo: diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index ead829e..78766c0 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -618,6 +618,8 @@ sstate_unpack_package () { mkdir -p ${SSTATE_INSTDIR} cd ${SSTATE_INSTDIR} tar -xmvzf ${SSTATE_PKG} + # Use "! -w ||" to return true for read only files + [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} } // Robert > or set of readonly files (think an ISO shipped with WR Linux or locked > sstate cache). > > Cheers, > > Richard > > > ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 10:27 ` Robert Yang @ 2014-09-04 10:29 ` Robert Yang 2014-09-24 22:37 ` Burton, Ross 1 sibling, 0 replies; 9+ messages in thread From: Robert Yang @ 2014-09-04 10:29 UTC (permalink / raw) To: Richard Purdie; +Cc: openembedded-core On 09/04/2014 06:27 PM, Robert Yang wrote: > > > On 09/04/2014 04:53 PM, Richard Purdie wrote: >> On Thu, 2014-09-04 at 16:49 +0800, Robert Yang wrote: >>> >>> On 09/04/2014 04:27 PM, Richard Purdie wrote: >>>> On Thu, 2014-09-04 at 00:05 -0700, Robert Yang wrote: >>>>> Update the sstate file's timestamps after it is installed, it will be >>>>> very useful for removing the old sstate file, especially, it's not easy >>>>> to remove when use the shared SSTATE_DIR, we can easily remove them with >>>>> this change, for example: >>>>> >>>>> $ find state-cache -type f -ctime +10 -exec rm -f {} \; >>>>> >>>>> Will remove the sstate file which isn't used by recent 10 days. >>>>> >>>>> We can use the -atime, but it is not always available, for example, >>>>> when mounted with "-o noatime". >>>>> >>>>> The touch is a very light weight action, and the >>>>> scripts/sstate-cache-management.sh also requires this. >>>>> >>>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> >>>>> --- >>>>> meta/classes/sstate.bbclass | 1 + >>>>> 1 file changed, 1 insertion(+) >>>>> >>>>> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass >>>>> index ead829e..885912d 100644 >>>>> --- a/meta/classes/sstate.bbclass >>>>> +++ b/meta/classes/sstate.bbclass >>>>> @@ -618,6 +618,7 @@ sstate_unpack_package () { >>>>> mkdir -p ${SSTATE_INSTDIR} >>>>> cd ${SSTATE_INSTDIR} >>>>> tar -xmvzf ${SSTATE_PKG} >>>>> + touch --no-dereference ${SSTATE_PKG} >>>>> } >>>>> >>>>> BB_HASHCHECK_FUNCTION = "sstate_checkhashes" >>>> >>>> At the very least we need to consider read only files here... >>> >>> Hello, did you mean the SSTATE_MIRRORS ? I thought that I had >>> considered it since I used the "touch --no-dereference", >>> make a clear check is reasonable if I understand correctly, >>> so updated the code in the repo: (The --no-dereference is not >>> need any more since the "test -w" follows symlink). >> >> We need the --no-dereferece but this could also be a readonly directory > > Under more thoughts, yes, we need the --no-dereferece otherwise the s/Under/After/ // Robert > touch may update the file in the SSTATE_MIRRORS, and it's safe to touch > a symlink itself (though "test -w" follows symlink) since the permissions > of symbolic links are never used. > > For readonly_dir/ssfile, we can touch the ssfile if "test -w ssfile", > it doesn't care about the dir's write permission. Or do we have to > check the permission of "dirname ${SSTATE_PKG}" and ${SSTATE_DIR} ? > I don't think that we need unless it causes errors. > > For the ISO, the "test -w {SSTATE_PKG}" would fail so that no touch, > here is the updated code, also in the repo: > > diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass > index ead829e..78766c0 100644 > --- a/meta/classes/sstate.bbclass > +++ b/meta/classes/sstate.bbclass > @@ -618,6 +618,8 @@ sstate_unpack_package () { > mkdir -p ${SSTATE_INSTDIR} > cd ${SSTATE_INSTDIR} > tar -xmvzf ${SSTATE_PKG} > + # Use "! -w ||" to return true for read only files > + [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} > } > > // Robert > >> or set of readonly files (think an ISO shipped with WR Linux or locked >> sstate cache). >> >> Cheers, >> >> Richard >> >> >> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-04 10:27 ` Robert Yang 2014-09-04 10:29 ` Robert Yang @ 2014-09-24 22:37 ` Burton, Ross 2014-09-25 2:32 ` Robert Yang 1 sibling, 1 reply; 9+ messages in thread From: Burton, Ross @ 2014-09-24 22:37 UTC (permalink / raw) To: Robert Yang; +Cc: OE-core Hi Robert, On 4 September 2014 11:27, Robert Yang <liezhi.yang@windriver.com> wrote: > Under more thoughts, yes, we need the --no-dereferece otherwise the > touch may update the file in the SSTATE_MIRRORS, and it's safe to touch > a symlink itself (though "test -w" follows symlink) since the permissions > of symbolic links are never used. > > For readonly_dir/ssfile, we can touch the ssfile if "test -w ssfile", > it doesn't care about the dir's write permission. Or do we have to > check the permission of "dirname ${SSTATE_PKG}" and ${SSTATE_DIR} ? > I don't think that we need unless it causes errors. > > For the ISO, the "test -w {SSTATE_PKG}" would fail so that no touch, > here is the updated code, also in the repo: Can you update this patch with --no-dereference please, or have I misunderstood the conversation? Ross ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sstate.bbclass: update the timestamps after install 2014-09-24 22:37 ` Burton, Ross @ 2014-09-25 2:32 ` Robert Yang 0 siblings, 0 replies; 9+ messages in thread From: Robert Yang @ 2014-09-25 2:32 UTC (permalink / raw) To: Burton, Ross; +Cc: OE-core On 09/25/2014 06:37 AM, Burton, Ross wrote: > Hi Robert, > > On 4 September 2014 11:27, Robert Yang <liezhi.yang@windriver.com> wrote: >> Under more thoughts, yes, we need the --no-dereferece otherwise the >> touch may update the file in the SSTATE_MIRRORS, and it's safe to touch >> a symlink itself (though "test -w" follows symlink) since the permissions >> of symbolic links are never used. >> >> For readonly_dir/ssfile, we can touch the ssfile if "test -w ssfile", >> it doesn't care about the dir's write permission. Or do we have to >> check the permission of "dirname ${SSTATE_PKG}" and ${SSTATE_DIR} ? >> I don't think that we need unless it causes errors. >> >> For the ISO, the "test -w {SSTATE_PKG}" would fail so that no touch, >> here is the updated code, also in the repo: > > Can you update this patch with --no-dereference please, or have I > misunderstood the conversation? Thanks, updated: git://git.openembedded.org/openembedded-core-contrib rbt/ss diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 4057c8c..552ff8d 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -623,6 +623,8 @@ sstate_unpack_package () { mkdir -p ${SSTATE_INSTDIR} cd ${SSTATE_INSTDIR} tar -xmvzf ${SSTATE_PKG} + # Use "! -w ||" to return true for read only files + [ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG} } // Robert > > Ross > > ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-09-25 2:32 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-04 7:05 [PATCH 0/1] sstate.bbclass: update the timestamps after install Robert Yang 2014-09-04 7:05 ` [PATCH 1/1] " Robert Yang 2014-09-04 8:27 ` Richard Purdie 2014-09-04 8:49 ` Robert Yang 2014-09-04 8:53 ` Richard Purdie 2014-09-04 10:27 ` Robert Yang 2014-09-04 10:29 ` Robert Yang 2014-09-24 22:37 ` Burton, Ross 2014-09-25 2:32 ` Robert Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox