Skip to content

Commit

Permalink
Only copy no-network distfiles to "init" when --external-source is …
Browse files Browse the repository at this point in the history
…passed (with kernel bootstrap)

All distfiles are still copied to "external"
  • Loading branch information
eduardosm committed Jan 12, 2024
1 parent 5dbaeaf commit 3f41cab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self, arch, external_sources, early_preseed, repo_path):
self.external_sources = external_sources
self.repo_path = repo_path
self.source_manifest = self.get_source_manifest(not self.external_sources)
self.early_source_manifest = self.get_source_manifest(True)
self.target_dir = None
self.external_dir = None

Expand Down Expand Up @@ -159,9 +160,10 @@ def create_fiwix_file_list(self):

def distfiles(self):
"""Copy in distfiles"""
def copy_no_network_distfiles(out):
def copy_no_network_distfiles(out, early):
# Note that "no disk" implies "no network" for kernel bootstrap mode
for file in self.source_manifest:
manifest = self.early_source_manifest if early else self.source_manifest
for file in manifest:
file = file[3].strip()
shutil.copy2(os.path.join(self.distfiles_dir, file),
os.path.join(out, file))
Expand All @@ -171,13 +173,13 @@ def copy_no_network_distfiles(out):

if early_distfile_dir != main_distfile_dir:
os.makedirs(early_distfile_dir, exist_ok=True)
copy_no_network_distfiles(early_distfile_dir)
copy_no_network_distfiles(early_distfile_dir, True)

if self.external_sources:
shutil.copytree(self.distfiles_dir, main_distfile_dir, dirs_exist_ok=True)
else:
os.mkdir(main_distfile_dir)
copy_no_network_distfiles(main_distfile_dir)
copy_no_network_distfiles(main_distfile_dir, False)

@staticmethod
def output_dir(srcfs_file, dirpath):
Expand Down

0 comments on commit 3f41cab

Please sign in to comment.