copy_all = "copy-all"
copy_git_cached = "copy-git-cached"
copy_git_others = "copy-git-others"
+ mount = "mount"
def __str__(self):
return self.value
def doc(cls):
return {cls.copy_all: "normal file copy",
cls.copy_git_cached: "use git-ls-files --cached, ignoring any file that git itself ignores",
- cls.copy_git_others: "use git-ls-files --others, ignoring any file that git itself ignores"}
+ cls.copy_git_others: "use git-ls-files --others, ignoring any file that git itself ignores",
+ cls.mount: "bind mount source files into the build image"}
class OutputFormat(enum.Enum):
if source_file_transfer in (SourceFileTransfer.copy_git_others, SourceFileTransfer.copy_git_cached):
copy_git_files(args.build_sources, target, source_file_transfer=source_file_transfer)
- else:
+ elif source_file_transfer == SourceFileTransfer.copy_all:
ignore = shutil.ignore_patterns('.git',
'.mkosi-*',
'*.cache-pre-dev',
if args.build_sources is not None:
cmdline.append("--setenv=SRCDIR=/root/src")
cmdline.append("--chdir=/root/src")
+ if args.source_file_transfer == SourceFileTransfer.mount:
+ cmdline.append("--bind=" + args.build_sources + ":/root/src")
if args.read_only:
cmdline.append("--overlay=+/root/src::/root/src")