Skip to content

Commit 216bea3

Browse files
productcompose: Build as root when using agama base iso
1 parent a4b10cb commit 216bea3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Build/ProductCompose.pm

+5
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,19 @@ sub parse {
129129
# Do we need source or debug packages?
130130
$ret->{'sourcemedium'} = 1 unless ($data->{'source'} || '') eq 'drop';
131131
$ret->{'debugmedium'} = 1 unless ($data->{'debug'} || '') eq 'drop';
132+
133+
$ret->{'baseiso'} = $data->{'iso'}->{'base'} if $data->{'iso'} && $data->{'iso'}->{'base'};
134+
132135
my @architectures = @{$data->{'architectures'} || []};
133136
if ($data->{'flavors'}) {
134137
if ($cf->{'buildflavor'}) {
135138
my $f = $data->{'flavors'}->{$cf->{'buildflavor'}};
136139
return { error => "Flavor '$cf->{'buildflavor'}' not found" } unless defined $f;
137140
@architectures = @{$f->{'architectures'} || []} if $f->{'architectures'};
141+
$ret->{'baseiso'} = $f->{'iso'}->{'base'} if $f->{'iso'} && $f->{'iso'}->{'base'};
138142
}
139143
}
144+
140145
$ret->{'error'} = 'excluded' unless @architectures;
141146
$ret->{'exclarch'} = \@architectures if @architectures;
142147
$ret->{'bcntsynctag'} = $data->{'bcntsynctag'} if $data->{'bcntsynctag'};

build-recipe-productcompose

+6-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ recipe_build_productcompose() {
5858
echo "running product composer..."
5959

6060
local milestone=$(productcompose_query_recipe milestone)
61+
local baseiso=$(productcompose_query_recipe baseiso)
6162
extra_args=
6263
if test -n "$RELEASE" ; then
6364
extra_args=" $extra_args --release $RELEASE"
@@ -71,7 +72,11 @@ recipe_build_productcompose() {
7172
if test -n "$BUILD_VCSURL" ; then
7273
extra_args=" $extra_args --vcs $BUILD_VCSURL"
7374
fi
74-
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
75+
if test -n "$baseiso"; then
76+
BUILD_USER=root
77+
fi
78+
79+
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
7580
pushd "$BUILD_ROOT/$TOPDIR/PRODUCT"
7681
for i in * ; do
7782
test -e "$i" || continue

0 commit comments

Comments
 (0)