Cannot package converters/libiconv inside clean chroot

Ulrich Spoerlein uspoerlein at gmail.com
Sun Apr 8 08:05:11 UTC 2007


Tim Kientzle wrote:
> Sounds like 'tar' inside the chroot is different than the
> one outside.  You've probably found a bug in the newest
> RELENG_6 tar.

There are at least two issues here, one is pkg_add refusing a valid
(AFAICS) tbz file, the other is bsdtar(1) choosing a different tar
format based on unionfs(!).

To demonstrate:
/vol/live contains a populated world, I have the following mounts

<below>:/vol/live on /vol/overlay (unionfs, local, noatime)
/usr/ports on /vol/live/usr/ports (nullfs, local, read-only)
/usr/ports on /vol/overlay/usr/ports (nullfs, local, read-only)
devfs on /vol/live/dev (devfs, local)
devfs on /vol/overlay/dev (devfs, local)

I chrooted to /vol/overlay and did a make package for libiconv. Then I
chrooted to /vol/live and did the same. Observe the different package
formats:

roadrunner# tar tvvf union/All/libiconv-1.9.2_2.tbz 
-rw-r--r--  0 root   wheel    2427 Apr  8 07:37 +CONTENTS
-rw-r--r--  0 root   wheel      35 Apr  8 07:37 +COMMENT
-rw-r--r--  0 root   wheel     676 Apr  8 07:37 +DESC
-rwxr-xr-x  0 root   wheel   15305 Apr  8 07:37 +MTREE_DIRS
-r--r--r--  0 root   wheel     976 Apr  8 07:37 man/man1/iconv.1.gz
-r--r--r--  0 root   wheel    1457 Apr  8 07:37 man/man3/iconv.3.gz
-r--r--r--  0 root   wheel    2103 Apr  8 07:37 man/man3/iconv_open.3.gz
-r--r--r--  0 root   wheel     653 Apr  8 07:37 man/man3/iconv_close.3.gz
-r-xr-xr-x  0 root   wheel    7724 Apr  8 07:37 bin/iconv
-r--r--r--  0 root   wheel    4760 Apr  8 07:37 include/iconv.h
-r--r--r--  0 root   wheel    1546 Apr  8 07:37 include/libcharset.h
-r--r--r--  0 root   wheel    1391 Apr  8 07:37 include/localcharset.h
-rw-r--r--  0 root   wheel    4256 Apr  8 07:37 lib/libcharset.a
-r--r--r--  0 root   wheel     807 Apr  8 07:37 lib/libcharset.la
lrwxr-xr-x  1 root   wheel       0 Apr  8 07:37 lib/libcharset.so -> libcharset.so.1
-r--r--r--  0 root   wheel    8464 Apr  8 07:37 lib/libcharset.so.1
-rw-r--r--  0 root   wheel  998722 Apr  8 07:37 lib/libiconv.a
-r--r--r--  0 root   wheel     793 Apr  8 07:37 lib/libiconv.la
lrwxr-xr-x  1 root   wheel       0 Apr  8 07:37 lib/libiconv.so -> libiconv.so.3
-r--r--r--  0 root   wheel 1002230 Apr  8 07:37 lib/libiconv.so.3
-r--r--r--  0 root   wheel     641 Apr  8 07:37 libdata/charset.alias
-r--r--r--  0 root   wheel    3473 Apr  8 07:37 share/doc/libiconv/iconv.1.html
-r--r--r--  0 root   wheel    8223 Apr  8 07:37 share/doc/libiconv/iconv.3.html
-r--r--r--  0 root   wheel    2384 Apr  8 07:37 share/doc/libiconv/iconv_close.3.html
-r--r--r--  0 root   wheel   16401 Apr  8 07:37 share/doc/libiconv/iconv_open.3.html
Archive Format: POSIX pax interchange format,  Compression: bzip2
roadrunner# tar tvvf real/All/libiconv-1.9.2_2.tbz 
-rw-r--r--  0 root   wheel    2427 Apr  8 07:37 +CONTENTS
-rw-r--r--  0 root   wheel      35 Apr  8 07:37 +COMMENT
-rw-r--r--  0 root   wheel     676 Apr  8 07:37 +DESC
-r--r--r--  0 root   wheel   15305 Apr  8 07:37 +MTREE_DIRS
-r--r--r--  0 root   wheel     976 Apr  8 07:37 man/man1/iconv.1.gz
-r--r--r--  0 root   wheel    1457 Apr  8 07:37 man/man3/iconv.3.gz
-r--r--r--  0 root   wheel    2103 Apr  8 07:37 man/man3/iconv_open.3.gz
-r--r--r--  0 root   wheel     653 Apr  8 07:37 man/man3/iconv_close.3.gz
-r-xr-xr-x  0 root   wheel    7724 Apr  8 07:37 bin/iconv
-r--r--r--  0 root   wheel    4760 Apr  8 07:37 include/iconv.h
-r--r--r--  0 root   wheel    1546 Apr  8 07:37 include/libcharset.h
-r--r--r--  0 root   wheel    1391 Apr  8 07:37 include/localcharset.h
-rw-r--r--  0 root   wheel    4256 Apr  8 07:37 lib/libcharset.a
-r--r--r--  0 root   wheel     807 Apr  8 07:37 lib/libcharset.la
lrwxr-xr-x  0 root   wheel       0 Apr  8 07:37 lib/libcharset.so -> libcharset.so.1
-r--r--r--  0 root   wheel    8464 Apr  8 07:37 lib/libcharset.so.1
-rw-r--r--  0 root   wheel  998722 Apr  8 07:37 lib/libiconv.a
-r--r--r--  0 root   wheel     793 Apr  8 07:37 lib/libiconv.la
lrwxr-xr-x  0 root   wheel       0 Apr  8 07:37 lib/libiconv.so -> libiconv.so.3
-r--r--r--  0 root   wheel 1002230 Apr  8 07:37 lib/libiconv.so.3
-r--r--r--  0 root   wheel     641 Apr  8 07:37 libdata/charset.alias
-r--r--r--  0 root   wheel    3473 Apr  8 07:37 share/doc/libiconv/iconv.1.html
-r--r--r--  0 root   wheel    8223 Apr  8 07:37 share/doc/libiconv/iconv.3.html
-r--r--r--  0 root   wheel    2384 Apr  8 07:37 share/doc/libiconv/iconv_close.3.html
-r--r--r--  0 root   wheel   16401 Apr  8 07:37 share/doc/libiconv/iconv_open.3.html
Archive Format: POSIX ustar format,  Compression: bzip2

So, inside the unionfs mounted base system bsdtar(1) creates different
package formats. This in itself shouldn't be a problem.

Then pkg_add trips over the symlinks inside this tar file (pkg_add works
fine for packages without symlinks, e.g. libtool15).

NB: Extracting both files with bsdtar(1) works just fine, it's something
that pkg_add does, that breaks it.

> Can you email me the troublesome package file?

Will do in a separate mail.

Ulrich Spoerlein
-- 
"The trouble with the dictionary is you have to know how the word is
spelled before you can look it up to see how it is spelled."
-- Will Cuppy


More information about the freebsd-ports mailing list