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 > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 08-17-2011, 02:21 PM
Radek Vykydal
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

I'd like to have this in F16, proposing the bug as F16 Beta NTH.

If no device was activated during install (e.g. DVD install),
set ONBOOT=yes for first wired device having link found.
(Which means the device will be brought up after system boot).
---
pyanaconda/__init__.py | 2 ++
pyanaconda/network.py | 12 ++++++++++++
pyanaconda/yuminstall.py | 2 ++
3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 5ba37a3..04a618d 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -290,6 +290,8 @@ class Anaconda(object):
self.instLanguage.write(self.rootPath)

self.timezone.write(self.rootPath)
+ if not self.ksdata:
+ self.network.setOnbootDefault(self.instClass.id)
self.network.write()
self.network.copyConfigToPath(instPath=self.rootPa th)
self.network.disableNMForStorageDevices(self,
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 5f3a225..5e4cc79 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -759,6 +759,18 @@ class Network:
log.warning("disableNMForStorageDevices: %s file not found" %
device.path)

+ def setOnbootDefault(self, inst_class_id=None):
+ if inst_class_id == "fedora":
+ # devices activated during installation have ONBOOT=yes
+ if hasActiveNetDev():
+ return
+
+ for devName, dev in self.netdevices.items():
+ if (not isys.isWirelessDevice(devName) and
+ isys.getLinkStatus(devName)):
+ dev.set(('ONBOOT', 'yes'))
+ break
+
def write(self):
ifcfglog.debug("Network.write() called")

diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index 26c3c46..66d84b8 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -1602,6 +1602,8 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
if os.access("/etc/modprobe.d/anaconda.conf", os.R_OK):
shutil.copyfile("/etc/modprobe.d/anaconda.conf",
anaconda.rootPath + "/etc/modprobe.d/anaconda.conf")
+ if not anaconda.ksdata:
+ anaconda.network.setOnbootDefault(anaconda.instCla ss.id)
anaconda.network.write()
anaconda.network.copyConfigToPath(instPath=anacond a.rootPath)
anaconda.storage.write(anaconda.rootPath)
--
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-17-2011, 03:33 PM
Radek Vykydal
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On 08/17/2011 04:21 PM, Radek Vykydal wrote:

I'd like to have this in F16, proposing the bug as F16 Beta NTH.

If no device was activated during install (e.g. DVD install),

To be precise: "during *interactive* install", not during kickstart
installs (where network is set up to fetch kickstart in majority
of the cases I think).

set ONBOOT=yes for first wired device having link found.
(Which means the device will be brought up after system boot).
---


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-17-2011, 04:13 PM
"Brian C. Lane"
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On Wed, Aug 17, 2011 at 04:21:16PM +0200, Radek Vykydal wrote:

> + def setOnbootDefault(self, inst_class_id=None):
> + if inst_class_id == "fedora":
> + # devices activated during installation have ONBOOT=yes
> + if hasActiveNetDev():
> + return

Why do we need to make this conditional?

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-18-2011, 09:11 AM
Radek Vykydal
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On 08/17/2011 06:13 PM, Brian C. Lane wrote:

On Wed, Aug 17, 2011 at 04:21:16PM +0200, Radek Vykydal wrote:


+ def setOnbootDefault(self, inst_class_id=None):
+ if inst_class_id == "fedora":
+ # devices activated during installation have ONBOOT=yes
+ if hasActiveNetDev():
+ return

Why do we need to make this conditional?



It corresponds to
"If no device was activated during install (e.g. DVD install), "
from commit message.

If a device has been activated during installation,
it has ONBOOT=yes and we are ok - network will go up
after reboot.
It also means that user has configured network during
installation and we don't want to change his choices in any way
(e.g. set ONBOOT=yes for another device having link).

Radek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-18-2011, 05:33 PM
"Brian C. Lane"
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On Thu, Aug 18, 2011 at 11:11:12AM +0200, Radek Vykydal wrote:
> On 08/17/2011 06:13 PM, Brian C. Lane wrote:
> >On Wed, Aug 17, 2011 at 04:21:16PM +0200, Radek Vykydal wrote:
> >
> >>+ def setOnbootDefault(self, inst_class_id=None):
> >>+ if inst_class_id == "fedora":
> >>+ # devices activated during installation have ONBOOT=yes
> >>+ if hasActiveNetDev():
> >>+ return
> >Why do we need to make this conditional?
> >
>
> It corresponds to
> "If no device was activated during install (e.g. DVD install), "
> from commit message.
>
> If a device has been activated during installation,
> it has ONBOOT=yes and we are ok - network will go up
> after reboot.
> It also means that user has configured network during
> installation and we don't want to change his choices in any way
> (e.g. set ONBOOT=yes for another device having link).

Sorry, I was actually wondering about the inst_class_id check. It just
seems out of place to be checking that.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-22-2011, 03:55 PM
Radek Vykydal
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On 08/18/2011 07:33 PM, Brian C. Lane wrote:

Sorry, I was actually wondering about the inst_class_id check. It just
seems out of place to be checking that.


Hmm, it does, did you mean using InstallClass instead? That would seem
more consistent with how we handle fedora/rhel differences.
See new patch attached please.

I made the original patch only simple and somewhat dumb bearing
in mind that this is temporary anyway (from what I've followed
in discussions, the big UX thing will change it anyway, i.e.
autoactivating device having link at the beginning of the install,
maybe keeping configuration in ksdata...).

Radek

>From d39e50dd1ca528e702938bf78ae0b162ada0df5b Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Fri, 5 Aug 2011 13:55:28 +0200
Subject: [PATCH f16-beta NTH?] Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

If no device was activated during install (e.g. DVD install),
set ONBOOT=yes for first wired device having link found.
(Which means the device will be brought up after system boot).
---
pyanaconda/__init__.py | 2 ++
pyanaconda/installclass.py | 3 +++
pyanaconda/installclasses/fedora.py | 12 ++++++++++++
pyanaconda/yuminstall.py | 2 ++
4 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 5ba37a3..757cf98 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -290,6 +290,8 @@ class Anaconda(object):
self.instLanguage.write(self.rootPath)

self.timezone.write(self.rootPath)
+ if not self.ksdata:
+ self.instClass.setNetworkOnbootDefault(self.networ k)
self.network.write()
self.network.copyConfigToPath(instPath=self.rootPa th)
self.network.disableNMForStorageDevices(self,
diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index 4c599d1..576481f 100644
--- a/pyanaconda/installclass.py
+++ b/pyanaconda/installclass.py
@@ -211,6 +211,9 @@ class BaseInstallClass(object):

return self.productMatches(oldprod) and self.versionMatches(oldver) and archesEq(arch, productArch)

+ def setNetworkOnbootDefault(self, network):
+ """Default for autoactivation of network devices after reboot"""
+
def __init__(self):
pass

diff --git a/pyanaconda/installclasses/fedora.py b/pyanaconda/installclasses/fedora.py
index a328038..c40a899 100644
--- a/pyanaconda/installclasses/fedora.py
+++ b/pyanaconda/installclasses/fedora.py
@@ -22,6 +22,8 @@ from pyanaconda.constants import *
from pyanaconda.product import *
from pyanaconda.flags import flags
from pyanaconda import iutil
+from pyanaconda.network import hasActiveNetDev
+from pyanaconda import isys

import os, types
import gettext
@@ -122,5 +124,15 @@ class InstallClass(BaseInstallClass):
# than two versions ago!
return newVer >= oldVer and newVer - oldVer <= 2

+ def setNetworkOnbootDefault(self, network):
+ if hasActiveNetDev():
+ return
+
+ for devName, dev in network.netdevices.items():
+ if (not isys.isWirelessDevice(devName) and
+ isys.getLinkStatus(devName)):
+ dev.set(('ONBOOT', 'yes'))
+ break
+
def __init__(self):
BaseInstallClass.__init__(self)
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index 064cf47..032e48a 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -1604,6 +1604,8 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
if os.access("/etc/modprobe.d/anaconda.conf", os.R_OK):
shutil.copyfile("/etc/modprobe.d/anaconda.conf",
anaconda.rootPath + "/etc/modprobe.d/anaconda.conf")
+ if not anaconda.ksdata:
+ anaconda.instClass.setNetworkOnbootDefault(anacond a.network)
anaconda.network.write()
anaconda.network.copyConfigToPath(instPath=anacond a.rootPath)
anaconda.storage.write(anaconda.rootPath)
--
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-23-2011, 11:43 PM
"Brian C. Lane"
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On Mon, Aug 22, 2011 at 05:55:28PM +0200, Radek Vykydal wrote:
> On 08/18/2011 07:33 PM, Brian C. Lane wrote:
> >Sorry, I was actually wondering about the inst_class_id check. It just
> >seems out of place to be checking that.
>
> Hmm, it does, did you mean using InstallClass instead? That would seem
> more consistent with how we handle fedora/rhel differences.
> See new patch attached please.
>

Yes, that looks much nicer.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-24-2011, 02:29 PM
Chris Lumens
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

Why do you only want to do this in Fedora?

> diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
> index 4c599d1..576481f 100644
> --- a/pyanaconda/installclass.py
> +++ b/pyanaconda/installclass.py
> @@ -211,6 +211,9 @@ class BaseInstallClass(object):
>
> return self.productMatches(oldprod) and self.versionMatches(oldver) and archesEq(arch, productArch)
>
> + def setNetworkOnbootDefault(self, network):
> + """Default for autoactivation of network devices after reboot"""
> +
> def __init__(self):
> pass
>

This is okay as far as Python goes, but it looks weird to me. Can you
toss a "pass" into setNetworkOnbootDefault?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-25-2011, 01:27 PM
Radek Vykydal
 
Default Default to an active network device after reboot on Fedora (ONBOOT) (#498207)

On 08/24/2011 04:29 PM, Chris Lumens wrote:

Why do you only want to do this in Fedora?



So that we can notice/recall later when forking next rhel
that default for rhel 6 is different. Another question
is whether to change the default this way for rhel as well,
I'd be careful here. I have no strong opinion about what the default
in rhel should be but I'm inclined to current behaviour.

Now the default for rhel 6 is ONBOOT=yes only for devices
activated during install. It differs from rhel 5. Why? In rhel 5
we used to have network config screen with a device preconfigured
to be activated after reboot, so the user kind of
acknowledged/confirmed it by going "Next". Now with nm-c-e
the device that would be autoactivated after boot by default
is not presented this way [1]. Also, checking "Connect Automatically"
in nm-c-e has a side-effect of activating the device (unlike
the corresponding choice in rhel5 network configuration screen)

I don't suppose the these different code paths for rhel/fedora
will be preserved in next rhel with UI redesign as the network
activation/configuration code will change a lot I think,
so it is just to fix the rather wanted bz for couple of Fedora
releases before new UI comes and to record in the code that
rhel behaves differently.


[1] I proposed a patch that would present this choice together
with some other options some time ago but it was not acked.
It may be also something to consider for anaconda part of network
configuration UI.



diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index 4c599d1..576481f 100644
--- a/pyanaconda/installclass.py
+++ b/pyanaconda/installclass.py
@@ -211,6 +211,9 @@ class BaseInstallClass(object):

return self.productMatches(oldprod) and self.versionMatches(oldver) and archesEq(arch, productArch)

+ def setNetworkOnbootDefault(self, network):
+ """Default for autoactivation of network devices after reboot"""
+
def __init__(self):
pass


This is okay as far as Python goes, but it looks weird to me. Can you
toss a "pass" into setNetworkOnbootDefault?



I've no problem using pass instead of the (not very enlightening)
docstring. It's just a practice (we don't use) to use docstring
instead of pass. Although it is not consistent with what we are doing
in installclass.py, I did it because I made this version after
Brian's review and I recalled (I could have been wrong) that he had
been talking about it on anaconda-devel-list or IRC
so I wanted to curry favour by that.


Radek

_______________________________________________
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 04:09 PM.

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