[CRIU] [PATCH] Android: change tmpdir to /data/tmp

Zhang, Ning A ning.a.zhang at intel.com
Thu Apr 18 12:00:03 MSK 2019


there may be some other issue when choose /data/tmp/ as Android tmpdir.

please on hold for this patch.


在 2019-04-16二的 10:43 +0800,ning.a.zhang at intel.com写道:
> From: Zhang Ning <ning.a.zhang at intel.com>
> 
> due to Android OS doesn't have /tmp, and its
> rootfs is readonly, so change tmpdir to /data/tmp
> 
> Cc: Chen Hu <hu1.chen at intel.com>
> Signed-off-by: Zhang Ning <ning.a.zhang at intel.com>
> ---
>  criu/cr-check.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/criu/cr-check.c b/criu/cr-check.c
> index 7addb9fb..bf3ec306 100644
> --- a/criu/cr-check.c
> +++ b/criu/cr-check.c
> @@ -828,10 +828,20 @@ static int check_autofs_pipe_ino(void)
>  	fclose(f);
>  	return ret;
>  }
> +/*
> +for Android, there is no /tmp, and rootfs is readonly,
> +so in order to run in Android, has to find another place for tmpdir.
> +data partition is a good place.
> +*/
> +#ifdef __ANDROID__
> +#define CR_TMPDIR "/data/tmp"
> +#else
> +#define CR_TMPDIR "/tmp"
> +#endif
>  
>  static int check_autofs(void)
>  {
> -	char *dir, *options, template[] = "/tmp/.criu.mnt.XXXXXX";
> +	char *dir, *options, template[] = CR_TMPDIR"/.criu.mnt.XXXXXX";
>  	int ret, pfd[2];
>  
>  	ret = check_autofs_pipe_ino();



More information about the CRIU mailing list