Skip to content

Commit

Permalink
Merge pull request #1444 from dmach/disable-preinstallimage-in-rootle…
Browse files Browse the repository at this point in the history
…ss-builds

Disable preinstall images in rootless builds
  • Loading branch information
dmach authored Nov 3, 2023
2 parents 7781367 + 3d20497 commit 503cf10
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,12 @@ def calculate_build_root(apihost, prj, pac, repo, arch, user=None):
return buildroot


def build_as_user():
if conf.config["su-wrapper"]:
return False
return True
def build_as_user(vm_type=None):
if not conf.config.su_wrapper:
return True
if calculate_build_root_user(vm_type):
return True
return False


def su_wrapper(cmd):
Expand Down Expand Up @@ -1127,8 +1129,8 @@ def main(apiurl, store, opts, argv):
imagefile = ''
imagesource = ''
imagebins = []
if build_as_user():
# preinstallimage extraction will fail
if build_as_user(vm_type):
# preinstallimage extraction will fail because unprivileged user cannot chroot or extract devices from the tarball
bi.preinstallimage = None
if build_type == 'preinstallimage':
# preinstallimage would repackage just the previously built preinstallimage
Expand Down

0 comments on commit 503cf10

Please sign in to comment.