Patchwork [V5,3/4] core-image.bbclass: support read-only-rootfs image feature

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Dec. 31, 2012, 2:16 a.m.
Message ID <7d6c79b382b07771da688930a34ae0ec8b3ba97a.1356919994.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/41807/
State New
Headers show

Comments

Qi.Chen@windriver.com - Dec. 31, 2012, 2:16 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

Two hook functions are appended to ROOTFS_POSTPROCESS_COMMAND
properly to support the 'read-only-rootfs' image feature.

[YOCTO #3406]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/core-image.bbclass |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Otavio Salvador - Jan. 1, 2013, 6:13 p.m.
On Mon, Dec 31, 2012 at 12:16 AM,  <Qi.Chen@windriver.com> wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Two hook functions are appended to ROOTFS_POSTPROCESS_COMMAND
> properly to support the 'read-only-rootfs' image feature.
>
> [YOCTO #3406]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/classes/core-image.bbclass |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
> index 2e67018..dc8fdc3 100644
> --- a/meta/classes/core-image.bbclass
> +++ b/meta/classes/core-image.bbclass
> @@ -28,6 +28,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
>  # - dev-pkgs            - development packages (headers, etc.) for all installed packages in the rootfs
>  # - dbg-pkgs            - debug symbol packages for all installed packages in the rootfs
>  # - doc-pkgs            - documentation packages for all installed packages in the rootfs
> +# - read-only-rootfs    - tweaks an image to support read-only rootfs
>  #
>  PACKAGE_GROUP_x11 = "packagegroup-core-x11"
>  PACKAGE_GROUP_x11-base = "packagegroup-core-x11-base"
> @@ -73,9 +74,11 @@ inherit image
>
>  # Create /etc/timestamp during image construction to give a reasonably sane default time setting
>  ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
> -
> +# Choose the correct configuartion files for volatile storage handling
> +ROOTFS_POSTPROCESS_COMMAND += "choose_volatile_conf_file ; "

You can remove this if you use a package to provide the volatile configuration.

>  # Zap the root password if debug-tweaks feature is not enabled
>  ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}'
>  # Allow openssh accept empty password login if both debug-tweaks and ssh-server-openssh are enabled
>  ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks ssh-server-openssh", "openssh_allow_empty_password; ", "",d)}'
> -
> +# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
> +ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
> --
> 1.7.9.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



--
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

Patch

diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
index 2e67018..dc8fdc3 100644
--- a/meta/classes/core-image.bbclass
+++ b/meta/classes/core-image.bbclass
@@ -28,6 +28,7 @@  LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
 # - dev-pkgs            - development packages (headers, etc.) for all installed packages in the rootfs
 # - dbg-pkgs            - debug symbol packages for all installed packages in the rootfs
 # - doc-pkgs            - documentation packages for all installed packages in the rootfs
+# - read-only-rootfs    - tweaks an image to support read-only rootfs
 #
 PACKAGE_GROUP_x11 = "packagegroup-core-x11"
 PACKAGE_GROUP_x11-base = "packagegroup-core-x11-base"
@@ -73,9 +74,11 @@  inherit image
 
 # Create /etc/timestamp during image construction to give a reasonably sane default time setting
 ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
-
+# Choose the correct configuartion files for volatile storage handling
+ROOTFS_POSTPROCESS_COMMAND += "choose_volatile_conf_file ; "
 # Zap the root password if debug-tweaks feature is not enabled
 ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_root_password ; ",d)}'
 # Allow openssh accept empty password login if both debug-tweaks and ssh-server-openssh are enabled
 ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks ssh-server-openssh", "openssh_allow_empty_password; ", "",d)}'
-
+# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'