Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 650448 - bootstrap-prefix.sh calls bootstrap_stage1_log directly in interactive mode, leaving necessary variables unset
Summary: bootstrap-prefix.sh calls bootstrap_stage1_log directly in interactive mode, ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-14 00:42 UTC by Jeremiah O'Neil
Modified: 2018-03-19 11:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremiah O'Neil 2018-03-14 00:42:46 UTC
regression: commit bdb73088dff33872b9f18a81fcc353aacab2e4c2
scripts/bootstrap-prefix
@@ -2488,7 +2492,7 @@ EOF
 	fi
 	
 	if ! [[ -x ${EPREFIX}/usr/lib/portage/bin/emerge || -x ${EPREFIX}/tmp/usr/lib/portage/bin/emerge || -x ${EPREFIX}/tmp/usr/bin/emerge  ]] \
-			&& ! ${BASH} ${BASH_SOURCE[0]} "${EPREFIX}" stage1_log ; then
+			&& ! bootstrap_stage1_log ; then
 		# stage 1 fail
 		cat << EOF


Calling bootstrap_stage1_log here, instead of through the stage1_log argument to the script, leaves necessary variables undefined. Lacking $GNU_URL, the script fails with "!!! downloading /bash/bash-4.2.tar.gz failed!", etc.
Comment 1 Fabian Groffen gentoo-dev 2018-03-14 08:50:11 UTC
Oh, oops!  I tested it against a mirror.

Will look into this ASAP.

Thanks for the report.
Comment 2 Larry the Git Cow gentoo-dev 2018-03-14 09:07:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=7fa0395a9aff1785a8836ec0b7d0518a9d9c41b1

commit 7fa0395a9aff1785a8836ec0b7d0518a9d9c41b1
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2018-03-14 09:06:11 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2018-03-14 09:06:11 +0000

    scripts/bootstrap-prefix: ensure generic vars are initialised
    
    Since stage1 is now called directly from interactive, we need to ensure
    the generic variables are set.
    
    Closes: https://bugs.gentoo.org/650448

 scripts/bootstrap-prefix.sh | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 3 Jeremiah O'Neil 2018-03-14 17:19:01 UTC
Happy to help!

There's still a problem: ROOT is now set after the generic variables, many of which depend on the value of ROOT. Now the script fails for me at bootstrap_libffi with a permission error, because DISTDIR is /usr/portage/distfiles (expected: ${EPREFIX}/usr/portage/distfiles).
Comment 4 Benda Xu gentoo-dev 2018-03-19 11:53:20 UTC
I think calling stage1 with `bash --noprofile --norc` will work.  Then we can keep the traditional structure of the script.
Comment 5 Larry the Git Cow gentoo-dev 2018-03-19 11:55:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=75393f50a8aebb373d1edb410408b981c397d53d

commit 75393f50a8aebb373d1edb410408b981c397d53d
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2018-03-19 11:53:53 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2018-03-19 11:53:53 +0000

    scripts/bootstrap-prefix: ensure we set helper vars after setting ROOT
    
    This should fix another issue reported by Jeremiah O'Neil that was
    introduced by the previous fix.  I didn't pay attention well enough to
    the order of things.  Now it should work better.
    
    Closes: https://bugs.gentoo.org/650448

 scripts/bootstrap-prefix.sh | 44 +++++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 19 deletions(-)