Bug 1370816 - virt-builder rhel-6.5 --selinux-relabel fails
Summary: virt-builder rhel-6.5 --selinux-relabel fails
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-27 13:06 UTC by Richard W.M. Jones
Modified: 2017-06-26 13:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-26 13:23:41 UTC


Attachments (Terms of Use)

Description Richard W.M. Jones 2016-08-27 13:06:44 UTC
Description of problem:

$ virt-builder rhel-6.5 --selinux-relabel
[   0.2] Downloading: .../rhel-6.5.xz
[   0.8] Planning how to build this image
[   0.8] Uncompressing
[  13.3] Opening the new disk
[  25.9] Setting a random seed
[  25.9] Setting passwords
virt-builder: Setting random password of root to 9tUGCecjfvaHS3Wm
[  27.0] SELinux relabelling
virt-builder: error: libguestfs error: selinux_relabel: 
/sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid 
argument: Success

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

libguestfs-1.34.0-1.fc24.x86_64

How reproducible:

100%

However it is not a problem with later versions of RHEL,
eg. rhel-6.8 works fine.

Steps to Reproduce:
1. See above.

Comment 1 Pino Toscano 2017-06-26 13:23:41 UTC
In the end, it was worked around in libguestfs by manually fixing a faulty selinux file_context file -- see more discussion in bug 1374232.

Fixed with commits
https://github.com/libguestfs/libguestfs/commit/25772a8123a1a800caf3472fb79c8eb3b4a074f3
https://github.com/libguestfs/libguestfs/commit/c6d8d68a4643794128c1d617bc83fc22438cc7c5
which are in libguestfs >= 1.37.1.


Note You need to log in before you can comment on or make changes to this bug.