On Sun, 2024-08-18 at 15:42 -0400, John Kacur wrote: > This patch does two things. > 1. It allows you to create your own customer kernel with a dash -rteval > in the name, eg, linux-6.10.5-rteval s/customer/custom/ > > def _find_tarball(self): > - # If the user specifies the full kernel name, check if available > - tarfile = os.path.join(self.srcdir, self._cfg.source) > - if os.path.exists(tarfile): > - return tarfile > + """ Find the tarball and self._kernel_prefix """ > > if 'rc' in self._cfg.source: > - tarfile_prefix = re.search(r"\d{1,2}\.\d{1,3}\-[a- > z]*\d{1,2}", self._cfg.source).group(0) > + tarfile_prefix = re.search(r"\d{1,2}\.\d{1,3}\-rc\d{1,2}", > self._cfg.source).group(0) > + elif 'rteval' in self._cfg.source: > + tarfile_prefix = re.search(r"(\d{1,2}\.\d{1,3}\.\d{1,3}\- > rteval)|(\d{1,2}\.\d{1,3}\-rteval)", self._cfg.source).group(0) > else: > tarfile_prefix = > re.search(r"(\d{1,2}\.\d{1,3}\.\d{1,3})|(\d{1,2}\.\d{1,3})", > self._cfg.source).group(0) > > + # Save the kernel prefix > + self._kernel_prefix = "linux-" + tarfile_prefix > + > + # If the user specifies the full kernel name, check if available > + tarfile = os.path.join(self.srcdir, self._cfg.source) > + if os.path.exists(tarfile): > + return tarfile > + > # either a tar.xz or tar.gz might exist. Check for both. > xz_file = os.path.join(self.srcdir,"linux-" + tarfile_prefix + > ".tar.xz" ) > gz_file = os.path.join(self.srcdir,"linux-" + tarfile_prefix + > ".tar.gz" ) > if os.path.exists(xz_file): > return xz_file > - elif os.path.exists(gz_file): > + if os.path.exists(gz_file): > return gz_file > raise rtevalRuntimeError(self, f"tarfile {tarfile} does not > exist!") Why do we have any of this instead of just having the user point at the specific file (which I assume is mainly of interest for working around problems building the default one)? -Crystal