Re: [isar-cip-core][PATCH] immutable-home: skip postprocess function when symlink is already created

Jan Kiszka <[email protected]> Tue, 28 Jul 2026 09:52:49 +0200
Newsgroups org.cip-project.lists.cip-dev
Message-ID <[email protected]>
On 27.07.26 14:31, Gokhan Cetin wrote:
> This solves "logging in with home" issues when rootfs_install is skipped
> during rebuilds, because of a change on task or POSTPROCESS function,
> since IMAGE_ROOTFS has already contains immutable home directory and
> symlink to var/home, and running this task again just cleans immutable home
> in this case.
> 
> Signed-off-by: Gokhan Cetin <[email protected]>
> ---
>  classes-recipe/read-only-rootfs.bbclass | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/classes-recipe/read-only-rootfs.bbclass b/classes-recipe/read-only-rootfs.bbclass
> index a67bb5f..1c57f33 100644
> --- a/classes-recipe/read-only-rootfs.bbclass
> +++ b/classes-recipe/read-only-rootfs.bbclass
> @@ -52,6 +52,14 @@ ROOTFS_POSTPROCESS_COMMAND:append = " copy_home_to_immutable_data"
>  ROOTFS_POSTPROCESS_COMMAND:remove:separate-home-part = " copy_home_to_immutable_data"
>  copy_home_to_immutable_data() {
>      IMMUTABLE_HOME_DIR="${ROOTFSDIR}${IMMUTABLE_DATA_DIR}"
> +    if [ -L ${ROOTFSDIR}/home ]; then
> +        bbwarn "Skipping moving /home to immutable home directory," \
> +               "because it is already a symbolic link."
> +        bbwarn "You might have a custom task or writing POSTPROCESS function."
> +        bbwarn "If there is a change that requires the rootfs to be reinstalled," \
> +               "consider performing a clean build again."
> +        exit 0
> +    fi
>      sudo -s <<EOSUDO
>          set -e
>          mkdir -p "$IMMUTABLE_HOME_DIR"

Looks rather like a workaround, and also a noisy one (bbwarn).

Wasn't there the plan to start image post-processing from a clean image,
rather than rerunning against an already processed state?

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center