Bug 1212807

Summary: virt-builder --selinux-relabel flag fails on cross-architecture builds
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED RAWHIDE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1222993 (view as bug list) Environment:
Last Closed: 2015-05-18 11:08:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1222993    

Description Richard W.M. Jones 2015-04-17 11:02:09 UTC
Description of problem:

If host arch != guest arch, the virt-builder --selinux-relabel
flag fails:

$ virt-builder --arch ppc64 fedora-21 --selinux-relabel
[   1.0] Downloading: http://libguestfs.org/download/builder/fedora-21-ppc64.xz
[   1.0] Planning how to build this image
[   1.0] Uncompressing
[  14.0] Opening the new disk
[  27.0] Setting a random seed
[  27.0] Setting passwords
virt-builder: Setting random password of root to 9XFmS9JoU10hYuWf
[  28.0] SELinux relabelling
virt-builder: warning: log file /tmp/builder.log: Guestfs.Error("download: 
/tmp/builder.log: No such file or directory") (ignored)
virt-builder: error: load_policy && fixfiles restore: command exited with 
an error

This is because the code tries to run binaries from the
guest (load_policy etc), but it should skip that step and just
touch /.autorelabel directly.

Version-Release number of selected component (if applicable):

libguestfs-1.29.36-1.fc23.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See command above.

Comment 1 Richard W.M. Jones 2015-05-15 09:08:51 UTC
Patches posted upstream:
https://www.redhat.com/archives/libguestfs/2015-May/msg00053.html

Comment 2 Richard W.M. Jones 2015-05-15 14:32:28 UTC
v2 patches:
https://www.redhat.com/archives/libguestfs/2015-May/msg00073.html

Comment 3 Richard W.M. Jones 2015-05-18 11:08:50 UTC
Fixed upstream in >= 1.29.43.