Bug 215552 - emulators/qemu-user-static: cannot install ports any more in emulated environment
Summary: emulators/qemu-user-static: cannot install ports any more in emulated environ...
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sean Bruno
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-25 18:28 UTC by Martin Birgmeier
Modified: 2017-01-25 20:39 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (sbruno)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2016-12-25 18:28:51 UTC
Scenario:
=========

- Using virtualbox-5.1.12 to run FreeBSD head amd64 (currently at r308341).
- Installed, amongst other, the following ports:
  . arm-none-eabi-binutils-2.27_5,1
  . arm-none-eabi-gcc-6.3.0
  . qemu-user-static-2.7.90.g20161116_1
- Via iSCSI importing a disk (disk925) with an arm/armv6 installation, mounting its partitions as follows:
    /dev/diskid/DISK-HAL_00925s2a /d/925s2a         ufs     rw              0 0
    /dev/diskid/DISK-HAL_00925s1 /d/925s2a/boot/msdos       msdosfs rw             0 0
    devfs                   /d/925s2a/dev           devfs   rw              0 0
    fdescfs                 /d/925s2a/dev/fd        fdescfs rw              0 0
    procfs                  /d/925s2a/proc          procfs  rw              0 0
    /dev/md1                /d/925s2a/tmp           ufs     rw              0 0
- Via autofs mounting FreeBSD ports:
    hal:/z/SRC/FreeBSD-ports /d/925s2a/auto/z/SRC/FreeBSD-ports nfs rw             0 0
- Chrooting into the arm environment and starting a zsh there:
    # chroot /d/925s2a /bin/zsh -l
- This now runs the emulated zsh.
- Compiling a new version of ports-mgmt/pkg:
    # cd /usr/ports/ports-mgmt/pkg
    # make
- Up to here, everything works.

Results:
========

- Since a few weeks, the following happens:
- Portmaster does not find any ports to upgrade (the following message "all ports are up to date" is wrong):

[0]# portmaster -gaB
===>>> Starting check of installed ports for available updates

===>>> All ports are up to date

[0]# 

- Manually installing a new version of 'pkg' results in (first install via tar, then in the normal manner):

[0]# cd /usr/ports/ports-mgmt/pkg
[0]# ( cd /usr/tmp/ports/ports-mgmt/pkg/work/stage/usr/local && tar cf - . ) | ( cd /usr/local && tar xfp - )
[0]# make install clean
===>  Installing for pkg-1.9.4_1
===>  Checking if pkg already installed
===>   Registering installation for pkg-1.9.4_1
Installing pkg-1.9.4_1...
pkg-static: Fail to rename /usr/local/share/licenses/pkg-1.9.4_1/.catalog.mk.NjGxtCAazHfm -> /usr/local/share/licenses/pkg-1.9.4_1/catalog.mk: Bad address
*** Error code 70

Stop.
make[1]: stopped in /auto/z/SRC/FreeBSD-ports/head/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /auto/z/SRC/FreeBSD-ports/head/ports-mgmt/pkg
[1]# 

- Try with manually upgrading ca_root_nss:

[0]# pkg delete -f ca_root_nss-3.27.1
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        ca_root_nss-3.27.1

Number of packages to be removed: 1

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling ca_root_nss-3.27.1...
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_enter()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_enter()
[1/1] Deleting files for ca_root_nss-3.27.1: 100%
[0]# cd /usr/ports/security/ca_root_nss
[0]# make install clean
===>  Installing for ca_root_nss-3.28
===>  Checking if ca_root_nss already installed
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_rights_limit()
qemu: Unsupported syscall cap_ioctls_limit()
qemu: Unsupported syscall cap_fcntls_limit()
qemu: Unsupported syscall cap_enter()
===>   Registering installation for ca_root_nss-3.28
Installing ca_root_nss-3.28...
pkg-static: Fail to rename /usr/local/share/licenses/ca_root_nss-3.28/.catalog.mk.0bEaO0qTy1x7 -> /usr/local/share/licenses/ca_root_nss-3.28/catalog.mk: Bad address
cp: /usr/local/etc/ssl/cert.pem.sample: No such file or directory
cp: /usr/local/openssl/cert.pem.sample: No such file or directory
pkg-static: POST-INSTALL script failed
*** Error code 70

Stop.
make[1]: stopped in /auto/z/SRC/FreeBSD-ports/head/security/ca_root_nss
*** Error code 1

Stop.
make: stopped in /auto/z/SRC/FreeBSD-ports/head/security/ca_root_nss
[1]# 

Expected results:
=================

- A few weeks ago, apart from the unimplemented cap_* system calls, everything worked fine.
Comment 1 Martin Birgmeier 2016-12-25 18:29:37 UTC
Note that the armv6 installation is also head@r308341

-- Martin
Comment 2 Martin Birgmeier 2016-12-25 18:30:18 UTC
... cross-compiled on amd64 and installed into the disk925 location
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-12-29 01:13:18 UTC
A commit references this bug:

Author: sbruno
Date: Thu Dec 29 01:12:38 UTC 2016
New revision: 429848
URL: https://svnweb.freebsd.org/changeset/ports/429848

Log:
  Bump qemu-sbruno to capture today's removal of signal blocking in
  the bsd-user code. This update should allow normal operation with the
  bugs that we all were familiar with!

  PR:	214944 215552

Changes:
  head/emulators/qemu-sbruno/Makefile
  head/emulators/qemu-sbruno/distinfo
Comment 4 Martin Birgmeier 2016-12-29 13:44:27 UTC
Hmmm, just tried the latest version, but no improvement:

---------- snip ----------
[0]# uname -a
FreeBSD v903.xyzzy 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r308341M: Sun Nov  6 14:48:12 CET 2016     root@v903.xyzzy:/.../hal/z/OBJ/FreeBSD/amd64/head/sys/XYZZY_SMP_NOSPIN  amd64
[0]# chroot /d/925s2a /bin/zsh -l
/etc/zshrc:9: compinit: function definition file not found
/etc/zshrc:11: command not found: compdef
[0]# uname -a
FreeBSD v903.xyzzy 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r308341M: Sun Nov  6 14:48:12 CET 2016     root@v903.xyzzy:/.../hal/z/OBJ/FreeBSD/amd64/head/sys/XYZZY_SMP_NOSPIN  arm
[0]# portmaster -gaB
===>>> Starting check of installed ports for available updates

===>>> All ports are up to date

[0]# cd /usr/ports/ports-mgmt/pkg
[0]# make install clean
===>  Installing for pkg-1.9.4_1
===>  Checking if pkg already installed
===>   Registering installation for pkg-1.9.4_1
Installing pkg-1.9.4_1...
pkg-static: Fail to rename /usr/local/share/licenses/pkg-1.9.4_1/.catalog.mk.Y9KtGiisRF33 -> /usr/local/share/licenses/pkg-1.9.4_1/catalog.mk: Bad address
*** Error code 70

Stop.
make[1]: stopped in /auto/z/SRC/FreeBSD-ports/head/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /auto/z/SRC/FreeBSD-ports/head/ports-mgmt/pkg
[1]# 
Ciao!
chroot /d/925s2a /bin/zsh -l  11.31s user 2.65s system 45% cpu 30.762 total
[0]# date
Thu Dec 29 14:41:20 CET 2016
[0]#                             
---------- snip ----------
Comment 5 Martin Birgmeier 2017-01-25 20:39:47 UTC
The solution is to not to forget to copy any new version of /usr/local/bin/qemu-static-arm (from a port upgrade) from the host into the emulated environment so that it can be found even after chrooting.

It is the only non-arm binary in the emulated environment.

-- Martin