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 > Gentoo > Gentoo Hardened

 
 
LinkBack Thread Tools
 
Old 01-04-2011, 12:53 PM
Radek Vykydal
 
Default Add kickstart network --nodefroute option (#638131)

Sets DEFROUTE=no in ifcfg file.
---
pykickstart/commands/network.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/pykickstart/commands/network.py b/pykickstart/commands/network.py
index ec988c5..ceb159b 100644
--- a/pykickstart/commands/network.py
+++ b/pykickstart/commands/network.py
@@ -163,12 +163,15 @@ class RHEL6_NetworkData(F8_NetworkData):
def __init__(self, *args, **kwargs):
F8_NetworkData.__init__(self, *args, **kwargs)
self.activate = kwargs.get("activate", False)
+ self.nodefroute = kwargs.get("nodefroute", False)

def _getArgsAsStr(self):
retval = F8_NetworkData._getArgsAsStr(self)

if self.activate:
retval += " --activate"
+ if self.nodefroute:
+ retval += " --nodefroute"

return retval

@@ -311,10 +314,13 @@ class RHEL6_Network(F9_Network):
def __init__(self, writePriority=0, *args, **kwargs):
F9_Network.__init__(self, writePriority, *args, **kwargs)
self.activate = kwargs.get("activate", False)
+ self.nodefroute = kwargs.get("nodefroute", False)
self.bootprotoList.append(BOOTPROTO_IBFT)

def _getParser(self):
op = F9_Network._getParser(self)
op.add_option("--activate", dest="activate", action="store_true",
default=False)
+ op.add_option("--nodefroute", dest="nodefroute", action="store_true",
+ default=False)
return op
--
1.7.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-10-2011, 01:21 PM
Radek Vykydal
 
Default Add kickstart network --nodefroute option (#638131)

Sets DEFROUTE=no in ifcfg file.
---
isys/iface.c | 1 +
isys/iface.h | 1 +
loader/net.c | 12 +++++++++++-
3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/isys/iface.c b/isys/iface.c
index ad39447..05446ee 100644
--- a/isys/iface.c
+++ b/isys/iface.c
@@ -385,6 +385,7 @@ void iface_init_iface_t(iface_t *iface) {
iface->flags = 0;
iface->ipv4method = IPV4_UNUSED_METHOD;
iface->ipv6method = IPV6_UNUSED_METHOD;
+ iface->defroute = 1;

return;
}
diff --git a/isys/iface.h b/isys/iface.h
index 8f90271..6344212 100644
--- a/isys/iface.h
+++ b/isys/iface.h
@@ -68,6 +68,7 @@ typedef struct _iface_t {
/* Gateway settings */
struct in_addr gateway;
struct in6_addr gateway6;
+ int defroute;

/* BOOTP (these can be IPv4 or IPv6, store human-readable version as str) */
char *nextserver;
diff --git a/loader/net.c b/loader/net.c
index 8446733..414b8b4 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1458,6 +1458,11 @@ int writeEnabledNetInfo(iface_t *iface) {
fprintf(fp, "MACADDR=%s
", iface->macaddr);
}

+ if (!iface->defroute) {
+ fprintf(fp, "DEFROUTE=no
");
+ logMessage(INFO, "not setting default route via %s", iface->device);
+ }
+
if (fclose(fp) == EOF) {
free(ofile);
free(nfile);
@@ -1537,7 +1542,7 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
gchar *bootProto = NULL, *device = NULL, *class = NULL, *ethtool = NULL;
gchar *essid = NULL, *wepkey = NULL, *onboot = NULL, *gateway = NULL;
gint mtu = 1500, dhcpTimeout = -1;
- gboolean noipv4 = FALSE, noipv6 = FALSE, noDns = FALSE, noksdev = FALSE, activate = FALSE;
+ gboolean noipv4 = FALSE, noipv6 = FALSE, noDns = FALSE, noksdev = FALSE, activate = FALSE, nodefroute=FALSE;
GOptionContext *optCon = g_option_context_new(NULL);
GError *optErr = NULL;
struct in_addr addr;
@@ -1571,6 +1576,7 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
{ "onboot", 0, 0, G_OPTION_ARG_STRING, &onboot, NULL, NULL },
{ "notksdevice", 0, 0, G_OPTION_ARG_NONE, &noksdev, NULL, NULL },
{ "activate", 0, 0, G_OPTION_ARG_NONE, &activate, NULL, NULL },
+ { "nodefroute", 0, 0, G_OPTION_ARG_NONE, &nodefroute, NULL, NULL },
{ "dhcptimeout", 0, 0, G_OPTION_ARG_INT, &dhcpTimeout, NULL, NULL },
{ NULL },
};
@@ -1695,6 +1701,10 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
loaderData->noDns = 1;
}

+ if (nodefroute) {
+ iface.defroute = 0;
+ }
+
if (!is_nm_connected()) {
logMessage(INFO, "activating because no network connection is available");
activateDevice(loaderData, &iface);
--
1.7.2

_______________________________________________
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 10:34 PM.

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