Use own addrsize implementation (dhorak)

Anaconda doesn't built the addrsize tool used to create the file
containing size and load address for initrd.img. So we implement
its function directly in lorax.
This commit is contained in:
Martin Gracik 2011-09-22 10:07:11 +02:00
parent 05fc838ce2
commit 60c444c0c9

View File

@ -27,6 +27,7 @@ import subprocess
import shutil import shutil
import glob import glob
import collections import collections
import struct
from base import DataHolder from base import DataHolder
from sysutils import joinpaths, cpfile, replace from sysutils import joinpaths, cpfile, replace
@ -637,16 +638,13 @@ class S390(object):
logger.info("compressing the install tree") logger.info("compressing the install tree")
self.installtree.compress(initrd, kernel, self.ctype, self.cargs) self.installtree.compress(initrd, kernel, self.ctype, self.cargs)
# run addrsize # create initrd.addrsize
addrsize = joinpaths(self.installtree.root, "usr/libexec", addrsize = open(joinpaths(self.outputroot, IMAGESDIR,
"anaconda", "addrsize") "initrd.addrsize"), "wb")
addrsize_data = struct.pack(">iiii", 0, int(INITRD_ADDRESS, 16), 0,
cmd = [addrsize, INITRD_ADDRESS, initrd.fpath, os.stat(initrd.fpath).st_size)
joinpaths(self.outputroot, IMAGESDIR, "initrd.addrsize")] addrsize.write(addrsize_data)
addrsize.close()
p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
p.wait()
# add kernel and initrd to .treeinfo # add kernel and initrd to .treeinfo
kernel_arch = kernel.version.split(".")[-1] kernel_arch = kernel.version.split(".")[-1]