summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-06-18 06:02:42 +0000
committerJeremy Katz <katzj@redhat.com>2004-06-18 06:02:42 +0000
commit9f99ebaa92431d413567f18f76bb359082837a99 (patch)
treebfcb4cedb48c687c28b8278c3e247c61d82630c8
parent810113193294bf77ba6dd470cc093c2729f8dfb2 (diff)
downloadanaconda-9f99ebaa92431d413567f18f76bb359082837a99.tar.gz
anaconda-9f99ebaa92431d413567f18f76bb359082837a99.tar.xz
anaconda-9f99ebaa92431d413567f18f76bb359082837a99.zip
allow setting essid and wepkey in kickstart with --essid and --wepkey on
the network line
-rw-r--r--loader2/loader.h2
-rw-r--r--loader2/net.c33
2 files changed, 34 insertions, 1 deletions
diff --git a/loader2/loader.h b/loader2/loader.h
index d39130201..112eb4d81 100644
--- a/loader2/loader.h
+++ b/loader2/loader.h
@@ -87,7 +87,7 @@ struct loaderData_s {
int netDev_set;
char * netCls;
int netCls_set;
- char * ip, *netmask, *gateway, *dns, *hostname, *ptpaddr, *ethtool, *subchannels, *portname;
+ char * ip, *netmask, *gateway, *dns, *hostname, *ptpaddr, *ethtool, *subchannels, *portname, *essid, *wepkey;
int mtu;
int is_qeth;
int noDns;
diff --git a/loader2/net.c b/loader2/net.c
index e48a47ef1..250149481 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -56,6 +56,8 @@ struct intfconfig_s {
typedef int int32;
+static int setupWireless(struct networkDeviceConfig *dev);
+
static void ipCallback(newtComponent co, void * dptr) {
struct intfconfig_s * data = dptr;
struct in_addr ipaddr, nmaddr, addr;
@@ -253,6 +255,20 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
#endif
if (loaderData->ip) {
+ if (is_wireless_interface(loaderData->netDev)) {
+ if (loaderData->essid) {
+ logMessage("setting specified essid of %s", loaderData->essid);
+ cfg->essid = strdup(loaderData->essid);
+ }
+ if (loaderData->wepkey) {
+ logMessage("setting specified wepkey");
+ cfg->wepkey = strdup(loaderData->wepkey);
+ }
+ /* go ahead and set up the wireless interface in case
+ * we're using dhcp */
+ setupWireless(cfg);
+ }
+
/* this is how we specify dhcp */
if (!strncmp(loaderData->ip, "dhcp", 4)) {
char * chptr;
@@ -791,6 +807,7 @@ int findHostAndDomain(struct networkDeviceConfig * dev, int flags) {
void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
char ** argv, int * flagsPtr) {
char * arg, * bootProto = NULL, * device = NULL, *ethtool = NULL, * class = NULL;
+ char * essid = NULL, * wepkey = NULL;
int noDns = 0, rc;
poptContext optCon;
@@ -805,6 +822,8 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
{ "nodns", '\0', POPT_ARG_NONE, &noDns, 0 },
{ "hostname", '\0', POPT_ARG_STRING, NULL, 'h'},
{ "ethtool", '\0', POPT_ARG_STRING, &ethtool, 0 },
+ { "essid", '\0', POPT_ARG_STRING, &essid, 0 },
+ { "wepkey", '\0', POPT_ARG_STRING, &wepkey, 0 },
{ 0, 0, 0, 0, 0 }
};
@@ -880,6 +899,20 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
free(ethtool);
}
+ if (essid) {
+ if (loaderData->essid)
+ free(loaderData->essid);
+ loaderData->essid = strdup(essid);
+ free(essid);
+ }
+
+ if (wepkey) {
+ if (loaderData->wepkey)
+ free(loaderData->wepkey);
+ loaderData->wepkey = strdup(wepkey);
+ free(wepkey);
+ }
+
if (noDns) {
loaderData->noDns = 1;
}