Skip to content

Commit cd38540

Browse files
lu-zerokwhat
authored andcommitted
Initial support for overriding profile
Closes: https://bugs.gentoo.org/748975 Closes: gentoo#22 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
1 parent a097c40 commit cd38540

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

crossdev

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ SHOW_FAIL_LOG="no"
994994
SHOW_TARGET_CFG="no"
995995
INIT_TARGET_ONLY="no"
996996
LLVM="no"
997+
PROFILE="embedded"
997998

998999
while [[ $# -gt 0 ]] ; do
9991000
case $1 in
@@ -1051,6 +1052,7 @@ while [[ $# -gt 0 ]] ; do
10511052
--cpkg) shift; CPKG=$1;;
10521053
-ox|--ov-extra) shift; XOVLS+=( "$1" );;
10531054
--env) shift; AENV=$1;;
1055+
--profile) shift; PROFILE=$1;;
10541056
-L|--llvm) LLVM="yes";;
10551057
-A|--abis) shift; MULTILIB_ABIS=$1;;
10561058
--host-abi) shift; HOST_ABI=$1;;
@@ -1686,7 +1688,7 @@ hr
16861688
### Create links for helper scripts ###
16871689

16881690
xmkdir -p "${EPREFIX}"/usr/${CTARGET}
1689-
LLVM="${LLVM}" emerge-wrapper --target ${CTARGET} --init || exit 1
1691+
LLVM="${LLVM}" emerge-wrapper --target "${CTARGET}" --init --profile "${PROFILE}" || exit 1
16901692

16911693
#############################################################
16921694
### Create directories usually created by sys-apps/baselayout

wrappers/emerge-wrapper

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cross_wrap_etc()
3737
setup_warning=false
3838

3939
cp -a "${PREFIX}"/share/crossdev/etc ${SYSROOT}/ || return 1
40-
ln -snf "${MAIN_REPO_PATH}/profiles/embedded" "${SYSROOT}/etc/portage/make.profile" || return 1
4140

4241
local confs=(
4342
${SYSROOT}/etc/portage/make.conf
@@ -132,6 +131,7 @@ cross_wrap()
132131
if [[ -d ${SYSROOT} ]] && [[ ! -d ${SYSROOT}/etc ]] ; then
133132
cross_wrap_etc "$@"
134133
fi
134+
PORTAGE_CONFIGROOT=${SYSROOT} eselect profile set --force "${PROFILE}"
135135
return $?
136136
}
137137

@@ -160,12 +160,18 @@ CHOST=${CHOST%-emerge}
160160
CHOST=${CHOST#emerge-}
161161
export CHOST
162162

163+
PROFILE="embedded"
164+
163165
if [[ $1 == "--target" ]] ; then
164166
CHOST=$2
165167
shift 2
166168
fi
167169

168170
if [[ $1 == "--init" ]] ; then
171+
shift
172+
if [[ $1 == "--profile" ]] ; then
173+
PROFILE=$2
174+
fi
169175
cross_init
170176
exit $?
171177
fi

0 commit comments

Comments
 (0)