Patchwork [4/4] initscripts: fix read-only-rootfs-hook.sh to start earlier

login
register
mail settings
Submitter Paul Eggleton
Date April 10, 2013, 3:42 p.m.
Message ID <23e03f4a9118bbae6033f9d88925d6f8b542ee5d.1365608262.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/47837/
State Accepted
Commit cb4db44c14959ca76870cfaf02b5d314ac68ba8f
Headers show

Comments

Paul Eggleton - April 10, 2013, 3:42 p.m.
Mount /var/volatile ourselves so that we can set up the writable area
first. This fixes the urandom service not starting properly when
read-only-rootfs is enabled.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../initscripts/initscripts-1.0/read-only-rootfs-hook.sh             |    1 +
 meta/recipes-core/initscripts/initscripts_1.0.bb                     |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Bernhard Reutner-Fischer - April 11, 2013, 6:29 a.m.
On 10 April 2013 17:42:28 Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> Mount /var/volatile ourselves so that we can set up the writable area
> first. This fixes the urandom service not starting properly when
> read-only-rootfs is enabled.
>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  .../initscripts/initscripts-1.0/read-only-rootfs-hook.sh             |    1 +
>  meta/recipes-core/initscripts/initscripts_1.0.bb                     |    2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git 
> a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh 
> b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> index 4f3e0d9..9cf0921 100644
> --- a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> @@ -5,6 +5,7 @@
>  [ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
>
>  if [ "$1" = "start" ] ; then
> +	grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile

Or just use mountpoint(1)?


Sent with AquaMail for Android
http://www.aqua-mail.com
Paul Eggleton - April 11, 2013, 9:23 a.m.
On Thursday 11 April 2013 08:29:49 Bernhard Reutner-Fischer wrote:
> On 10 April 2013 17:42:28 Paul Eggleton <paul.eggleton@linux.intel.com> 
wrote:
> > Mount /var/volatile ourselves so that we can set up the writable area
> > first. This fixes the urandom service not starting properly when
> > read-only-rootfs is enabled.
> > 
> > Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> > ---
> > 
> >  .../initscripts/initscripts-1.0/read-only-rootfs-hook.sh             |   
> >  1 + meta/recipes-core/initscripts/initscripts_1.0.bb                    
> >  |    2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git
> > a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> > b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> > index 4f3e0d9..9cf0921 100644
> > ---
> > a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> > +++
> > b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
> > @@ -5,6 +5,7 @@
> > 
> >  [ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
> >  
> >  if [ "$1" = "start" ] ; then
> > 
> > +	grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
> 
> Or just use mountpoint(1)?

That would have been a better choice if I had known about it, yes. I'll send a 
patch to change it.

Thanks,
Paul

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
index 4f3e0d9..9cf0921 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -5,6 +5,7 @@ 
 [ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
 
 if [ "$1" = "start" ] ; then
+	grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
 	mkdir -p /var/volatile/lib
 	cp -a /var/lib/* /var/volatile/lib
 	mount --bind /var/volatile/lib /var/lib
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 649e182..531b2b6 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -118,7 +118,7 @@  do_install () {
 	update-rc.d -r ${D} bootmisc.sh start 55 S .
 	update-rc.d -r ${D} sysfs.sh start 02 S .
 	update-rc.d -r ${D} populate-volatile.sh start 37 S .
-	update-rc.d -r ${D} read-only-rootfs-hook.sh start 41 S .
+	update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S .
 	update-rc.d -r ${D} devpts.sh start 38 S .
 	if [ "${TARGET_ARCH}" = "arm" ]; then
 	        update-rc.d -r ${D} alignment.sh start 06 S .