building packages and boostraping xbps

148 views
Skip to first unread message

Jimmy

unread,
May 4, 2010, 1:50:02 PM5/4/10
to The X Binary Package System
hi

I've just started to play with xbps-src to try and build packages, and
based on some initial observations. I have a few questions and remarks
to make. firstly it appears that the packages that are built in a
chroot, and i had some minor issues with getting xbps-src to installed/
configured etc... would a better setup be to have *all* the basic
dependancies needed to get xbps and xbps-src packaged up. and have the
xbps-static package packed up as a gzip'd tarball install of a xz
archive. it would make bootstrapping much easier. and also does xbps
support src packages like in the rpm format? so i can bundle up an
entire source tarball + patches and whatever metadata file is needed
to rebuild a package (for archival purposes)



thanks,
jimmy

--
XBPS - The X Binary Package System

You received this message because you are subscribed to the Google
Groups "xbps" group.
To post to this group, send email to xb...@googlegroups.com
To unsubscribe from this group, send email to
xbps+uns...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/xbps?hl=en

Jimmy Tang

unread,
May 4, 2010, 1:55:02 PM5/4/10
to The X Binary Package System
oops, they are there, my install is just abit messed up

Jimmy Tang

unread,
May 4, 2010, 2:32:11 PM5/4/10
to The X Binary Package System
Hi

commenting on myself again

[jtang@duo xbps]$ xbps-src build
FATAL: kernel too old
FATAL: kernel too old
/home/jtang/xbps.i//share/xbps-src/shutils/init_funcs.sh: line 27:
30801 Segmentation fault ${XBPS_CMPVER_CMD} "${instver}"
"${XBPS_UTILS_REQVER}"
Root permissions are required for the chroot, try again.
[jtang@duo xbps]$ fakeroot xbps-src build
FATAL: kernel too old
FATAL: kernel too old
/home/jtang/xbps.i//share/xbps-src/shutils/init_funcs.sh: line 27:
30848 Segmentation fault ${XBPS_CMPVER_CMD} "${instver}"
"${XBPS_UTILS_REQVER}"
FATAL: kernel too old
FATAL: kernel too old
The 'xbps' package requires to be installed in a chroot.
Please install 'xbps-base-chroot>=0.11' and try again.
[jtang@duo xbps]$


i suspect (and I want to ) rebuild all the packages on my rhel5
desktop, i don't suppose you have and advice on how to rebuild
everything from scratch?


thanks,
jimmy.

Juan Romero Pardines

unread,
May 4, 2010, 2:51:13 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy <jcf...@gmail.com>:
> hi
>
> I've just started to play with xbps-src to try and build packages, and
> based on some initial observations. I have a few questions and remarks
> to make. firstly it appears that the packages that are built in a
> chroot, and i had some minor issues with getting xbps-src to installed/
> configured etc... would a better setup be to have *all* the basic
> dependancies needed to get xbps and xbps-src packaged up. and have the
> xbps-static package packed up as a gzip'd tarball install of a xz
> archive. it would make bootstrapping much easier. and also does xbps
> support src packages like in the rpm format? so i can bundle up an
> entire source tarball + patches and whatever metadata file is needed
> to rebuild a package (for archival purposes)

It's all explained here:

http://code.google.com/p/xbps/wiki/PackageBuilding

Basically what you have to do is:

$ hg clone http://xbps-src.xbps.googlecode.com/hg xbps-templates
$ cd xbps-templates/xbps-src && make install clean (uses
PREFIX?=/usr/local by default)

Edit your preferences in $PREFIX/etc/xbps-src.conf

Install the toolchain for the chroot:

$ cd xbps-templates/srcpkgs/xbps-base-chroot && xbps-src install

From now on you can build any package available in srcpkgs.

Juan Romero Pardines

unread,
May 4, 2010, 2:53:01 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:
> Hi
>
> commenting on myself again
>
> [jtang@duo xbps]$ xbps-src build
> FATAL: kernel too old
> FATAL: kernel too old
> /home/jtang/xbps.i//share/xbps-src/shutils/init_funcs.sh: line 27:
> 30801 Segmentation fault      ${XBPS_CMPVER_CMD} "${instver}"
> "${XBPS_UTILS_REQVER}"
> Root permissions are required for the chroot, try again.
> [jtang@duo xbps]$ fakeroot xbps-src build
> FATAL: kernel too old
> FATAL: kernel too old
> /home/jtang/xbps.i//share/xbps-src/shutils/init_funcs.sh: line 27:
> 30848 Segmentation fault      ${XBPS_CMPVER_CMD} "${instver}"
> "${XBPS_UTILS_REQVER}"
> FATAL: kernel too old
> FATAL: kernel too old
> The 'xbps' package requires to be installed in a chroot.
> Please install 'xbps-base-chroot>=0.11' and try again.
> [jtang@duo xbps]$
>
>
> i suspect (and I want to )  rebuild all the packages on my rhel5
> desktop, i don't suppose you have and advice on how to rebuild
> everything from scratch?

You cannot do that with XBPS. XBPS is a new package system, which uses
its format for metadata, structure and anything. The only metadata format
that it understands is its own, doesn't know about RPM or any other format.

Sorry :-)

Jimmy Tang

unread,
May 4, 2010, 2:56:29 PM5/4/10
to xb...@googlegroups.com
On Tue, May 4, 2010 at 7:51 PM, Juan Romero Pardines <xtr...@gmail.com> wrote:
> 2010/5/4 Jimmy <jcf...@gmail.com>:
>> hi
>>
>> I've just started to play with xbps-src to try and build packages, and
>> based on some initial observations. I have a few questions and remarks
>> to make. firstly it appears that the packages that are built in a
>> chroot, and i had some minor issues with getting xbps-src to installed/
>> configured etc... would a better setup be to have *all* the basic
>> dependancies needed to get xbps and xbps-src packaged up. and have the
>> xbps-static package packed up as a gzip'd tarball install of a xz
>> archive. it would make bootstrapping much easier. and also does xbps
>> support src packages like in the rpm format? so i can bundle up an
>> entire source tarball + patches and whatever metadata file is needed
>> to rebuild a package (for archival purposes)
>
> It's all explained here:
>
> http://code.google.com/p/xbps/wiki/PackageBuilding
>
> Basically what you have to do is:
>
> $ hg clone http://xbps-src.xbps.googlecode.com/hg xbps-templates
> $ cd xbps-templates/xbps-src && make install clean (uses
> PREFIX?=/usr/local by default)
>
> Edit your preferences in $PREFIX/etc/xbps-src.conf
>
> Install the toolchain for the chroot:
>
> $ cd xbps-templates/srcpkgs/xbps-base-chroot && xbps-src install
>
> From now on you can build any package available in srcpkgs.
>

I've followed the instructions from there already, and also
http://groups.google.com/group/xbps/browse_thread/thread/683eaf32e1a32595.
one of the problems is that my kernel on rhel5 is apparently too old
so fakeroot something or other fails and the xbps-base-chroot never
gets installed

i had to manually install libcap2 (the most recent version) and modify
the makefile for xbps-src to look for setcap for it to install. i
think im wanting to do something outside the scope of your original
design. and that is i want to be able to build and install packages
purely as a user without ever needing root. i think to do that i will
need to rebuild everything from scratch and modify a few packages. i
ultimately want something that works as a normal user without needing
to rely on a root user or sysadmin to install things for me :)

thanks,
jimmy

Juan Romero Pardines

unread,
May 4, 2010, 2:57:01 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy <jcf...@gmail.com>:
> hi
>
> I've just started to play with xbps-src to try and build packages, and
> based on some initial observations. I have a few questions and remarks
> to make. firstly it appears that the packages that are built in a
> chroot, and i had some minor issues with getting xbps-src to installed/
> configured etc... would a better setup be to have *all* the basic
> dependancies needed to get xbps and xbps-src packaged up. and have the
> xbps-static package packed up as a gzip'd tarball install of a xz
> archive. it would make bootstrapping much easier. and also does xbps
> support src packages like in the rpm format? so i can bundle up an
> entire source tarball + patches and whatever metadata file is needed
> to rebuild a package (for archival purposes)

There is no support for source packages right now. All source packages
are in the
xbps-src mercurial repo, in the srcpkgs directory. You have to fetch
it all, but in the
future probably I'll provide source packages.

Juan Romero Pardines

unread,
May 4, 2010, 2:59:09 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:

> I've followed the instructions from there already, and also
> http://groups.google.com/group/xbps/browse_thread/thread/683eaf32e1a32595.
> one of the problems is that my kernel on rhel5 is apparently too old
> so fakeroot something or other fails and the xbps-base-chroot never
> gets installed
>
> i had to manually install libcap2 (the most recent version) and modify
> the makefile for xbps-src to look for setcap for it to install. i
> think im wanting to do something outside the scope of your original
> design. and that is i want to be able to build and install packages
> purely as a user without ever needing root. i think to do that i will
> need to rebuild everything from scratch and modify a few packages. i
> ultimately want something that works as a normal user without needing
> to rely on a root user or sysadmin to install things for me :)

Building packages with your user is supported. You only have to enable
XBPS_USE_CAPABILITIES in xbps-src.conf and pray for your kernel
be supported with fakeroot :-)

Also the kernel needs to have support for file capabilities, and the
target filesystem
must support extended attributes.

Juan Romero Pardines

unread,
May 4, 2010, 3:03:38 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Juan Romero Pardines <xtr...@gmail.com>:

> Building packages with your user is supported. You only have to enable
> XBPS_USE_CAPABILITIES in xbps-src.conf and pray for your kernel
> be supported with fakeroot :-)

You can also install pkgs with your user via fakeroot, i.e "fakeroot
-- xbps-bin -r ~/blah install foo"
but the XBPS packages are not meant to be installed for single users, this is
a package manager for the system and as such cannot coexist with RPM,
dpkg or whatever.

A reason is that all packages are built with prefix=/usr.

Jimmy Tang

unread,
May 4, 2010, 3:04:26 PM5/4/10
to xb...@googlegroups.com
> Building packages with your user is supported. You only have to enable
> XBPS_USE_CAPABILITIES in xbps-src.conf and pray for your kernel
> be supported with fakeroot :-)
>
> Also the kernel needs to have support for file capabilities, and the
> target filesystem
> must support extended attributes.
>

I think rhel supports all of this, but it all fails on rhel5

ESC[1m=> Required dependencies for xbps-base-chroot-0.16...
ESC[m xbps-base-files>=0: not found.
bash>=0: not found.
patch>=0: not found.
make>=0: not found.
file>=4.90: not found.
tar>=0: not found.
chroot-grep>=0: not found.
gcc>=4.4.0: not found.
glibc>=2.8: not found.
busybox-initramfs>=0: not found.
fakeroot>=0: not found.
ESC[1m=> Installing xbps-base-chroot dependency: xbps-base-files.
ESC[m/home/jtang/XPBS/usr/local/share/xbps-src/shutils/builddep_funcs.sh:
line 222: xbps-uhelper.static: command not found
/home/jtang/XPBS/usr/local/share/xbps-src/shutils/builddep_funcs.sh:
line 225: xbps-uhelper.static: command not found
/home/jtang/XPBS/usr/local/share/xbps-src/shutils/pkgtarget_funcs.sh:
line 56: xbps-uhelper.static: command not found
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ESC[1m=> Running build phase for xbps-base-files-0.35.
ESC[mERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be
preloaded: ignored.
/home/jtang/XPBS/usr/local/share/xbps-src/shutils/init_funcs.sh: line
67: xbps-uhelper.static: command not found
/home/jtang/XPBS/usr/local/share/xbps-src/shutils/init_funcs.sh: line
68: xbps-uhelper.static: command not found
ESC[1m=> Running install phase for xbps-base-files-0.35.


and so on.... :P, i will need to poke at this more


jimmy

Juan Romero Pardines

unread,
May 4, 2010, 3:06:19 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:
>> Building packages with your user is supported. You only have to enable
>> XBPS_USE_CAPABILITIES in xbps-src.conf and pray for your kernel
>> be supported with fakeroot :-)
>>
>> Also the kernel needs to have support for file capabilities, and the
>> target filesystem
>> must support extended attributes.
>>
>
> I think rhel supports all of this, but it all fails on rhel5
>
> ESC[1m=> Required dependencies for xbps-base-chroot-0.16...
> ESC[m  xbps-base-files>=0: not found.
>  bash>=0: not found.
>  patch>=0: not found.
>  make>=0: not found.
>  file>=4.90: not found.
>  tar>=0: not found.
>  chroot-grep>=0: not found.
>  gcc>=4.4.0: not found.
>  glibc>=2.8: not found.
>  busybox-initramfs>=0: not found.
>  fakeroot>=0: not found.
> ESC[1m=> Installing xbps-base-chroot dependency: xbps-base-files.
> ESC[m/home/jtang/XPBS/usr/local/share/xbps-src/shutils/builddep_funcs.sh:
> line 222: xbps-uhelper.static: command not found

This is the problem, are the xbps-*.static programs accessible via PATH?

Jimmy Tang

unread,
May 4, 2010, 3:09:40 PM5/4/10
to xb...@googlegroups.com
yeap

[jtang@duo srcpkgs]$ which xbps-bin.static
~/XPBS/usr/local/sbin/xbps-bin.static

but again i am experimenting with having everything installed and
running as me and i've tried not to do things that require root access
at any point (the only point so far that needed root access was
installing xbps-src)


jimmy

Juan Romero Pardines

unread,
May 4, 2010, 3:11:27 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:

> [jtang@duo srcpkgs]$ which xbps-bin.static
> ~/XPBS/usr/local/sbin/xbps-bin.static
>
> but again i am experimenting with having everything installed and
> running as me and i've tried not to do things that require root access
> at any point (the only point so far that needed root access was
> installing xbps-src)

Yes, that's only required if you use the default PREFIX which is /usr/local.
After that if you uncomment XBPS_USE_CAPABILITIES from xbps-src.conf
you don't need to be root anymore.

Jimmy Tang

unread,
May 4, 2010, 3:20:30 PM5/4/10
to xb...@googlegroups.com
On Tue, May 4, 2010 at 8:11 PM, Juan Romero Pardines <xtr...@gmail.com> wrote:
>
> Yes, that's only required if you use the default PREFIX which is /usr/local.
> After that if you uncomment XBPS_USE_CAPABILITIES from xbps-src.conf
> you don't need to be root anymore.
>


okies, well i can safely say the this feature is pretty borked on
rhel5 and it doesnt work :) after a few hours of messing with it i
like it as a system level package manager. i think i might spend abit
more time at poking at it to make it work 100% at the user level even
if it means have coded paths in the template files.


thanks
jimmy

Juan Romero Pardines

unread,
May 4, 2010, 3:21:51 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:

> okies, well i can safely say the this feature is pretty borked on
> rhel5 and it doesnt work :) after a few hours of messing with it i
> like it as a system level package manager. i think i might spend abit
> more time at poking at it to make it work 100% at the user level even
> if it means have coded paths in the template files.

No problem, I shall have better documentation for future users :-)

Juan Romero Pardines

unread,
May 4, 2010, 3:52:46 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Juan Romero Pardines <xtr...@gmail.com>:
> 2010/5/4 Jimmy Tang <jcf...@gmail.com>:
>
>> okies, well i can safely say the this feature is pretty borked on
>> rhel5 and it doesnt work :) after a few hours of messing with it i
>> like it as a system level package manager. i think i might spend abit
>> more time at poking at it to make it work 100% at the user level even
>> if it means have coded paths in the template files.
>
> No problem, I shall have better documentation for future users :-)

I added a note about this in the wiki, probably you are affected and your kernel
doesn't support `POSIX.1e File capabilities` which was added in 2.6.24.

http://code.google.com/p/xbps/wiki/HowtoBuildPackagesAsNormalUser

Jimmy Tang

unread,
May 4, 2010, 5:27:44 PM5/4/10
to xb...@googlegroups.com
On Tue, May 4, 2010 at 8:11 PM, Juan Romero Pardines <xtr...@gmail.com> wrote:
> 2010/5/4 Jimmy Tang <jcf...@gmail.com>:
>
>> [jtang@duo srcpkgs]$ which xbps-bin.static
>> ~/XPBS/usr/local/sbin/xbps-bin.static
>>
>> but again i am experimenting with having everything installed and
>> running as me and i've tried not to do things that require root access
>> at any point (the only point so far that needed root access was
>> installing xbps-src)
>
> Yes, that's only required if you use the default PREFIX which is /usr/local.
> After that if you uncomment XBPS_USE_CAPABILITIES from xbps-src.conf
> you don't need to be root anymore.
>

im just wondering if somewhere in xbps-src the environment variable is
just getting overrided somewhere such that user defined paths are
dropped.


jimmy.

Juan Romero Pardines

unread,
May 4, 2010, 5:39:51 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:

> im just wondering if somewhere in xbps-src the environment variable is
> just getting overrided somewhere such that user defined paths are
> dropped.

Hmm now that you say that, I've found in xbps-src/shutils/tmpl_funcs.sh:

if [ -z "$in_chroot" ]; then
export PATH="$XBPS_MASTERDIR/bin:$XBPS_MASTERDIR/sbin"
export PATH="$PATH:$XBPS_MASTERDIR/usr/bin"
export PATH="$PATH:$XBPS_MASTERDIR/usr/sbin"
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin"
export PATH="$PATH:/usr/local/sbin"
fi

Try to change it to the following:

export _PATH="$XBPS_MASTERDIR/bin:$XBPS_MASTERDIR/sbin"
export _PATH="$_PATH:$XBPS_MASTERDIR/usr/bin"
export _PATH="$_PATH:$XBPS_MASTERDIR/usr/sbin"
export _PATH="$_PATH:/bin:/sbin:/usr/bin:/usr/sbin"
export _PATH="$_PATH:/usr/local/sbin"
export PATH="$_PATH:$PATH"

Jimmy Tang

unread,
May 4, 2010, 5:47:13 PM5/4/10
to xb...@googlegroups.com
that kinda did the trick, but alas (where it freezes)

+ echo '</plist>'
+ '[' '!' -d /home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/var/db/xbps/metadata/xbps-base-files
']'
+ '[' -s /tmp/flist.cjsMz19878 ']'
+ mv -f /tmp/flist.cjsMz19878
/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/var/db/xbps/metadata/xbps-base-files/flist
+ mv -f /tmp/fplist.bYHQC19879
/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist
+ mv -f /tmp/fprops.fghUP20238
/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/props.plist
+ xbps-uhelper.static -r /home/jtang/xbps-templates/masterdir
sanitize-plist /home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist



it just hangs there.


jimmy

Jimmy Tang

unread,
May 4, 2010, 5:49:28 PM5/4/10
to xb...@googlegroups.com
on that note....


[jtang@duo xbps-src]$ strace xbps-uhelper.static -r
/home/jtang/xbps-templates/masterdir sanitize-plist
/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist
execve("/home/jtang/XPBS/usr/local/sbin/xbps-uhelper.static",
["xbps-uhelper.static", "-r", "/home/jtang/xbps-templates/maste",
"sanitize-plist", "/home/jtang/xbps-templates/maste"], [/* 55 vars
*/]) = 0
uname({sys="Linux", node="duo", ...}) = 0
brk(0) = 0x1eeca000
brk(0x1eecaf60) = 0x1eecaf60
arch_prctl(ARCH_SET_FS, 0x1eeca890) = 0
brk(0x1eeebf60) = 0x1eeebf60
brk(0x1eeec000) = 0x1eeec000
access("/etc/selinux/", F_OK) = 0
open("/etc/selinux/config", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=447, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b980504e000
read(3, "# This file controls the state o"..., 4096) = 447
read(3, "", 4096) = 0
close(3) = 0
munmap(0x2b980504e000, 4096) = 0
open("/proc/mounts", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b980504f000
read(3, "rootfs / rootfs rw 0 0\n/dev/root"..., 4096) = 882
read(3, "", 4096) = 0
close(3) = 0
munmap(0x2b980504f000, 4096) = 0
open("/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist",
O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0600, st_size=10530, ...}) = 0
mmap(NULL, 12288, PROT_READ, MAP_SHARED, 3, 0) = 0x2b9805050000
close(3) = 0
madvise(0x2b9805050000, 12288, MADV_SEQUENTIAL) = 0
futex(0x1eecbf0c, FUTEX_WAIT, 0, NULL



looks like a pthread problem?

Juan Romero Pardines

unread,
May 4, 2010, 5:51:56 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:

> + xbps-uhelper.static -r /home/jtang/xbps-templates/masterdir

Can you send me
"/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist"
xbps-uhelper.static bin? probably any of them is corrupt.

I'll try to reproduce and debug the problem.

Juan Romero Pardines

unread,
May 4, 2010, 5:53:49 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:
Yes or also it might be selinux blocking mmap/madvise syscalls as well!

Juan Romero Pardines

unread,
May 4, 2010, 5:57:01 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Juan Romero Pardines <xtr...@gmail.com>:

>> looks like a pthread problem?

Which kernel and glibc are you using? is it using NPTL right?

Juan Romero Pardines

unread,
May 4, 2010, 6:00:06 PM5/4/10
to xb...@googlegroups.com
2010/5/4 Jimmy Tang <jcf...@gmail.com>:

> [jtang@duo xbps-src]$ strace xbps-uhelper.static -r

Erm, forgot to say please also use strace -f to trace child processes.

Jimmy Tang

unread,
May 4, 2010, 6:19:26 PM5/4/10
to xb...@googlegroups.com
On Tue, May 4, 2010 at 11:00 PM, Juan Romero Pardines <xtr...@gmail.com> wrote:
> 2010/5/4 Jimmy Tang <jcf...@gmail.com>:
>
>> [jtang@duo xbps-src]$ strace xbps-uhelper.static -r
>
> Erm, forgot to say please also use strace -f to trace child processes.
>

here's the trace...

[jtang@duo xbps-src]$ strace -f xbps-uhelper.static -r
/home/jtang/xbps-templates/masterdir sanitize-plist
/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist
execve("/home/jtang/XPBS/usr/local/sbin/xbps-uhelper.static",
["xbps-uhelper.static", "-r", "/home/jtang/xbps-templates/maste",
"sanitize-plist", "/home/jtang/xbps-templates/maste"], [/* 55 vars
*/]) = 0
uname({sys="Linux", node="duo", ...}) = 0
brk(0) = 0x2269000
brk(0x2269f60) = 0x2269f60
arch_prctl(ARCH_SET_FS, 0x2269890) = 0
brk(0x228af60) = 0x228af60
brk(0x228b000) = 0x228b000
access("/etc/selinux/", F_OK) = 0
open("/etc/selinux/config", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=447, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b2e1d9a4000
read(3, "# This file controls the state o"..., 4096) = 447
read(3, "", 4096) = 0
close(3) = 0
munmap(0x2b2e1d9a4000, 4096) = 0
open("/proc/mounts", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b2e1d9a5000
read(3, "rootfs / rootfs rw 0 0\n/dev/root"..., 4096) = 882
read(3, "", 4096) = 0
close(3) = 0
munmap(0x2b2e1d9a5000, 4096) = 0
open("/home/jtang/xbps-templates/masterdir/pkg-destdir/xbps-base-files-0.35/files.plist",
O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0600, st_size=10530, ...}) = 0
mmap(NULL, 12288, PROT_READ, MAP_SHARED, 3, 0) = 0x2b2e1d9a6000
close(3) = 0
madvise(0x2b2e1d9a6000, 12288, MADV_SEQUENTIAL) = 0
futex(0x226af0c, FUTEX_WAIT, 0, NULL) = -1 EINTR (Interrupted system call)


selinux is disabled...

[jtang@duo xbps-src]$ /usr/sbin/getenforce
Disabled
[jtang@duo xbps-src]$


and...

[jtang@duo xbps-src]$ rpm -qa | egrep 'kernel|glibc'
kernel-devel-2.6.18-128.4.1.el5.x86_64
kernel-module-fuse-2.6.18-128.4.1.el5-2.6.3-1.sl5.x86_64
kernel-xen-2.6.18-128.4.1.el5.x86_64
kernel-xen-devel-2.6.18-128.7.1.el5.x86_64
kernel-xen-devel-2.6.18-164.2.1.el5.x86_64
kernel-devel-2.6.18-128.7.1.el5.x86_64
kernel-devel-2.6.18-164.11.1.el5.x86_64
compat-glibc-headers-2.3.4-2.26.x86_64
glibc-2.5-42.i686
kernel-2.6.18-164.2.1.el5.x86_64
kernel-headers-2.6.18-164.11.1.el5.x86_64
glibc-headers-2.5-42.x86_64
kernel-devel-2.6.18-164.2.1.el5.x86_64
kernel-2.6.18-128.7.1.el5.x86_64
kernel-xen-devel-2.6.18-164.11.1.el5.x86_64
kernel-xen-devel-2.6.18-128.4.1.el5.x86_64
glibc-2.5-42.x86_64
glibc-devel-2.5-42.x86_64
kernel-module-fuse-2.6.18-128.4.1.el5xen-2.6.3-1.sl5.x86_64
kernel-module-fuse-2.6.18-128.7.1.el5xen-2.6.3-1.sl5.x86_64
kernel-xen-2.6.18-128.7.1.el5.x86_64
kernel-2.6.18-164.11.1.el5.x86_64
kernel-module-fuse-2.6.18-128.7.1.el5-2.6.3-1.sl5.x86_64
glibc-common-2.5-42.x86_64
glibc-devel-2.5-42.i386
kernel-xen-2.6.18-164.2.1.el5.x86_64
kernel-2.6.18-128.4.1.el5.x86_64
kernel-xen-2.6.18-164.11.1.el5.x86_64


everything is quite recent, mind you typically rhel5 the kernel
version is quite misleading they back port lots of changes from more
recent kernels, so even though the kernel is 2.6.18 it might really be
more like a 2.6.2x something or so...


jimmy

Juan Romero Pardines

unread,
May 4, 2010, 6:32:42 PM5/4/10
to xb...@googlegroups.com
2010/5/5 Jimmy Tang <jcf...@gmail.com>:

> everything is quite recent, mind you typically rhel5 the kernel
> version is quite misleading they back port lots of changes from more
> recent kernels, so even though the kernel is 2.6.18 it might really be
> more like a 2.6.2x something or so...

Ok, can you build from mercurial repo the xbps-uhelper.static binary and
send me it? I'll try to investigate.

Juan Romero Pardines

unread,
May 4, 2010, 6:33:27 PM5/4/10
to xb...@googlegroups.com
2010/5/5 Juan Romero Pardines <xtr...@gmail.com>:
> 2010/5/5 Jimmy Tang <jcf...@gmail.com>:
>
>> everything is quite recent, mind you typically rhel5 the kernel
>> version is quite misleading they back port lots of changes from more
>> recent kernels, so even though the kernel is 2.6.18 it might really be
>> more like a 2.6.2x something or so...
>
> Ok, can you build from mercurial repo the xbps-uhelper.static binary and
> send me it? I'll try to investigate.

Erm, please build it with debugging symbols, i.e "make DEBUG=1".

Thanks.

Juan Romero Pardines

unread,
May 4, 2010, 6:38:18 PM5/4/10
to xb...@googlegroups.com
2010/5/5 Juan Romero Pardines <xtr...@gmail.com>:

> Erm, please build it with debugging symbols, i.e "make DEBUG=1".

As last test, could you please download the x86_64 binary pkg and try it in
your system? I want to know if it's a glibc or kernel issue.

Get it from http://xbps.nopcode.org/repos/stable/x86_64/xbps-static-0.5.0.xbps

Unpack it with 'tar xvfJ", and use the xbps-uhelper.static binary as before.

Juan Romero Pardines

unread,
May 4, 2010, 6:39:56 PM5/4/10
to xb...@googlegroups.com
2010/5/5 Juan Romero Pardines <xtr...@gmail.com>:
> 2010/5/5 Juan Romero Pardines <xtr...@gmail.com>:
>
>> Erm, please build it with debugging symbols, i.e "make DEBUG=1".
>
> As last test, could you please download the x86_64 binary pkg and try it in
> your system? I want to know if it's a glibc or kernel issue.
>
> Get it from http://xbps.nopcode.org/repos/stable/x86_64/xbps-static-0.5.0.xbps

Erm, this should be:

http://xbps.nopcode.org/repos/stable/x86_64/xbps-static-0.5.0.x86_64.xbps

Juan Romero Pardines

unread,
May 4, 2010, 6:50:50 PM5/4/10
to xb...@googlegroups.com
Really I've been using and developping XBPS on different Linux
distributions and never
found this hang, I used Arch Linux, Ubuntu, Debian, Fedora, etc. All
worked fine, even
the distribution built with XBPS never had a problem.

I've just read something about RHEL5 having problems with futexes, not
sure if you
are hitting this one... do you have latest packages installed or such?

Also I cannot see this part of code where yours is hanging, so must be something
specific in your system.

Note that I've been using the XBPS distribution on real hardware for 1
year already,
updating newer kernels, glibc, etc. Both on i386 and x86_64... so I'd
guess the problem
lies in some bug in RHEL kernel or glibc.

Jimmy Tang

unread,
May 4, 2010, 6:51:52 PM5/4/10
to xb...@googlegroups.com
just tried it with the above package and it does...

[jtang@duo ~]$ strace /tmp/sbin/xbps-bin.static -r XBPS -f install xbps
execve("/tmp/sbin/xbps-bin.static", ["/tmp/sbin/xbps-bin.static",
"-r", "XBPS", "-f", "install", "xbps"], [/* 55 vars */]) = 0
uname({sys="Linux", node="duo", ...}) = 0
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 3
writev(3, [{"FATAL: kernel too old\n", 22}], 1FATAL: kernel too old
) = 22
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
[jtang@duo ~]$

attached is my build of the file...


jimmy
xbps-uhelper.static.bz2

Jimmy Tang

unread,
May 4, 2010, 6:55:24 PM5/4/10
to xb...@googlegroups.com
On Tue, May 4, 2010 at 11:50 PM, Juan Romero Pardines <xtr...@gmail.com> wrote:
> Really I've been using and developping XBPS on different Linux
> distributions and never
> found this hang, I used Arch Linux, Ubuntu, Debian, Fedora, etc. All
> worked fine, even
> the distribution built with XBPS never had a problem.
>
> I've just read something about RHEL5 having problems with futexes, not
> sure if you
> are hitting this one... do you have latest packages installed or such?
>
> Also I cannot see this part of code where yours is hanging, so must be something
> specific in your system.
>
> Note that I've been using the XBPS distribution on real hardware for 1
> year already,
> updating newer kernels, glibc, etc. Both on i386 and x86_64... so I'd
> guess the problem
> lies in some bug in RHEL kernel or glibc.
>


yea it looks like that is the cause, my system is pretty up to date...
(as of a few weeks ago since i last updated), i reckon its some weird
issue with the different threading models that rhel5 uses and what
other linuxes uses. rhel tends to try and preserve a lot of
compatibility with older code. hopefully rhel6 will be more up to date
:P

i guess i will have to put off trying stuff with xbps till rhel6 is
out. my next thing to try is to try xbps on my mac :) in all i think
this was a worthwhile experiment.


jimmy

Juan Romero Pardines

unread,
May 4, 2010, 7:00:13 PM5/4/10
to xb...@googlegroups.com
2010/5/5 Jimmy Tang <jcf...@gmail.com>:
> just tried it with the above package and it does...
>
> [jtang@duo ~]$ strace /tmp/sbin/xbps-bin.static  -r XBPS -f install xbps
> execve("/tmp/sbin/xbps-bin.static", ["/tmp/sbin/xbps-bin.static",
> "-r", "XBPS", "-f", "install", "xbps"], [/* 55 vars */]) = 0
> uname({sys="Linux", node="duo", ...})   = 0
> open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 3
> writev(3, [{"FATAL: kernel too old\n", 22}], 1FATAL: kernel too old
> ) = 22
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++
> [jtang@duo ~]$
>
> attached is my build of the file...

Ah I know what happens. The binaries are built with minimal kernel
version >= 2.6.27:

/sbin/xbps-bin.static: ELF 64-bit LSB executable, x86-64, version 1
(SYSV), statically linked, for GNU/Linux 2.6.27, stripped

So you were unlucky :-)

Juan Romero Pardines

unread,
May 4, 2010, 7:22:26 PM5/4/10
to xb...@googlegroups.com
2010/5/5 Juan Romero Pardines <xtr...@gmail.com>:

> Ah I know what happens. The binaries are built with minimal kernel
> version >= 2.6.27:
>
> /sbin/xbps-bin.static: ELF 64-bit LSB executable, x86-64, version 1
> (SYSV), statically linked, for GNU/Linux 2.6.27, stripped
>
> So you were unlucky :-)

If you are bored you can try the live image and play with XBPS:

http://xbps.nopcode.org/live/xbps-live-x86_64-20100430.iso

SHA256: 9d3e03b5f64c9b31499940d96bd167b21832b9295816e92b69cb13253fe43cf5

You'll see that everything works :-)
Reply all
Reply to author
Forward
0 new messages