Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A problem when installing Gentoo prefix at bootstrap stage 3
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Zedong Bi
n00b
n00b


Joined: 30 Jul 2014
Posts: 2

PostPosted: Wed Jul 30, 2014 6:16 pm    Post subject: A problem when installing Gentoo prefix at bootstrap stage 3 Reply with quote

Hi all,

I'm installing Gentoo prefix by running bootstrap-prefix.sh. Everything went fine, but I went wrong when installing sed-4.2.1.tar.bz2 at bootstrap stage 3. The error messages are as follows:

>>> Emerging (1 of 1) sys-apps/sed-4.2.1-r1
* sed-4.2.1.tar.bz2 SHA256 SHA512 size ;-) ... [ ok ]
>>> Unpacking source...
>>> Unpacking sed-4.2.1.tar.bz2 to /home/zdbee/gentoo/var/tmp/portage/sys-apps/sed-4.2.1-r1/work
tar: sed-4.2.1/COPYING.DOC: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/linecnt.sed: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/numsub3.sed: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/numsub.inp: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/xbxcx3.sed: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/newjis.good: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/numsub4.sed: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/uniq.sed: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/xbxcx.inp: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/modulo.inp: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/testsuite/khadafy.sed: Cannot change ownership to uid 501, gid 501: Operation not permitted

................................. many errors like this........................................................................

tar: sed-4.2.1/BUGS: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/NEWS: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/bootstrap.sh: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1/aclocal.m4: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: sed-4.2.1: Cannot change ownership to uid 501, gid 501: Operation not permitted
tar: Error exit delayed from previous errors
* ERROR: sys-apps/sed-4.2.1-r1::gentoo_prefix failed (unpack phase):
* failure unpacking sed-4.2.1.tar.bz2
*
* Call stack:
* ebuild.sh, line 93: Called src_unpack
* environment, line 2389: Called unpack 'sed-4.2.1.tar.bz2'
* phase-helpers.sh, line 366: Called __unpack_tar 'bzip2 -d'
* phase-helpers.sh, line 299: Called __assert_sigpipe_ok 'failure unpacking sed-4.2.1.tar.bz2'
* isolated-functions.sh, line 39: Called die
* The specific snippet of code:
* [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
*
* If you need support, post the output of `emerge --info '=sys-apps/sed-4.2.1-r1::gentoo_prefix'`,
* the complete build log and the output of `emerge -pqv '=sys-apps/sed-4.2.1-r1::gentoo_prefix'`.
* The complete build log is located at '/home/zdbee/gentoo/var/tmp/portage/sys-apps/sed-4.2.1-r1/temp/build.log'.
* The ebuild environment file is located at '/home/zdbee/gentoo/var/tmp/portage/sys-apps/sed-4.2.1-r1/temp/environment'.
* Working directory: '/home/zdbee/gentoo/var/tmp/portage/sys-apps/sed-4.2.1-r1/work'
* S: '/home/zdbee/gentoo/var/tmp/portage/sys-apps/sed-4.2.1-r1/work/sed-4.2.1'

>>> Failed to emerge sys-apps/sed-4.2.1-r1, Log file:

>>> '/home/zdbee/gentoo/var/tmp/portage/sys-apps/sed-4.2.1-r1/temp/build.log'

* Messages for package sys-apps/sed-4.2.1-r1:

* ERROR: sys-apps/sed-4.2.1-r1::gentoo_prefix failed (unpack phase):
* failure unpacking sed-4.2.1.tar.bz2
*
* Call stack:
* ebuild.sh, line 93: Called src_unpack
* environment, line 2389: Called unpack 'sed-4.2.1.tar.bz2'
* phase-helpers.sh, line 366: Called __unpack_tar 'bzip2 -d'
* phase-helpers.sh, line 299: Called __assert_sigpipe_ok 'failure unpacking sed-4.2.1.tar.bz2'
* isolated-functions.sh, line 39: Called die
* The specific snippet of code:
* [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
*

Any ideas? Many thanks.
Back to top
View user's profile Send private message
natrix
Guru
Guru


Joined: 23 Aug 2013
Posts: 532

PostPosted: Thu Jul 31, 2014 3:21 am    Post subject: Reply with quote

Please, you show your:
Code:
 emerge --info
Back to top
View user's profile Send private message
Zedong Bi
n00b
n00b


Joined: 30 Jul 2014
Posts: 2

PostPosted: Thu Jul 31, 2014 8:36 am    Post subject: Reply with quote

Thank you for your reply. Unfortunately, when I typed
Code:
emerge --info

What I got was simply
Code:
-bash: emerge: command not found


However, I found a very interesting way to solve this problem. Just open the file
Code:
gedit ./gentoo/usr/lib/portage/bin/isolated-functions.sh

and comment out the following code
Code:
for x in $pipestatus ; do
      # Allow SIGPIPE through (128 + 13)
      [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
   done


I found it works!!

However, when I continue, I found that my gcc compilation fails during the configure stage:
Code:

checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.


From this page (https://forums.gentoo.org/viewtopic-t-297935.html), I know that this may be a common problem on AMD64 system. It also suggests to create a 32-bit sandbox and then emerge portage and gcc using the following command:
Code:
USE="multilib" FEATURES="-sandbox" emerge gcc portage

However, I barely know anything about Gentoo and Portage, I'm just trying to install Gentoo Prefix on a very old cluster (I don't have root privilege) to use new version of g++. So I have no idea on how to create a 32-bit sandbox and where to type the command above. Any further help, thanks.
Back to top
View user's profile Send private message
szamó
n00b
n00b


Joined: 16 Aug 2003
Posts: 9

PostPosted: Wed Sep 24, 2014 2:43 pm    Post subject: Reply with quote

The problem is the archive (sed-4.2.1.tar.bz2) contains files with user id (uid=501) and group id (gid=501). The bzip2 does not have an option like tar to ignore uid and gid (--no-same-owner), thus the phase-helper.sh unpacks files by bzip2 with uid and gid, and pipes everything to "tar xof", which should save the files by ignoring the uid and gid. Here is another problem: the o switch is overloaded in tar (at least in my tar v1.26-r1), it means --old-archive or --no-same-owner. It seems tar prefers --old-archive, so the uid and gid remains as is set in the archive. This is usually no problem, but usually fails if the root did not give the user (us) such right, which happens more often on mounted remote (not local) partitions.
The solution: when stage3 fails, replace each "tar xof" with "tar --no-same-owner -xf" in <PREFIX>/usr/lib/portage/bin/phase-helpers.sh.
This way the packages can be unpacked.

Note: it can also happen that the tar is too old. In this case a tar (and maybe xz) is needed. I compiled it myself and made it available for the bootstrap-prefix.sh, by editing <PREFIX>/etc/make.globals, adding the extra paths to EXTRA_PATH, before the "/usr/bin:/bin".


Last edited by szamó on Wed Sep 24, 2014 5:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
szamó
n00b
n00b


Joined: 16 Aug 2003
Posts: 9

PostPosted: Wed Sep 24, 2014 3:21 pm    Post subject: Reply with quote

I had a slighlty different problem:
Code:
configure: error: C compiler cannot create executables

I found a temporary solution. The problem is how another issue was solved, see https://bugs.gentoo.org/show_bug.cgi?id=473524. Shortly, there was an issue in older gcc, thus they added the -fgnu89-inline flag into profile.bashrc, which has no clue if this option is accepted by the gcc. I have gcc-3.4.6 on this old redhate4, which does not accept that option, and produced an error.
The solution: when stage3 fails, comment out the line
Code:
        CFLAGS="${CFLAGS} -fgnu89-inline" # for C only

it should look like:
Code:
#        CFLAGS="${CFLAGS} -fgnu89-inline" # for C only

in <PREFIX>/usr/portage/profiles/prefix/linux/profile.bashrc

I just got to the point when I got your error message:
Code:
checking whether the C compiler works... configure: error: cannot run C compiled programs.

If I find out anything, will post it here.
Back to top
View user's profile Send private message
szamó
n00b
n00b


Joined: 16 Aug 2003
Posts: 9

PostPosted: Thu Sep 25, 2014 12:41 pm    Post subject: Reply with quote

I just got to the point when I got your error message:
Code:
checking whether the C compiler works... configure: error: cannot run C compiled programs.

It happens because at this point PREFIX gentoo does not have gcc, but has ld from binutils. It uses the default gcc (which is v3.4.6 in my case), which uses the newer ld in PREFIX, and it seems the built result is not really good (causing floating point exception).
I tried to temporary replace default gcc with a self compiled v4.4.5 gcc as done earlier in case of tar: editing <PREFIX>/etc/make.globals, adding the extra paths to EXTRA_PATH before the "/usr/bin:/bin". Unfortunately this does not help.
It seems I can not install prefix on redhate4, it is indeed too old, and PREFIX does not support it.
Anyway, if someone succeeds installing PREFIX (for example on redhate5), then this method is worth trying: http://wiki.gentoo.org/wiki/Prefix/libc. It compiles even glibc, thus much newer packages can be installed as well (and as such, probably more portable). However I do not have time for that currently, and that page is one year old, no idea if its method still works.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum