Skip to content

Commit

Permalink
cheribsd: Fix for .with_suffix replacing an existing suffix
Browse files Browse the repository at this point in the history
In the kernel.FOO.full case, we'd end up with a dest_elf_with_dbg of
just kernel.full, so append rather than replace, and always copy the
kernel.full files when pretending, ignoring whether they exist, so that
this can easily be tested.

Also fix install_file to add force=True as used to be done for the
MFS-ROOT kernels (but not the replaced Jenkins-specific logic, since it
started from a clean build and thus never needed to bother).
  • Loading branch information
jrtc27 committed Aug 17, 2023
1 parent 172f3e7 commit f2b15a0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pycheribuild/projects/cross/cheribsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,12 +1066,12 @@ def _copykernel(self, kernconfs: "list[str]", rootfs_dir: Path, dest_dir: Path,
rootfs_elf = self._get_kernel_rootfs_install_path(config, rootfs_dir, kernconfs[0])
dest_elf = dest_dir / f"kernel{dest_kernel_suffix}"
if config != kernconfs[0] or dest_all_extra:
dest_elf = dest_elf.with_suffix(f".{config}")
self.install_file(rootfs_elf, dest_elf, print_verbose_only=False)
rootfs_elf_with_dbg = rootfs_elf.with_suffix(".full")
dest_elf_with_dbg = dest_elf.with_suffix(".full")
if rootfs_elf_with_dbg.exists():
self.install_file(rootfs_elf_with_dbg, dest_elf_with_dbg, print_verbose_only=False)
dest_elf = dest_elf.with_suffix(f"{dest_elf.suffix}.{config}")
self.install_file(rootfs_elf, dest_elf, force=True, print_verbose_only=False)
rootfs_elf_with_dbg = rootfs_elf.with_suffix(f"{rootfs_elf.suffix}.full")
dest_elf_with_dbg = dest_elf.with_suffix(f"{dest_elf.suffix}.full")
if rootfs_elf_with_dbg.exists() or self.config.pretend:
self.install_file(rootfs_elf_with_dbg, dest_elf_with_dbg, force=True, print_verbose_only=False)

def kernconf_list(self) -> "list[str]":
assert self.kernel_config is not None
Expand Down

0 comments on commit f2b15a0

Please sign in to comment.