Patchwork [1/1] hwclock.sh: check for the existence of /etc/default/rcS

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Feb. 19, 2013, 7:59 a.m.
Message ID <6c5df3ee0d370bc7054d53832937ce70b6c9ee57.1361260478.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/44833/
State Accepted
Commit b1c887277c67a9a0fb08162edc4cc9aeeb8f400d
Headers show

Comments

Qi.Chen@windriver.com - Feb. 19, 2013, 7:59 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

/etc/default/rcS might be missing if the init manager is not sysvinit.
So we have to check for the existence of this file before sourcing it.

[YOCTO #3697]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/files/hwclock.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Bernhard Reutner-Fischer - Feb. 19, 2013, 11:10 a.m.
On 19 February 2013 08:59,  <Qi.Chen@windriver.com> wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> /etc/default/rcS might be missing if the init manager is not sysvinit.
> So we have to check for the existence of this file before sourcing it.
>
> [YOCTO #3697]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/recipes-core/busybox/files/hwclock.sh |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
> index cc6d286..be5f94d 100644
> --- a/meta/recipes-core/busybox/files/hwclock.sh
> +++ b/meta/recipes-core/busybox/files/hwclock.sh
> @@ -20,7 +20,7 @@
>
>  [ ! -x /sbin/hwclock ] && exit 0
>
> -. /etc/default/rcS
> +[ -f /etc/default/rcS ] && . /etc/default/rcS

I'd make that -r fwiw.
Qi.Chen@windriver.com - Feb. 20, 2013, 5:58 a.m.
On 02/19/2013 07:10 PM, Bernhard Reutner-Fischer wrote:
> On 19 February 2013 08:59,  <Qi.Chen@windriver.com> wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> /etc/default/rcS might be missing if the init manager is not sysvinit.
>> So we have to check for the existence of this file before sourcing it.
>>
>> [YOCTO #3697]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/recipes-core/busybox/files/hwclock.sh |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
>> index cc6d286..be5f94d 100644
>> --- a/meta/recipes-core/busybox/files/hwclock.sh
>> +++ b/meta/recipes-core/busybox/files/hwclock.sh
>> @@ -20,7 +20,7 @@
>>
>>   [ ! -x /sbin/hwclock ] && exit 0
>>
>> -. /etc/default/rcS
>> +[ -f /etc/default/rcS ] && . /etc/default/rcS
> I'd make that -r fwiw.
>
>
Thank you for your review.
In this case, I think they have the same effect.

Best Regards,
Chen Qi

Patch

diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
index cc6d286..be5f94d 100644
--- a/meta/recipes-core/busybox/files/hwclock.sh
+++ b/meta/recipes-core/busybox/files/hwclock.sh
@@ -20,7 +20,7 @@ 
 
 [ ! -x /sbin/hwclock ] && exit 0
 
-. /etc/default/rcS
+[ -f /etc/default/rcS ] && . /etc/default/rcS
 
 [ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime"
 case "$1" in