All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] udev-cache: take a read-only rootfs into consideration
@ 2013-06-28  5:00 Qi.Chen
  2013-06-28  5:00 ` [PATCH 1/1] " Qi.Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Qi.Chen @ 2013-06-28  5:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: qingtao.cao

From: Chen Qi <Qi.Chen@windriver.com>

The following changes since commit 042203531b10b37ac9a8201b376f5dec403e51d8:

  sanity.bbclass: Fix COREBASE sanity tests (2013-06-27 12:48:56 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/udev-cache-readonly
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/udev-cache-readonly

Chen Qi (1):
  udev-cache: take a read-only rootfs into consideration

 meta/recipes-core/udev/udev/init       |    5 +++--
 meta/recipes-core/udev/udev/udev-cache |    6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] udev-cache: take a read-only rootfs into consideration
  2013-06-28  5:00 [PATCH 0/1] udev-cache: take a read-only rootfs into consideration Qi.Chen
@ 2013-06-28  5:00 ` Qi.Chen
  2013-06-28  5:59   ` Saul Wold
  0 siblings, 1 reply; 4+ messages in thread
From: Qi.Chen @ 2013-06-28  5:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: qingtao.cao

From: Chen Qi <Qi.Chen@windriver.com>

In case of a read-only rootfs, no matter the /etc is read-only or
it's bind mounted with tmpfs, the udev cache handling should be
skipped, as the data cannot be persisted between reboots.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/udev/udev/init       |    5 +++--
 meta/recipes-core/udev/udev/udev-cache |    6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index 9b81700..38ea666 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -18,6 +18,7 @@ export TZ=/etc/localtime
 [ -x @UDEVD@ ] || exit 1
 [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
 [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 
 readfile () {
    filename=$1
@@ -52,8 +53,8 @@ case "$1" in
     mount -a -t tmpfs 2>/dev/null
     mkdir -p /var/volatile/tmp
 
-    # cache handling
-    if [ "$DEVCACHE" != "" ]; then
+    # Cache handling. Skip cache handling in case of a read-only rootfs.
+    if [ "$ROOTFS_READ_ONLY" = "no" -a "$DEVCACHE" != "" ]; then
             readfile /proc/version
             VERSION="$READDATA"
             readfile /proc/cmdline
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index 8a84fa9..3e0eff6 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -15,8 +15,14 @@ export TZ=/etc/localtime
 [ -x @UDEVD@ ] || exit 1
 [ -d /sys/class ] || exit 1
 
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
 
+if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
+    [ "$VERBOSE" != "no" ] && echo "read-only rootfs, skip udev-cache"
+    exit 0
+fi
+
 if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
 	echo "Populating dev cache"
 	(cd /; tar cf "$DEVCACHE" dev)
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] udev-cache: take a read-only rootfs into consideration
  2013-06-28  5:00 ` [PATCH 1/1] " Qi.Chen
@ 2013-06-28  5:59   ` Saul Wold
  2013-06-28  6:21     ` ChenQi
  0 siblings, 1 reply; 4+ messages in thread
From: Saul Wold @ 2013-06-28  5:59 UTC (permalink / raw)
  To: Qi.Chen; +Cc: qingtao.cao, openembedded-core

On 06/27/2013 10:00 PM, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> In case of a read-only rootfs, no matter the /etc is read-only or
> it's bind mounted with tmpfs, the udev cache handling should be
> skipped, as the data cannot be persisted between reboots.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/recipes-core/udev/udev/init       |    5 +++--
>   meta/recipes-core/udev/udev/udev-cache |    6 ++++++
>   2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
> index 9b81700..38ea666 100644
> --- a/meta/recipes-core/udev/udev/init
> +++ b/meta/recipes-core/udev/udev/init
> @@ -18,6 +18,7 @@ export TZ=/etc/localtime
>   [ -x @UDEVD@ ] || exit 1
>   [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
>   [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
> +[ -f /etc/default/rcS ] && . /etc/default/rcS
>
>   readfile () {
>      filename=$1
> @@ -52,8 +53,8 @@ case "$1" in
>       mount -a -t tmpfs 2>/dev/null
>       mkdir -p /var/volatile/tmp
>
> -    # cache handling
> -    if [ "$DEVCACHE" != "" ]; then
> +    # Cache handling. Skip cache handling in case of a read-only rootfs.
> +    if [ "$ROOTFS_READ_ONLY" = "no" -a "$DEVCACHE" != "" ]; then
>               readfile /proc/version
>               VERSION="$READDATA"
>               readfile /proc/cmdline
Do you think it would be possible in a fix embedded device to have the 
udev cache created and installed in a read-only FS?

Sau!

> diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
> index 8a84fa9..3e0eff6 100644
> --- a/meta/recipes-core/udev/udev/udev-cache
> +++ b/meta/recipes-core/udev/udev/udev-cache
> @@ -15,8 +15,14 @@ export TZ=/etc/localtime
>   [ -x @UDEVD@ ] || exit 1
>   [ -d /sys/class ] || exit 1
>
> +[ -f /etc/default/rcS ] && . /etc/default/rcS
>   [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
>
> +if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
> +    [ "$VERBOSE" != "no" ] && echo "read-only rootfs, skip udev-cache"
> +    exit 0
> +fi
> +
>   if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
>   	echo "Populating dev cache"
>   	(cd /; tar cf "$DEVCACHE" dev)
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] udev-cache: take a read-only rootfs into consideration
  2013-06-28  5:59   ` Saul Wold
@ 2013-06-28  6:21     ` ChenQi
  0 siblings, 0 replies; 4+ messages in thread
From: ChenQi @ 2013-06-28  6:21 UTC (permalink / raw)
  To: Saul Wold; +Cc: qingtao.cao, openembedded-core

On 06/28/2013 01:59 PM, Saul Wold wrote:
> On 06/27/2013 10:00 PM, Qi.Chen@windriver.com wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> In case of a read-only rootfs, no matter the /etc is read-only or
>> it's bind mounted with tmpfs, the udev cache handling should be
>> skipped, as the data cannot be persisted between reboots.
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/recipes-core/udev/udev/init       |    5 +++--
>>   meta/recipes-core/udev/udev/udev-cache |    6 ++++++
>>   2 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-core/udev/udev/init 
>> b/meta/recipes-core/udev/udev/init
>> index 9b81700..38ea666 100644
>> --- a/meta/recipes-core/udev/udev/init
>> +++ b/meta/recipes-core/udev/udev/init
>> @@ -18,6 +18,7 @@ export TZ=/etc/localtime
>>   [ -x @UDEVD@ ] || exit 1
>>   [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
>>   [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
>> +[ -f /etc/default/rcS ] && . /etc/default/rcS
>>
>>   readfile () {
>>      filename=$1
>> @@ -52,8 +53,8 @@ case "$1" in
>>       mount -a -t tmpfs 2>/dev/null
>>       mkdir -p /var/volatile/tmp
>>
>> -    # cache handling
>> -    if [ "$DEVCACHE" != "" ]; then
>> +    # Cache handling. Skip cache handling in case of a read-only 
>> rootfs.
>> +    if [ "$ROOTFS_READ_ONLY" = "no" -a "$DEVCACHE" != "" ]; then
>>               readfile /proc/version
>>               VERSION="$READDATA"
>>               readfile /proc/cmdline
> Do you think it would be possible in a fix embedded device to have the 
> udev cache created and installed in a read-only FS?
>
> Sau!
>
Thanks for pointing it out.
Yes, you're right.
No matter how the cache is installed, if the $DEVCACHE file exists and 
the $READDATA matches, we could use the cache.
I'll send out a V2.

//Chen Qi

>> diff --git a/meta/recipes-core/udev/udev/udev-cache 
>> b/meta/recipes-core/udev/udev/udev-cache
>> index 8a84fa9..3e0eff6 100644
>> --- a/meta/recipes-core/udev/udev/udev-cache
>> +++ b/meta/recipes-core/udev/udev/udev-cache
>> @@ -15,8 +15,14 @@ export TZ=/etc/localtime
>>   [ -x @UDEVD@ ] || exit 1
>>   [ -d /sys/class ] || exit 1
>>
>> +[ -f /etc/default/rcS ] && . /etc/default/rcS
>>   [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
>>
>> +if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
>> +    [ "$VERBOSE" != "no" ] && echo "read-only rootfs, skip udev-cache"
>> +    exit 0
>> +fi
>> +
>>   if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
>>       echo "Populating dev cache"
>>       (cd /; tar cf "$DEVCACHE" dev)
>>
>
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-28  6:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28  5:00 [PATCH 0/1] udev-cache: take a read-only rootfs into consideration Qi.Chen
2013-06-28  5:00 ` [PATCH 1/1] " Qi.Chen
2013-06-28  5:59   ` Saul Wold
2013-06-28  6:21     ` ChenQi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.