[Libguestfs] [PATCH 2/2] customize: Allow --selinux-relabel flag to work on cross-architecture builds (RHBZ#1212807).

Pino Toscano ptoscano at redhat.com
Fri May 15 13:34:30 UTC 2015


On Friday 15 May 2015 10:08:10 Richard W.M. Jones wrote:
> ---
>  customize/customize_run.ml | 22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/customize/customize_run.ml b/customize/customize_run.ml
> index 0f1d72a..cd4616c 100644
> --- a/customize/customize_run.ml
> +++ b/customize/customize_run.ml
> @@ -338,15 +338,19 @@ exec >>%s 2>&1
>  
>    if ops.flags.selinux_relabel then (
>      msg (f_"SELinux relabelling");
> -    let cmd = sprintf "
> -      if load_policy && fixfiles restore; then
> -        rm -f /.autorelabel
> -      else
> -        touch /.autorelabel
> -        echo '%s: SELinux relabelling failed, will relabel at boot instead.'
> -      fi
> -    " prog in
> -    do_run ~display:"load_policy && fixfiles restore" cmd
> +    if guest_arch_compatible then (
> +      let cmd = sprintf "
> +        if load_policy && fixfiles restore; then
> +          rm -f /.autorelabel
> +        else
> +          touch /.autorelabel
> +          echo '%s: SELinux relabelling failed, will relabel at boot instead.'
> +        fi
> +      " prog in
> +      do_run ~display:"load_policy && fixfiles restore" cmd
> +    ) else (
> +      g#touch "/.autorelabel"
> +    )

LGTM.

-- 
Pino Toscano




More information about the Libguestfs mailing list