commit: 223cb3f0f4555a092212ef244547a59bc20fbbde Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> AuthorDate: Fri Jun 3 08:06:45 2016 +0000 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> CommitDate: Wed Jun 15 11:32:36 2016 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=223cb3f0
scripts/b-p.sh: calculate kernel version and select legacy profiles. scripts/bootstrap-prefix.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 6a1f3cd..90a7f03 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -10,6 +10,8 @@ einfo() { echo "* $*"; } is-rap() { [[ ${BASH_SOURCE} = *rap.sh ]]; } rapx() { is-rap && echo $1 || echo $2; } get_libdir() { portageq envvar LIBDIR_$(portageq envvar ABI) || echo lib; } +kver() { uname -r|cut -d\- -f1|awk -F. '{for (i=1; i<=NF; i++){s+=lshift($i,(4-i)*8)};print s}'; } +profile-legacy() { [[ $(kver) -ge 33955840 ]] || echo /legacy; } # prefer gtar over tar [[ x$(type -t gtar) == "xfile" ]] \ @@ -267,6 +269,7 @@ EOF ln -sf {,"${ROOT}"}/etc/group [[ -f ${ROOT}/etc/resolv.conf ]] || ln -s {,"${ROOT}"}/etc/resolv.conf [[ -f ${ROOT}/etc/hosts ]] || cp {,"${ROOT}"}/etc/hosts + local legacy=$(profile-legacy) fi local linux=$(rapx linux-standalone linux) @@ -296,22 +299,22 @@ EOF profile="prefix/darwin/macos/10.$((rev - 4))/x64" ;; i*86-pc-linux-gnu) - profile="prefix/${linux}/x86" + profile="prefix/${linux}/x86${legacy}" ;; x86_64-pc-linux-gnu) - profile="prefix/${linux}/amd64" + profile="prefix/${linux}/amd64${legacy}" ;; ia64-pc-linux-gnu) - profile="prefix/${linux}/ia64" + profile="prefix/${linux}/ia64${legacy}" ;; powerpc-unknown-linux-gnu) - profile="prefix/${linux}/ppc" + profile="prefix/${linux}/ppc${legacy}" ;; powerpc64-unknown-linux-gnu) - profile="prefix/${linux}/ppc64" + profile="prefix/${linux}/ppc64${legacy}" ;; armv7l-pc-linux-gnu) - profile="prefix/${linux}/arm" + profile="prefix/${linux}/arm${legacy}" ;; sparc-sun-solaris2.9) profile="prefix/sunos/solaris/5.9/sparc"