Don't copy kernels to workdir, copy them straight to outputdir
This commit is contained in:
parent
9b73b764b8
commit
6dcc1b8666
@ -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")
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
kname = "vmlinuz{0}".format(suffix)
|
||||||
|
|
||||||
|
if n == 0:
|
||||||
# copy main kernel to isolinuxdir
|
# copy main kernel to isolinuxdir
|
||||||
shutil.copy2(self.main_kernel.fpath, self.isolinuxdir)
|
dst = joinpaths(self.isolinuxdir, kname)
|
||||||
|
shutil.copy2(kernel.fpath, dst)
|
||||||
|
|
||||||
# create hard link to main kernel in pxebootdir
|
# create hard link to main kernel in pxebootdir
|
||||||
source = joinpaths(self.isolinuxdir, self.main_kernel.fname)
|
link_name = joinpaths(self.pxebootdir, kname)
|
||||||
link_name = joinpaths(self.pxebootdir, self.main_kernel.fname)
|
os.link(dst, link_name)
|
||||||
os.link(source, link_name)
|
else:
|
||||||
|
|
||||||
# copy other kernels to pxebootdir
|
# copy other kernels to pxebootdir
|
||||||
for kernel in self.installtree.kernels[1:]:
|
dst = joinpaths(self.pxebootdir, kname)
|
||||||
shutil.copy2(kernel.fpath, self.pxebootdir)
|
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user