FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 09-01-2011, 03:21 PM
Dan Horák
 
Default lorax: use own addrsize implementation

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.
---
src/pylorax/images.py | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/pylorax/images.py b/src/pylorax/images.py
index 75d38e0..5b9a351 100644
--- a/src/pylorax/images.py
+++ b/src/pylorax/images.py
@@ -641,16 +641,12 @@ class S390(object):
logger.info("compressing the install tree")
self.installtree.compress(initrd, kernel, self.ctype, self.cargs)

- # run addrsize
- addrsize = joinpaths(self.installtree.root, "usr/libexec",
- "anaconda", "addrsize")
-
- cmd = [addrsize, INITRD_ADDRESS, initrd.fpath,
- joinpaths(self.outputroot, IMAGESDIR, "initrd.addrsize")]
-
- p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE)
- p.wait()
+ # create initrd.addrsize
+ addrsize = open(joinpaths(self.outputroot, IMAGESDIR, "initrd.addrsize"), "wb")
+ import struct
+ addrsize_data = struct.pack('>iiii', 0, int(INITRD_ADDRESS, 16), 0, os.stat(initrd.fpath).st_size)
+ addrsize.write(addrsize_data)
+ addrsize.close()

# add kernel and initrd to .treeinfo
kernel_arch = kernel.version.split(".")[-1]
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 09-05-2011, 02:25 PM
Martin Gracik
 
Default lorax: use own addrsize implementation

--

Martin Gracik

----- Original Message -----
> 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.
> ---
> src/pylorax/images.py | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/src/pylorax/images.py b/src/pylorax/images.py
> index 75d38e0..5b9a351 100644
> --- a/src/pylorax/images.py
> +++ b/src/pylorax/images.py
> @@ -641,16 +641,12 @@ class S390(object):
> logger.info("compressing the install tree")
> self.installtree.compress(initrd, kernel, self.ctype, self.cargs)
>
> - # run addrsize
> - addrsize = joinpaths(self.installtree.root, "usr/libexec",
> - "anaconda", "addrsize")
> -
> - cmd = [addrsize, INITRD_ADDRESS, initrd.fpath,
> - joinpaths(self.outputroot, IMAGESDIR, "initrd.addrsize")]
> -
> - p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
> - stdout=subprocess.PIPE)
> - p.wait()
> + # create initrd.addrsize
> + addrsize = open(joinpaths(self.outputroot, IMAGESDIR,
> "initrd.addrsize"), "wb")
> + import struct

imports should be in the beginning of the file. Otherwise I have nothing against the patch, but I would like David to take a look.

> + addrsize_data = struct.pack('>iiii', 0, int(INITRD_ADDRESS, 16), 0,
> os.stat(initrd.fpath).st_size)
> + addrsize.write(addrsize_data)
> + addrsize.close()
>
> # add kernel and initrd to .treeinfo
> kernel_arch = kernel.version.split(".")[-1]
> --
> 1.7.4.4
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 09-06-2011, 05:17 PM
David Cantrell
 
Default lorax: use own addrsize implementation

On 09/01/2011 11:21 AM, Dan Horák wrote:

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.
---
src/pylorax/images.py | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/pylorax/images.py b/src/pylorax/images.py
index 75d38e0..5b9a351 100644
--- a/src/pylorax/images.py
+++ b/src/pylorax/images.py
@@ -641,16 +641,12 @@ class S390(object):
logger.info("compressing the install tree")
self.installtree.compress(initrd, kernel, self.ctype, self.cargs)

- # run addrsize
- addrsize = joinpaths(self.installtree.root, "usr/libexec",
- "anaconda", "addrsize")
-
- cmd = [addrsize, INITRD_ADDRESS, initrd.fpath,
- joinpaths(self.outputroot, IMAGESDIR, "initrd.addrsize")]
-
- p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE)
- p.wait()
+ # create initrd.addrsize
+ addrsize = open(joinpaths(self.outputroot, IMAGESDIR, "initrd.addrsize"), "wb")
+ import struct
+ addrsize_data = struct.pack('>iiii', 0, int(INITRD_ADDRESS, 16), 0, os.stat(initrd.fpath).st_size)
+ addrsize.write(addrsize_data)
+ addrsize.close()

# add kernel and initrd to .treeinfo
kernel_arch = kernel.version.split(".")[-1]


Ack.

--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 06:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org