Patchwork [V6,6/6] core-image-sato: support read-only rootfs

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Jan. 6, 2013, 9:44 a.m.
Message ID <c8df96d897ecdf4fe04088aff1eba2fbfb0c004a.1357465230.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/42093/
State New
Headers show

Comments

Qi.Chen@windriver.com - Jan. 6, 2013, 9:44 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

Support read-only rootfs by providing a specific conf file for volatile storage.

[YOCTO #3406]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-sato/images/core-image-sato.bb        |    8 ++++++++
 .../images/files/volatiles-readonly-sato           |   14 ++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 meta/recipes-sato/images/files/volatiles-readonly-sato
Otavio Salvador - Jan. 6, 2013, 7:05 p.m.
On Sun, Jan 6, 2013 at 7:44 AM,  <Qi.Chen@windriver.com> wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Support read-only rootfs by providing a specific conf file for volatile storage.
>
> [YOCTO #3406]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

I prefer this solution than the previous one however why you don't use
a sato-volatile-conf package to provide this?

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
Qi.Chen@windriver.com - Jan. 7, 2013, 3:06 a.m.
On 01/07/2013 03:05 AM, Otavio Salvador wrote:
> On Sun, Jan 6, 2013 at 7:44 AM,  <Qi.Chen@windriver.com> wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> Support read-only rootfs by providing a specific conf file for volatile storage.
>>
>> [YOCTO #3406]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> I prefer this solution than the previous one however why you don't use
> a sato-volatile-conf package to provide this?
Because the there exists a one-to-one (or almost one-to-one) 
correspondence between the volatile conf file and the specific image.

If there is a 'sato-volatile-conf' package, then there should be a 
'minimal-volatile-conf', and maybe a 'custom-volatile-conf' if users are 
using a customized image.

So I think it's simpler to let the image recipe provide the conf file.
The only thing we have to do, when adding read-only rootfs support to 
some image, is to add the conf file to SRC_URI and install it in 
choose_volatile_conf.

Kind Regards,
Chen Qi
>
> --
> Otavio Salvador                             O.S. Systems
> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
>
>
Otavio Salvador - Jan. 7, 2013, 10:30 a.m.
On Mon, Jan 7, 2013 at 1:06 AM, ChenQi <Qi.Chen@windriver.com> wrote:
> On 01/07/2013 03:05 AM, Otavio Salvador wrote:
>>
>> On Sun, Jan 6, 2013 at 7:44 AM,  <Qi.Chen@windriver.com> wrote:
>>>
>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>
>>> Support read-only rootfs by providing a specific conf file for volatile
>>> storage.
>>>
>>> [YOCTO #3406]
>>>
>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>
>> I prefer this solution than the previous one however why you don't use
>> a sato-volatile-conf package to provide this?
>
> Because the there exists a one-to-one (or almost one-to-one) correspondence
> between the volatile conf file and the specific image.
>
> If there is a 'sato-volatile-conf' package, then there should be a
> 'minimal-volatile-conf', and maybe a 'custom-volatile-conf' if users are
> using a customized image.
>
> So I think it's simpler to let the image recipe provide the conf file.
> The only thing we have to do, when adding read-only rootfs support to some
> image, is to add the conf file to SRC_URI and install it in
> choose_volatile_conf.

The problem of not using a package for it is regarding upgrades; it is
not possible to upgrade the configuration file using the package
manager. I know most systems using the read-only-fs will be small and
do not use a package manager at all but some use cases will do (mine,
in case).

So I do believe we ought to have a one-to-one correspondence here.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
Qi.Chen@windriver.com - Jan. 8, 2013, 2:22 a.m.
On 01/07/2013 06:30 PM, Otavio Salvador wrote:
> On Mon, Jan 7, 2013 at 1:06 AM, ChenQi <Qi.Chen@windriver.com> wrote:
>> On 01/07/2013 03:05 AM, Otavio Salvador wrote:
>>> On Sun, Jan 6, 2013 at 7:44 AM,  <Qi.Chen@windriver.com> wrote:
>>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>>
>>>> Support read-only rootfs by providing a specific conf file for volatile
>>>> storage.
>>>>
>>>> [YOCTO #3406]
>>>>
>>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>> I prefer this solution than the previous one however why you don't use
>>> a sato-volatile-conf package to provide this?
>> Because the there exists a one-to-one (or almost one-to-one) correspondence
>> between the volatile conf file and the specific image.
>>
>> If there is a 'sato-volatile-conf' package, then there should be a
>> 'minimal-volatile-conf', and maybe a 'custom-volatile-conf' if users are
>> using a customized image.
>>
>> So I think it's simpler to let the image recipe provide the conf file.
>> The only thing we have to do, when adding read-only rootfs support to some
>> image, is to add the conf file to SRC_URI and install it in
>> choose_volatile_conf.
> The problem of not using a package for it is regarding upgrades; it is
> not possible to upgrade the configuration file using the package
> manager. I know most systems using the read-only-fs will be small and
> do not use a package manager at all but some use cases will do (mine,
> in case).
Sounds reasonable.
I'll think about it :)

Thanks,
Chen Qi

> So I do believe we ought to have a one-to-one correspondence here.
>
> --
> Otavio Salvador                             O.S. Systems
> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
>
>
Saul Wold - Jan. 11, 2013, 11:32 p.m.
On 01/07/2013 06:22 PM, ChenQi wrote:
> On 01/07/2013 06:30 PM, Otavio Salvador wrote:
>> On Mon, Jan 7, 2013 at 1:06 AM, ChenQi <Qi.Chen@windriver.com> wrote:
>>> On 01/07/2013 03:05 AM, Otavio Salvador wrote:
>>>> On Sun, Jan 6, 2013 at 7:44 AM,  <Qi.Chen@windriver.com> wrote:
>>>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>>>
>>>>> Support read-only rootfs by providing a specific conf file for
>>>>> volatile
>>>>> storage.
>>>>>
>>>>> [YOCTO #3406]
>>>>>
>>>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>>> I prefer this solution than the previous one however why you don't use
>>>> a sato-volatile-conf package to provide this?
>>> Because the there exists a one-to-one (or almost one-to-one)
>>> correspondence
>>> between the volatile conf file and the specific image.
>>>
>>> If there is a 'sato-volatile-conf' package, then there should be a
>>> 'minimal-volatile-conf', and maybe a 'custom-volatile-conf' if users are
>>> using a customized image.
>>>
>>> So I think it's simpler to let the image recipe provide the conf file.
>>> The only thing we have to do, when adding read-only rootfs support to
>>> some
>>> image, is to add the conf file to SRC_URI and install it in
>>> choose_volatile_conf.
>> The problem of not using a package for it is regarding upgrades; it is
>> not possible to upgrade the configuration file using the package
>> manager. I know most systems using the read-only-fs will be small and
>> do not use a package manager at all but some use cases will do (mine,
>> in case).
> Sounds reasonable.
> I'll think about it :)
>

+1 for creating a *-volatile-conf package instead of having it buried in 
the image recipe.

Sau!

> Thanks,
> Chen Qi
>
>> So I do believe we ought to have a one-to-one correspondence here.
>>
>> --
>> Otavio Salvador                             O.S. Systems
>> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
>> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
>>
>>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>
Qi.Chen@windriver.com - Jan. 14, 2013, 2:35 a.m.
On 01/12/2013 07:32 AM, Saul Wold wrote:
> On 01/07/2013 06:22 PM, ChenQi wrote:
>> On 01/07/2013 06:30 PM, Otavio Salvador wrote:
>>> On Mon, Jan 7, 2013 at 1:06 AM, ChenQi <Qi.Chen@windriver.com> wrote:
>>>> On 01/07/2013 03:05 AM, Otavio Salvador wrote:
>>>>> On Sun, Jan 6, 2013 at 7:44 AM, <Qi.Chen@windriver.com> wrote:
>>>>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>>>>
>>>>>> Support read-only rootfs by providing a specific conf file for
>>>>>> volatile
>>>>>> storage.
>>>>>>
>>>>>> [YOCTO #3406]
>>>>>>
>>>>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>>>> I prefer this solution than the previous one however why you don't 
>>>>> use
>>>>> a sato-volatile-conf package to provide this?
>>>> Because the there exists a one-to-one (or almost one-to-one)
>>>> correspondence
>>>> between the volatile conf file and the specific image.
>>>>
>>>> If there is a 'sato-volatile-conf' package, then there should be a
>>>> 'minimal-volatile-conf', and maybe a 'custom-volatile-conf' if 
>>>> users are
>>>> using a customized image.
>>>>
>>>> So I think it's simpler to let the image recipe provide the conf file.
>>>> The only thing we have to do, when adding read-only rootfs support to
>>>> some
>>>> image, is to add the conf file to SRC_URI and install it in
>>>> choose_volatile_conf.
>>> The problem of not using a package for it is regarding upgrades; it is
>>> not possible to upgrade the configuration file using the package
>>> manager. I know most systems using the read-only-fs will be small and
>>> do not use a package manager at all but some use cases will do (mine,
>>> in case).
>> Sounds reasonable.
>> I'll think about it :)
>>
>
> +1 for creating a *-volatile-conf package instead of having it buried 
> in the image recipe.
>
I'll rework on it and send out the patch again.

Thanks for your review :)

Cheers,
Chen Qi

> Sau!
>
>> Thanks,
>> Chen Qi
>>
>>> So I do believe we ought to have a one-to-one correspondence here.
>>>
>>> -- 
>>> Otavio Salvador                             O.S. Systems
>>> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
>>> Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
>>>
>>>
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>>
>

Patch

diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
index f52a1a5..4ca1746 100644
--- a/meta/recipes-sato/images/core-image-sato.bb
+++ b/meta/recipes-sato/images/core-image-sato.bb
@@ -6,6 +6,14 @@  IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbe
 
 LICENSE = "MIT"
 
+SRC_URI += "file://volatiles-readonly-sato"
+
 inherit core-image
 
 IMAGE_INSTALL += "packagegroup-core-x11-sato-games"
+
+# install read-only rootfs specific conf file for sato image
+choose_volatile_conf () {
+	cp ${WORKDIR}/volatiles-readonly-sato \
+		${IMAGE_ROOTFS}/etc/default/volatiles/00_core_readonly
+}
diff --git a/meta/recipes-sato/images/files/volatiles-readonly-sato b/meta/recipes-sato/images/files/volatiles-readonly-sato
new file mode 100644
index 0000000..4a56b81
--- /dev/null
+++ b/meta/recipes-sato/images/files/volatiles-readonly-sato
@@ -0,0 +1,14 @@ 
+# This configuration file lists filesystem objects specific to sato image
+# with read-only rootfs.
+# This configuration file will only be applied if the image is sato and the
+# rootfs is read-only.
+# For the detailed format information, refer to /etc/default/volatiles/00_core.
+d root root 0755 /var/volatile/lib/ none
+d root root 0755 /var/volatile/lib/urandom/ none
+d root root 0755 /var/volatile/lib/dropbear/ none
+d root root 0755 /var/volatile/lib/nfs/ none
+d root root 0755 /var/volatile/lib/dbus/ none
+l root root 0755 /var/lib/urandom /var/volatile/lib/urandom
+l root root 0755 /var/lib/dropbear /var/volatile/lib/dropbear
+l root root 0755 /var/lib/nfs /var/volatile/lib/nfs
+l root root 0755 /var/lib/dbus /var/volatile/lib/dbus