Skip to content

Commit

Permalink
Use SYSTEMD_SECCOMP env var to allow new RHEL 9 syscalls
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezney committed Jul 15, 2021
1 parent 634d756 commit b576b29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import shutil

from leapp.exceptions import StopActorExecutionError
from leapp.libraries.common.config.version import get_target_major_version
from leapp.libraries.common import dnfplugin, mounting
from leapp.libraries.stdlib import api
from leapp.models import (
Expand Down Expand Up @@ -154,6 +155,9 @@ def generate_initram_disk(context):
Includes handling of specified dracut modules from the host when needed.
The check for the 'conflicting' dracut modules is in a separate actor.
"""
env = {}
if get_target_major_version() == '9':
env = {'SYSTEMD_SECCOMP': '0'}
# TODO(pstodulk): Add possibility to add particular drivers
# Issue #645
modules = _get_dracut_modules() # deprecated
Expand All @@ -171,7 +175,7 @@ def generate_initram_disk(context):
arch=api.current_actor().configuration.architecture,
files=' '.join(files),
cmd=os.path.join('/', INITRAM_GEN_SCRIPT_NAME))
])
], env=env)
copy_boot_files(context)


Expand Down
7 changes: 6 additions & 1 deletion repos/system_upgrade/common/libraries/dnfplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,15 @@ def _transaction(context, stage, target_repoids, tasks, plugin_info, test=False,
cmd += ['--disableplugin', info.name]
if cmd_prefix:
cmd = cmd_prefix + cmd
env = {}
if get_target_major_version() == '9':
# allow handling new RHEL 9 syscalls by systemd-nspawn
env = {'SYSTEMD_SECCOMP': '0'}
try:
context.call(
cmd=cmd,
callback_raw=utils.logging_handler
callback_raw=utils.logging_handler,
env=env
)
except OSError as e:
api.current_logger().error('Could not call dnf command: Message: %s', str(e), exc_info=True)
Expand Down

0 comments on commit b576b29

Please sign in to comment.