[PATCH master] Take over dhcp connection by NM for network root (eg nfs) (#883451, #893656)
Radek Vykydal
rvykydal at redhat.com
Mon Jan 14 12:34:48 UTC 2013
On 01/14/2013 10:40 AM, Vratislav Podzimek wrote:
> On Fri, 2013-01-11 at 16:57 -0800, Brian C. Lane wrote:
>> On Fri, Jan 11, 2013 at 04:41:34PM +0100, Radek Vykydal wrote:
>>> # we set real ONBOOT value in anaconda, here
>>> # we use it to activate devcies by NM on start
>>> ifcfg['ONBOOT'] = "yes" if net.activate else "no"
>>> @@ -305,6 +306,15 @@ def ksnet_to_ifcfg(net, filename=None):
>>>
>>> # TODO: dhcpclass, ethtool, essid/wepkey/wpakay, etc.
>>>
>>> + if net.bootProto == 'dhcp':
>>> + srcpath = "/tmp/dhclient.%s.lease" % dev
>>> + dstdir = "/tmp/ifcfg-leases"
>>> + dstpath = "%s/dhclient-%s-%s.lease" % (dstdir, uuid, dev)
>>> + if os.path.exists(srcpath):
>>> + if not os.path.isdir(dstdir):
>>> + os.makedirs(dstdir)
>>> + os.system("cp %s %s" % (srcpath, dstpath))
>> Maybe use shutil.copy2() instead of os.system?
> IIRC, Radek found out that the shutil module doesn't exist in the dracut
> environment. But the line at least deserves a comment.
Ah, it is because we need new build to include the modules used in
anaconda dracut to the image (dracut/module-setup.sh). I'll use
shutil then.
More information about the anaconda-patches
mailing list