Skip to content

Commit 6e8a0ea

Browse files
lu-zerochewi
authored andcommitted
Initial support for overriding profile
Closes: https://bugs.gentoo.org/748975 Closes: #22 Signed-off-by: James Le Cuirot <[email protected]>
1 parent bfe51a2 commit 6e8a0ea

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

crossdev

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ SHOW_FAIL_LOG="no"
945945
SHOW_TARGET_CFG="no"
946946
INIT_TARGET_ONLY="no"
947947
LLVM="no"
948+
PROFILE="embedded"
948949

949950
while [[ $# -gt 0 ]] ; do
950951
case $1 in
@@ -987,6 +988,7 @@ while [[ $# -gt 0 ]] ; do
987988
--cpkg) shift; CPKG=$1;;
988989
-ox|--ov-extra) shift; XOVLS+=( "$1" );;
989990
--env) shift; AENV=$1;;
991+
--profile) shift; PROFILE=$1;;
990992
-L|--llvm) LLVM="yes";;
991993
-A|--abis) shift; MULTILIB_ABIS=$1;;
992994
--host-abi) shift; HOST_ABI=$1;;
@@ -1607,7 +1609,7 @@ hr
16071609
### Create links for helper scripts ###
16081610

16091611
xmkdir -p "${EPREFIX}"/usr/${CTARGET}
1610-
LLVM="${LLVM}" emerge-wrapper --target ${CTARGET} --init || exit 1
1612+
LLVM="${LLVM}" emerge-wrapper --target "${CTARGET}" --init --profile "${PROFILE}" || exit 1
16111613

16121614
#############################################################
16131615
### 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
@@ -131,6 +130,7 @@ cross_wrap()
131130
if [[ -d ${SYSROOT} ]] && [[ ! -d ${SYSROOT}/etc ]] ; then
132131
cross_wrap_etc "$@"
133132
fi
133+
PORTAGE_CONFIGROOT=${SYSROOT} eselect profile set --force "${PROFILE}"
134134
return $?
135135
}
136136

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

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

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

0 commit comments

Comments
 (0)