Don't copy kernels to workdir, copy them straight to outputdir

This commit is contained in:
Martin Gracik 2010-11-23 14:13:05 +01:00
parent 9b73b764b8
commit 6dcc1b8666
2 changed files with 23 additions and 25 deletions

View File

@ -340,21 +340,8 @@ class Lorax(BaseLoraxClass):
shutil.move(splash, self.workdir) shutil.move(splash, self.workdir)
splash = joinpaths(self.workdir, os.path.basename(splash)) splash = joinpaths(self.workdir, os.path.basename(splash))
# move kernels to workdir
for kernel in self.installtree.kernels:
suffix = ""
if kernel.type == K_PAE:
suffix = "-PAE"
elif kernel.type == K_XEN:
suffix = "-XEN"
kname = "vmlinuz{0}".format(suffix)
shutil.move(kernel.fpath, joinpaths(self.workdir, kname))
kernel.fname = kname
kernel.fpath = joinpaths(self.workdir, kname)
# copy kernels to output directory # copy kernels to output directory
self.outputtree.get_kernels(self.installtree.kernels[:]) self.outputtree.get_kernels()
# get list of not required packages # get list of not required packages
logger.info("getting list of not required packages") logger.info("getting list of not required packages")

View File

@ -65,20 +65,31 @@ class LoraxOutputTree(BaseLoraxClass):
self.efibootdir = efibootdir self.efibootdir = efibootdir
def get_kernels(self): def get_kernels(self):
# get the main kernel for n, kernel in enumerate(self.installtree.kernels):
self.main_kernel = self.installtree.kernels[0] suffix = ""
if kernel.type == K_PAE:
suffix = "-PAE"
elif kernel.type == K_XEN:
suffix = "-XEN"
# copy main kernel to isolinuxdir kname = "vmlinuz{0}".format(suffix)
shutil.copy2(self.main_kernel.fpath, self.isolinuxdir)
# create hard link to main kernel in pxebootdir if n == 0:
source = joinpaths(self.isolinuxdir, self.main_kernel.fname) # copy main kernel to isolinuxdir
link_name = joinpaths(self.pxebootdir, self.main_kernel.fname) dst = joinpaths(self.isolinuxdir, kname)
os.link(source, link_name) shutil.copy2(kernel.fpath, dst)
# copy other kernels to pxebootdir # create hard link to main kernel in pxebootdir
for kernel in self.installtree.kernels[1:]: link_name = joinpaths(self.pxebootdir, kname)
shutil.copy2(kernel.fpath, self.pxebootdir) os.link(dst, link_name)
else:
# copy other kernels to pxebootdir
dst = joinpaths(self.pxebootdir, kname)
shutil.copy2(kernel.fpath, dst)
# XXX change the fname and fpath to new values
kernel.fname = kname
kernel.fpath = dst
def get_isolinux(self): def get_isolinux(self):
isolinuxbin = joinpaths(self.installtree.root, isolinuxbin = joinpaths(self.installtree.root,