Skip to content

Commit

Permalink
config: create build dir if defined
Browse files Browse the repository at this point in the history
Before this patch, if KBUILD_OUTPUT or O env vars were set, but the
mentioned directory didn't exist, the script was first running ...

  $ KBUILD_OUTPUT=(...) make defconfig

... generating the .config in the build dir, but appending the extra
kconfigs in the source dir.

The restriction for the build dir doesn't seem to be needed. Instead,
the directory is created if it doesn't already exist. If it cannot be
created, an error is returned.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Feb 26, 2025
1 parent d8fcb80 commit be4388b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion virtme/commands/configkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,12 @@ def do_it():

# Check if KBUILD_OUTPUT is defined and if it's a directory
config_dir = os.environ.get("KBUILD_OUTPUT")
if config_dir is not None and os.path.isdir(config_dir):
if config_dir is not None:
try:
os.makedirs(config_dir, exist_ok=True)
except Exception as exc:
print(f"Error: invalid directory for KBUILD_OUTPUT: {config_dir}")
raise SilentError() from exc
config = os.path.join(config_dir, config)
makef = os.path.join(config_dir, makef)

Expand Down

0 comments on commit be4388b

Please sign in to comment.