From: Stephen Childs <Stephen.Childs@cs.tcd.ie>
To: Tim Deegan <Tim.Deegan@xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] pypxeboot bootloader
Date: Thu, 08 Feb 2007 14:27:40 +0000 [thread overview]
Message-ID: <45CB335C.1090809@cs.tcd.ie> (raw)
In-Reply-To: <20070205173612.GH5181@york.uk.xensource.com>
Tim Deegan wrote:
> First impressions: this looks really useful but has a few rough edges
> that need to be knocked off. (I haven't had a chance to try this on a
> real machine yet.)
I absolutely agree, this was the first working version and I was aware
there were nasties in it.
>> +for line in udhcplines:
>> + s = line.strip()
>> + f = s.split()
>> +
>> + if s[0]=='{' and s[-1]=='}':
>> + dhcpinfo=eval(s, {"__builtins__" : {}})
>> + for k in dhcpinfo:
>> + dhcpinfo[k]=dhcpinfo[k].strip()
>
> Executing the results of programs scares me. Could you just parse it?
Yes quite. Sorry that was cut-and-paste code so I didn't think about it
enough. Will rewrite.
>> +ipaddr=dhcpinfo['ip']
>> +ipaddrlist=ipaddr.split('.')
>> +hexip=commands.getstatusoutput("/usr/bin/gethostip -x "+ipaddr)[1]
> This requires syslinux to be installed on the Xen host, and isn't
> hard to do by hand: "%2.2x%2.2x%2.2x%2.2x" % tuple(map (int, ipaddrlist))
> (I'm sure more heavyweight python hackers can correct my style.)
Yes of course I'll change that.
>> +tmpdir="/var/lib/xen/"
>> +
>> +os.chdir(tmpdir)
>> +commandstr="tftp -c get "+servaddr+":pxelinux.cfg/"+hexip
>> +#print "running command "+commandstr
>> +getpxeres=commands.getstatusoutput(commandstr)
>
> You'll need to be more careful with temporary file names -- here at
> least the filename is unique to the guest (we hope!) but for the kernel
> etc., two boots could clash. Also, you don't seem to remove the
> downloaded config files.
Yes that all needs tidying up. Unfortunately the version of tftp I was
using didn't actually support "get <remote-file> <local-file>" as
advertised which I was initially going to use. I'll have to download to
the filename supplied by the server then move to a tmpfile.
On the subject of removing files yes of course I'll remove the config
files. Comparing with pygrub, that seems to leave kernels and initrds
clogging up /var/lib/xen, and I suppose I'll end up doing the same. I
suppose you could set up tmpwatch to clean it up, but it still seems a bit
messy.
Expect a new patch soon ...
Stephen
--
Dr. Stephen Childs,
Research Fellow, EGEE Project, phone: +353-1-8961797
Computer Architecture Group, email: Stephen.Childs @ cs.tcd.ie
Trinity College Dublin, Ireland web: http://www.cs.tcd.ie/Stephen.Childs
next prev parent reply other threads:[~2007-02-08 14:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-05 11:13 [PATCH] pypxeboot bootloader Stephen Childs
2007-02-05 17:36 ` Tim Deegan
2007-02-05 17:57 ` Ewan Mellor
2007-02-08 14:27 ` Stephen Childs [this message]
2007-02-08 14:47 ` Ian Pratt
2007-02-08 16:36 ` Stephen Childs
2007-02-08 16:48 ` Ian Pratt
2007-02-20 9:53 ` Tim Deegan
2007-02-20 12:09 ` Stephen Childs
2007-05-07 16:33 ` Daniel Miles
2007-05-07 17:21 ` Ian Pratt
2007-02-08 15:09 ` Tim Deegan
[not found] <E1Hl9dL-0002zJ-Jo@host-192-168-0-1-bcn-london>
2007-05-31 10:10 ` Stephen Childs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45CB335C.1090809@cs.tcd.ie \
--to=stephen.childs@cs.tcd.ie \
--cc=Tim.Deegan@xensource.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.