Skip to content

Commit

Permalink
productcompose: Build as root when using agama base iso
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jan 29, 2025
1 parent a4b10cb commit 216bea3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Build/ProductCompose.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,19 @@ sub parse {
# Do we need source or debug packages?
$ret->{'sourcemedium'} = 1 unless ($data->{'source'} || '') eq 'drop';
$ret->{'debugmedium'} = 1 unless ($data->{'debug'} || '') eq 'drop';

$ret->{'baseiso'} = $data->{'iso'}->{'base'} if $data->{'iso'} && $data->{'iso'}->{'base'};

my @architectures = @{$data->{'architectures'} || []};
if ($data->{'flavors'}) {
if ($cf->{'buildflavor'}) {
my $f = $data->{'flavors'}->{$cf->{'buildflavor'}};
return { error => "Flavor '$cf->{'buildflavor'}' not found" } unless defined $f;
@architectures = @{$f->{'architectures'} || []} if $f->{'architectures'};
$ret->{'baseiso'} = $f->{'iso'}->{'base'} if $f->{'iso'} && $f->{'iso'}->{'base'};
}
}

$ret->{'error'} = 'excluded' unless @architectures;
$ret->{'exclarch'} = \@architectures if @architectures;
$ret->{'bcntsynctag'} = $data->{'bcntsynctag'} if $data->{'bcntsynctag'};
Expand Down
7 changes: 6 additions & 1 deletion build-recipe-productcompose
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ recipe_build_productcompose() {
echo "running product composer..."

local milestone=$(productcompose_query_recipe milestone)
local baseiso=$(productcompose_query_recipe baseiso)
extra_args=
if test -n "$RELEASE" ; then
extra_args=" $extra_args --release $RELEASE"
Expand All @@ -71,7 +72,11 @@ recipe_build_productcompose() {
if test -n "$BUILD_VCSURL" ; then
extra_args=" $extra_args --vcs $BUILD_VCSURL"
fi
chroot "$BUILD_ROOT" su -c "/usr/bin/product-composer build $extra_args -v --clean $TOPDIR/SOURCES/$RECIPEFILE $TOPDIR/PRODUCT" - abuild < /dev/null && BUILD_SUCCEEDED=true
if test -n "$baseiso"; then
BUILD_USER=root
fi

chroot "$BUILD_ROOT" su -c "/usr/bin/product-composer build $extra_args -v --clean $TOPDIR/SOURCES/$RECIPEFILE $TOPDIR/PRODUCT" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
pushd "$BUILD_ROOT/$TOPDIR/PRODUCT"
for i in * ; do
test -e "$i" || continue
Expand Down

0 comments on commit 216bea3

Please sign in to comment.