Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1519623 - Supermin could install ntfs in OpenSUSE42.3
Summary: Supermin could install ntfs in OpenSUSE42.3
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: supermin
Version: unspecified
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-12-01 03:47 UTC by Bamvor Zhang
Modified: 2017-12-01 10:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)
libguest-test-tool-log (deleted)
2017-12-01 03:47 UTC, Bamvor Zhang
no flags Details

Description Bamvor Zhang 2017-12-01 03:47:40 UTC
Created attachment 1361401 [details]

Description of problem:
When I build libguest locally in my OpenSUSE. I found that ./test-data/phony-guests/ failed. It prompt mount ntfs fail. But I could run the guestfish script manually successful:
guestfish <<EOF
sparse windows.img-t 512M

# Format the disk.
part-init /dev/sda mbr
part-add /dev/sda p 64     524287
part-add /dev/sda p 524288    -64

# Disk ID.
pwrite-device /dev/sda "1234" 0x01b8 | cat >/dev/null

# Phony boot loader filesystem.
mkfs ntfs /dev/sda1

# Phony root filesystem.
mkfs ntfs /dev/sda2

# Enough to fool inspection API.
mount /dev/sda2 /
mkdir-p /Windows/System32/Config
mkdir-p /Windows/System32/Drivers

upload $SRCDIR/windows-software /Windows/System32/Config/SOFTWARE
upload $SRCDIR/windows-system /Windows/System32/Config/SYSTEM

upload $SRCDIR/../binaries/bin-win32.exe /Windows/System32/cmd.exe

mkdir "/Program Files"
touch /autoexec.bat


Then I investigate the supermin command. I found that supermin will not install ntfs relative packages even if it already found the correct dependency. Please reference the "actual result" for the full log of supermin.

Version-Release number of selected component (if applicable):
supermin(both 5.1.18 and master)
Name        : supermin
Version     : 5.1.18
Release     : 19.d_l_ocaml.2

commit 45a03544962f01ff8a4444c22b1552e27c246c31 (HEAD -> master, origin/master, origin/HEAD)
Author: Richard W.M. Jones <>
Date:   Tue Oct 24 13:43:26 2017 +0100

    docs: Adjust kernel command line in example.

    Thanks: Hangbin Liu.

qemu: 2.10.1

kernel: 4.4.76-1-default

Distribution: openSUSE Leap 42.3

How reproducible:

Steps to Reproduce:
1. supermin --prepare -v -o supermin.d ntfs-3g

Actual results
supermin will not install the ntfs-3g, see the following log
supermin: version: 5.1.19
supermin: rpm: detected RPM version 4.11
supermin: rpm: detected zypper version 1.13.28
supermin: package handler: opensuse/rpm
supermin: prepare: ntfs-3g
supermin: packages specified on the command line:
  - ntfs-3g-2013.1.13-6.3.x86_64
supermin: writing supermin.d.3e34g1ua/packages
supermin: after resolving dependencies there are 24 packages:
  - bash-4.3-82.6.x86_64
  - coreutils-8.25-3.3.x86_64
  - filesystem-13.1-9.5.x86_64
  - glibc-2.22-8.4.x86_64
  - info-4.13a-42.18.x86_64
  - libacl1-2.2.52-10.15.x86_64
  - libattr1-2.4.47-8.15.x86_64
  - libbz2-1-1.0.6-34.15.x86_64
  - libcap2-2.22-18.16.x86_64
  - libfuse2-2.9.3-11.3.x86_64
  - libgcc_s1-7.1.1+r248970-1.4.x86_64
  - libgmp10-5.1.3-7.15.x86_64
  - liblzma5-5.2.2-3.15.x86_64
  - libncurses5-5.9-59.1.x86_64
  - libntfs-3g84-2013.1.13-6.3.x86_64
  - libpcre1-8.39-9.15.x86_64
  - libreadline6-6.3-82.6.x86_64
  - libselinux1-2.5-4.17.x86_64
  - libstdc++6-7.1.1+r248970-1.4.x86_64
  - libz1-1.2.8-13.15.x86_64
  - libzio1-1.00-14.15.x86_64
  - ntfs-3g-2013.1.13-6.3.x86_64
  - terminfo-base-5.9-57.1.x86_64
  - update-alternatives-1.18.4-4.15.x86_64
Verbosity: 2
Entering non-interactive mode.
Entering 'no-gpg-checks' mode.
Warning: Turning on '--gpg-auto-import-keys'. New repository signing keys will be automatically imported!
Non-option program arguments: 'bash.x86_64' 'glibc.x86_64' 'terminfo-base.x86_64' 'info.x86_64' 'libattr1.x86_64' 
Initializing Target

Expected results:
supermin wil install the ntfs-3g, see the following log

Additional info:
See attachment for libguest-test-tool-log

Comment 1 Pino Toscano 2017-12-01 10:32:34 UTC
supermin creates the appliances by copying the files of the packages specified.
In openSUSE, both ntfs-3g and ntfsprogs (only ntfs-3g is not enough) use the "alternatives" system of RPM to setup the links for the programs.

For example, installing them in a openSUSE Factory VM:

  (3/3) Installing: ntfs-3g-2016.2.22-3.3.x86_64 ...[snip].....[done]
  Additional rpm output:
  update-alternatives: using /sbin/mount.ntfs-3g to provide /sbin/mount.ntfs (mount.ntfs) in auto mode

which is exactly what I described.  mkfs.ntfs is a real application, while mount.ntfs is a symlink managed by alternatives:

  $ ls -lh `which mount.ntfs`
  lrwxrwxrwx 1 root root 28 Dec  1 11:25 /sbin/mount.ntfs -> /etc/alternatives/mount.ntfs
  $ ls -lh /etc/alternatives/mount.ntfs
  lrwxrwxrwx 1 root root 19 Dec  1 11:25 /etc/alternatives/mount.ntfs -> /sbin/mount.ntfs-3g

So installing both the packages allows libguestfs to create ntfs filesystems, but not mount them.

See also bug 1223522 on why we do not run any pre/post scripts of package managers.  Unless this kind of operation get some sort of declarative configuration format (so supermin can execute them on its own), there is nothing much that can be done, I'm afraid.  The other option would be that ntfs-3g stops using the alternative, but from what I know it is done on purpose.

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