summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog42
-rw-r--r--loader2/cdinstall.c2
-rw-r--r--loader2/driverdisk.c2
-rw-r--r--loader2/firewire.c2
-rw-r--r--loader2/hardware.c2
-rw-r--r--loader2/hdinstall.c2
-rw-r--r--loader2/kbd.c2
-rw-r--r--loader2/kickstart.c2
-rw-r--r--loader2/lang.c2
-rw-r--r--loader2/loader.c135
-rw-r--r--loader2/loader.h141
-rw-r--r--loader2/method.c2
-rw-r--r--loader2/modules.c2
-rw-r--r--loader2/net.c109
-rw-r--r--loader2/net.h2
-rw-r--r--loader2/nfsinstall.c2
-rw-r--r--loader2/pcmcia.c2
-rw-r--r--loader2/telnetd.c2
-rw-r--r--loader2/urlinstall.c2
-rw-r--r--loader2/urls.c2
-rw-r--r--loader2/usb.c2
21 files changed, 265 insertions, 196 deletions
diff --git a/ChangeLog b/ChangeLog
index 93a918112..da8c1f2b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2007-08-06 David Cantrell <dcantrell@redhat.com>
+
+ * loader2/cdinstall.c: extern int flags -> extern uint64_t flags
+ (#250895)
+ * loader2/driverdisk.c: Likewise.
+ * loader2/firewire.c: Likewise.
+ * loader2/hardware.c: Likewise.
+ * loader2/hdinstall.c: Likewise.
+ * loader2/kbd.c: Likewise.
+ * loader2/kickstart.c: Likewise.
+ * loader2/lang.c: Likewise.
+ * loader2/loader.c: Likewise.
+ * loader2/method.c: Likewise.
+ * loader2/modules.c: Likewise.
+ * loader2/net.c: Likewise.
+ * loader2/nfsinstall.c: Likewise.
+ * loader2/pcmcia.c: Likewise.
+ * loader2/telnetd.c: Likewise.
+ * loader2/urlinstall.c: Likewise.
+ * loader2/urls.c: Likewise.
+ * loader2/usb.c: Likewise.
+
+ * loader2/loader.c (parseCmdLineIp): Set LOADER_FLAGS_IP_PARAM
+ (#250895).
+ * loader2/loader.c (parseCmdLineIpv6: Set LOADER_FLAGS_IPV6_PARAM
+ (#250895).
+ * loader2/loader.c (parseCmdLineFlags): Remove noipv4 and noipv6
+ flags from loaderData, just use the flags variable now. Replace all
+ uses of the loaderData->noipv{4,6} variables with flags usage.
+ (#250895)
+
+ * loader2/loader.h: Increase LOADER_FLAGS_* to uint64_t, remove the
+ noipv4 and noipv6 members from struct loaderData_s (#250895).
+
+ * loader2/net.c: Do not use the noipv4/noipv6 members from the
+ loaderData struct or the networkDeviceConfig struct. Use only
+ the settings in the flags variable. Do not display the Configure
+ TCP/IP window if all necessary IPv4 and IPv6 configuration
+ parameters are passed at the boot prompt (#250895).
+ * loader2/net.h: remove noipv4 and noipv6 members from struct
+ networkDeviceConfig (#250895).
+
2007-08-06 Chris Lumens <clumens@redhat.com>
* anaconda.spec: Bump version.
diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c
index ec2d47d4f..a38ba9b53 100644
--- a/loader2/cdinstall.c
+++ b/loader2/cdinstall.c
@@ -43,7 +43,7 @@
#include "../isys/isys.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
static int getISOStatusFromFD(int isofd, char *mediasum);
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 338f2acb1..8484205b5 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -48,7 +48,7 @@
#include "../isys/eddsupport.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
static char * driverDiskFiles[] = { "modinfo", "modules.dep",
"modules.cgz", "modules.alias", NULL };
diff --git a/loader2/firewire.c b/loader2/firewire.c
index abe36b2cd..5a59e14bc 100644
--- a/loader2/firewire.c
+++ b/loader2/firewire.c
@@ -26,7 +26,7 @@
#include "windows.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
int firewireInitialize(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo) {
diff --git a/loader2/hardware.c b/loader2/hardware.c
index ccdbb3c93..08100ca52 100644
--- a/loader2/hardware.c
+++ b/loader2/hardware.c
@@ -37,7 +37,7 @@
#include "../isys/isys.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
/* returns whether or not we can probe devices automatically or have to
* ask for them manually. */
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index 5754a4c07..042791ab9 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -43,7 +43,7 @@
#include "../isys/eddsupport.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
/* pull in second stage image for hard drive install */
static int loadHDImages(char * prefix, char * dir,
diff --git a/loader2/kbd.c b/loader2/kbd.c
index dc87abe67..4e684cfed 100644
--- a/loader2/kbd.c
+++ b/loader2/kbd.c
@@ -32,7 +32,7 @@
#include "../isys/lang.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
int chooseKeyboard(struct loaderData_s * loaderData, char ** kbdtypep) {
int num = -1;
diff --git a/loader2/kickstart.c b/loader2/kickstart.c
index b21f77d32..51051fe02 100644
--- a/loader2/kickstart.c
+++ b/loader2/kickstart.c
@@ -49,7 +49,7 @@
#include "../isys/isys.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
struct ksCommandNames {
int code;
diff --git a/loader2/lang.c b/loader2/lang.c
index 6d6ccb662..4785a308d 100644
--- a/loader2/lang.c
+++ b/loader2/lang.c
@@ -39,7 +39,7 @@
#include "../isys/isys.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
struct aString {
unsigned int hash;
diff --git a/loader2/loader.c b/loader2/loader.c
index 004f7efdd..63bcd77df 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -34,6 +34,7 @@
#include <strings.h>
#include <syslog.h>
#include <unistd.h>
+#include <stdint.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -100,7 +101,7 @@ static int hasGraphicalOverride();
static int newtRunning = 0;
/* boot flags -- we need these in a lot of places */
-int flags = LOADER_FLAGS_SELINUX;
+uint64_t flags = LOADER_FLAGS_SELINUX;
#ifdef INCLUDE_LOCAL
#include "cdinstall.h"
@@ -512,44 +513,48 @@ static void readNetInfo(struct loaderData_s ** ld) {
*/
static void parseCmdLineIp(struct loaderData_s * loaderData, char *argv)
{
- /* Detect pxelinux */
- if (strstr(argv, ":") != NULL) {
- char *start, *end;
-
- /* IP */
- start = argv + 3;
- end = strstr(start, ":");
- loaderData->ipv4 = strndup(start, end-start);
- loaderData->ipinfo_set = 0;
-
- /* Boot server */
- if (end + 1 == '\0')
- return;
- start = end + 1;
- end = strstr(start, ":");
- if (end == NULL)
- return;
-
- /* Gateway */
- if (end + 1 == '\0')
- return;
- start = end + 1;
- end = strstr(start, ":");
- if (end == NULL) {
- loaderData->gateway = strdup (start);
- return;
- } else
- loaderData->gateway = strndup(start, end-start);
-
- /* Netmask */
- if (end + 1 == '\0')
- return;
- start = end + 1;
- loaderData->netmask = strdup(start);
- } else {
- loaderData->ipv4 = strdup(argv + 3);
- loaderData->ipinfo_set = 0;
- }
+ /* Detect pxelinux */
+ if (strstr(argv, ":") != NULL) {
+ char *start, *end;
+
+ /* IP */
+ start = argv + 3;
+ end = strstr(start, ":");
+ loaderData->ipv4 = strndup(start, end-start);
+ loaderData->ipinfo_set = 0;
+
+ /* Boot server */
+ if (end + 1 == '\0')
+ return;
+ start = end + 1;
+ end = strstr(start, ":");
+ if (end == NULL)
+ return;
+
+ /* Gateway */
+ if (end + 1 == '\0')
+ return;
+ start = end + 1;
+ end = strstr(start, ":");
+ if (end == NULL) {
+ loaderData->gateway = strdup (start);
+ return;
+ } else {
+ loaderData->gateway = strndup(start, end-start);
+ }
+
+ /* Netmask */
+ if (end + 1 == '\0')
+ return;
+ start = end + 1;
+ loaderData->netmask = strdup(start);
+ } else {
+ loaderData->ipv4 = strdup(argv + 3);
+ loaderData->ipinfo_set = 0;
+ }
+
+ if (loaderData->ipinfo_set)
+ flags |= LOADER_FLAGS_IP_PARAM;
}
/*
@@ -561,12 +566,17 @@ static void parseCmdLineIpv6(struct loaderData_s * loaderData, char *argv)
* dhcp DHCPv6 call
* auto RFC 2461 neighbor discovery
*/
- if (!strncmp(str2lower(argv), "dhcp", 4)) {
+ loaderData->ipv6 = NULL;
+
+ if (!strncmp(str2lower(argv), "ipv6=dhcp", 9)) {
loaderData->ipv6 = strdup("dhcp");
- loaderData->ipv6info_set = 1;
- } else if (!strncmp(str2lower(argv), "auto", 4)) {
+ } else if (!strncmp(str2lower(argv), "ipv6=auto", 9)) {
loaderData->ipv6 = strdup("auto");
+ }
+
+ if (loaderData->ipv6 != NULL) {
loaderData->ipv6info_set = 1;
+ flags |= LOADER_FLAGS_IPV6_PARAM;
}
return;
@@ -672,10 +682,11 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData,
flags |= LOADER_FLAGS_NOPASS;
else if (!strcasecmp(argv[i], "serial"))
flags |= LOADER_FLAGS_SERIAL;
- else if (!strcasecmp(argv[i], "noipv6")) {
+ else if (!strcasecmp(argv[i], "noipv4"))
+ flags |= LOADER_FLAGS_NOIPV4;
+ else if (!strcasecmp(argv[i], "noipv6"))
flags |= LOADER_FLAGS_NOIPV6;
- loaderData->noipv6 = 1;
- } else if (!strcasecmp(argv[i], "kssendmac"))
+ else if (!strcasecmp(argv[i], "kssendmac"))
flags |= LOADER_FLAGS_KICKSTART_SEND_MAC;
else if (!strncasecmp(argv[i], "loglevel=", 9)) {
if (!strcasecmp(argv[i]+9, "debug")) {
@@ -1133,7 +1144,7 @@ static char *doLoaderMain(char * location,
setupNetworkDeviceConfig(&netDev, loaderData);
rc = readNetConfig(devName, &netDev, loaderData->netCls, methodNum);
- if ((loaderData->noipv4 = netDev.noipv4) == 1) {
+ if (FL_NOIPV4(flags)) {
loaderData->ipinfo_set = 0;
} else {
if (loaderData->ipv4 == NULL) {
@@ -1156,7 +1167,7 @@ static char *doLoaderMain(char * location,
loaderData->ipinfo_set = 1;
}
- if ((loaderData->noipv6 = netDev.noipv6) == 1) {
+ if (FL_NOIPV6(flags)) {
loaderData->ipv6info_set = 0;
} else {
if (loaderData->ipv6 == NULL) {
@@ -1239,7 +1250,7 @@ static int manualDeviceCheck(struct loaderData_s *loaderData) {
devices = malloc((modLoaded->numModules + 1) * sizeof(*devices));
for (i = 0, j = 0; i < modLoaded->numModules; i++) {
if (!modLoaded->mods[i].weLoaded) continue;
-
+
if (!(mi = findModuleInfo(modInfo, modLoaded->mods[i].name)) ||
(!mi->description))
continue;
@@ -1440,7 +1451,7 @@ int main(int argc, char ** argv) {
execl("/bin/sh", "-/bin/sh", NULL);
exit(0);
}
-
+
f = fopen("/var/run/loader.run", "w+");
fprintf(f, "%d\n", getpid());
fclose(f);
@@ -1531,14 +1542,14 @@ int main(int argc, char ** argv) {
/* Note we *always* do this. If you could avoid this you could get
a system w/o USB keyboard support, which would be bad. */
usbInitialize(modLoaded, modDeps, modInfo);
-
+
/* now let's initialize any possible firewire. fun */
firewireInitialize(modLoaded, modDeps, modInfo);
/* explicitly read this to let libkudzu know we want to merge
* in future tables rather than replace the initial one */
pciReadDrivers("/modules/modules.alias");
-
+
if (loaderData.lang && (loaderData.lang_set == 1)) {
setLanguage(loaderData.lang);
}
@@ -1550,7 +1561,7 @@ int main(int argc, char ** argv) {
if (!canProbeDevices() || FL_MODDISK(flags)) {
startNewt();
-
+
loadDriverDisks(CLASS_UNSPEC, &loaderData);
}
@@ -1558,7 +1569,7 @@ int main(int argc, char ** argv) {
logMessage(INFO, "found /dd.img, loading drivers");
getDDFromSource(&loaderData, "path:/dd.img");
}
-
+
/* this allows us to do an early load of modules specified on the
* command line to allow automating the load order of modules so that
* eg, certain scsi controllers are definitely first.
@@ -1611,7 +1622,7 @@ int main(int argc, char ** argv) {
} else {
/* FIXME: this is a bad hack for libselinux assuming things
* about paths */
- int ret;
+ int ret;
ret = symlink("/mnt/runtime/etc/selinux", "/etc/selinux");
if (loadpolicy() == 0) {
setexeccon(ANACONDA_CONTEXT);
@@ -1623,7 +1634,7 @@ int main(int argc, char ** argv) {
}
logMessage(INFO, "getting ready to spawn shell now");
-
+
spawnShell(); /* we can attach gdb now :-) */
/* JKFIXME: kickstart devices crap... probably kind of bogus now though */
@@ -1708,7 +1719,7 @@ int main(int argc, char ** argv) {
mkdirChain("/tmp/updates");
logMessage(INFO, "Running anaconda script %s", *(argptr-1));
-
+
*argptr++ = "-m";
if (strncmp(url, "ftp:", 4)) {
*argptr++ = url;
@@ -1726,7 +1737,7 @@ int main(int argc, char ** argv) {
tmparg = extraArgs;
while (*tmparg) {
char *idx;
-
+
logMessage(DEBUGLVL, "adding extraArg %s", *tmparg);
idx = strchr(*tmparg, '=');
if (idx && ((idx-*tmparg) < strlen(*tmparg))) {
@@ -1736,14 +1747,14 @@ int main(int argc, char ** argv) {
} else {
*argptr++ = *tmparg;
}
-
+
tmparg++;
}
- if (loaderData.noipv4)
+ if (FL_NOIPV4(flags))
*argptr++ = "--noipv4";
- if (loaderData.noipv6)
+ if (FL_NOIPV6(flags))
*argptr++ = "--noipv6";
if (FL_RESCUE(flags)) {
@@ -1765,7 +1776,7 @@ int main(int argc, char ** argv) {
*argptr++ = "--noselinux";
else if (FL_SELINUX(flags))
*argptr++ = "--selinux";
-
+
if (FL_KICKSTART(flags)) {
*argptr++ = "--kickstart";
*argptr++ = loaderData.ksFile;
@@ -1785,7 +1796,7 @@ int main(int argc, char ** argv) {
*argptr++ = "--lang";
*argptr++ = loaderData.lang;
}
-
+
if ((loaderData.kbd) && !FL_NOPASS(flags)) {
*argptr++ = "--keymap";
*argptr++ = loaderData.kbd;
diff --git a/loader2/loader.h b/loader2/loader.h
index 8a35b27f7..5c47e1cba 100644
--- a/loader2/loader.h
+++ b/loader2/loader.h
@@ -1,3 +1,5 @@
+#include <stdint.h>
+
#ifndef LOADER_H
#define LOADER_H
@@ -8,73 +10,81 @@
#define GUI_STAGE2_RAM 196608
-#define LOADER_FLAGS_TESTING (1 << 0)
-#define LOADER_FLAGS_EXPERT (1 << 1)
-#define LOADER_FLAGS_TEXT (1 << 2)
-#define LOADER_FLAGS_RESCUE (1 << 3)
-#define LOADER_FLAGS_KICKSTART (1 << 4)
-#define LOADER_FLAGS_KICKSTART_SEND_MAC (1 << 5)
-#define LOADER_FLAGS_POWEROFF (1 << 6)
-#define LOADER_FLAGS_NONET (1 << 7)
-#define LOADER_FLAGS_MODDISK (1 << 8)
-#define LOADER_FLAGS_ISA (1 << 9)
-#define LOADER_FLAGS_SERIAL (1 << 10)
-#define LOADER_FLAGS_UPDATES (1 << 11)
-#define LOADER_FLAGS_KSFILE (1 << 12)
-#define LOADER_FLAGS_HALT (1 << 13)
-#define LOADER_FLAGS_SELINUX (1 << 14)
-#define LOADER_FLAGS_VIRTPCONSOLE (1 << 15)
-#define LOADER_FLAGS_NOUSB (1 << 16)
-#define LOADER_FLAGS_NOSHELL (1 << 17)
-#define LOADER_FLAGS_NOPCMCIA (1 << 18)
-#define LOADER_FLAGS_TELNETD (1 << 19)
-#define LOADER_FLAGS_NOPASS (1 << 20)
-#define LOADER_FLAGS_UB (1 << 21)
-#define LOADER_FLAGS_MEDIACHECK (1 << 22)
-#define LOADER_FLAGS_NOUSBSTORAGE (1 << 23)
-#define LOADER_FLAGS_ASKMETHOD (1 << 24)
-#define LOADER_FLAGS_ASKNETWORK (1 << 25)
-#define LOADER_FLAGS_NOIEEE1394 (1 << 26)
-#define LOADER_FLAGS_NOFB (1 << 27)
-#define LOADER_FLAGS_CMDLINE (1 << 28)
-#define LOADER_FLAGS_GRAPHICAL (1 << 29)
-#define LOADER_FLAGS_NOSTORAGE (1 << 30)
-#define LOADER_FLAGS_NOIPV6 (1 << 31)
+#define LOADER_FLAGS_TESTING (((uint64_t) 1) << 0)
+#define LOADER_FLAGS_EXPERT (((uint64_t) 1) << 1)
+#define LOADER_FLAGS_TEXT (((uint64_t) 1) << 2)
+#define LOADER_FLAGS_RESCUE (((uint64_t) 1) << 3)
+#define LOADER_FLAGS_KICKSTART (((uint64_t) 1) << 4)
+#define LOADER_FLAGS_KICKSTART_SEND_MAC (((uint64_t) 1) << 5)
+#define LOADER_FLAGS_POWEROFF (((uint64_t) 1) << 6)
+#define LOADER_FLAGS_NONET (((uint64_t) 1) << 7)
+#define LOADER_FLAGS_MODDISK (((uint64_t) 1) << 8)
+#define LOADER_FLAGS_ISA (((uint64_t) 1) << 9)
+#define LOADER_FLAGS_SERIAL (((uint64_t) 1) << 10)
+#define LOADER_FLAGS_UPDATES (((uint64_t) 1) << 11)
+#define LOADER_FLAGS_KSFILE (((uint64_t) 1) << 12)
+#define LOADER_FLAGS_HALT (((uint64_t) 1) << 13)
+#define LOADER_FLAGS_SELINUX (((uint64_t) 1) << 14)
+#define LOADER_FLAGS_VIRTPCONSOLE (((uint64_t) 1) << 15)
+#define LOADER_FLAGS_NOUSB (((uint64_t) 1) << 16)
+#define LOADER_FLAGS_NOSHELL (((uint64_t) 1) << 17)
+#define LOADER_FLAGS_NOPCMCIA (((uint64_t) 1) << 18)
+#define LOADER_FLAGS_TELNETD (((uint64_t) 1) << 19)
+#define LOADER_FLAGS_NOPASS (((uint64_t) 1) << 20)
+#define LOADER_FLAGS_UB (((uint64_t) 1) << 21)
+#define LOADER_FLAGS_MEDIACHECK (((uint64_t) 1) << 22)
+#define LOADER_FLAGS_NOUSBSTORAGE (((uint64_t) 1) << 23)
+#define LOADER_FLAGS_ASKMETHOD (((uint64_t) 1) << 24)
+#define LOADER_FLAGS_ASKNETWORK (((uint64_t) 1) << 25)
+#define LOADER_FLAGS_NOIEEE1394 (((uint64_t) 1) << 26)
+#define LOADER_FLAGS_NOFB (((uint64_t) 1) << 27)
+#define LOADER_FLAGS_CMDLINE (((uint64_t) 1) << 28)
+#define LOADER_FLAGS_GRAPHICAL (((uint64_t) 1) << 29)
+#define LOADER_FLAGS_NOSTORAGE (((uint64_t) 1) << 30)
+#define LOADER_FLAGS_NOIPV4 (((uint64_t) 1) << 31)
+#define LOADER_FLAGS_NOIPV6 (((uint64_t) 1) << 32)
+#define LOADER_FLAGS_IP_PARAM (((uint64_t) 1) << 33)
+#define LOADER_FLAGS_IPV6_PARAM (((uint64_t) 1) << 34)
-#define FL_TESTING(a) ((a) & LOADER_FLAGS_TESTING)
-#define FL_EXPERT(a) ((a) & LOADER_FLAGS_EXPERT)
-#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT)
-#define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE)
-#define FL_KICKSTART(a) ((a) & LOADER_FLAGS_KICKSTART)
+#define FL_TESTING(a) ((a) & LOADER_FLAGS_TESTING)
+#define FL_EXPERT(a) ((a) & LOADER_FLAGS_EXPERT)
+#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT)
+#define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE)
+#define FL_KICKSTART(a) ((a) & LOADER_FLAGS_KICKSTART)
#define FL_KICKSTART_SEND_MAC(a) ((a) & LOADER_FLAGS_KICKSTART_SEND_MAC)
-#define FL_POWEROFF(a) ((a) & LOADER_FLAGS_POWEROFF)
-#define FL_NONET(a) ((a) & LOADER_FLAGS_NONET)
-#define FL_MODDISK(a) ((a) & LOADER_FLAGS_MODDISK)
-#define FL_ISA(a) ((a) & LOADER_FLAGS_ISA)
-#define FL_SERIAL(a) ((a) & LOADER_FLAGS_SERIAL)
-#define FL_UPDATES(a) ((a) & LOADER_FLAGS_UPDATES)
-#define FL_KSFILE(a) ((a) & LOADER_FLAGS_KSFILE)
-#define FL_NOUSB(a) ((a) & LOADER_FLAGS_NOUSB)
-#define FL_NOSHELL(a) ((a) & LOADER_FLAGS_NOSHELL)
-#define FL_NOPCMCIA(a) ((a) & LOADER_FLAGS_NOPCMCIA)
-#define FL_RESCUE_NOMOUNT(a) ((a) & LOADER_FLAGS_RESCUE_NOMOUNT)
-#define FL_TELNETD(a) ((a) & LOADER_FLAGS_TELNETD)
-#define FL_NOPASS(a) ((a) & LOADER_FLAGS_NOPASS)
-#define FL_MEDIACHECK(a) ((a) & LOADER_FLAGS_MEDIACHECK)
-#define FL_NOUSBSTORAGE(a) ((a) & LOADER_FLAGS_NOUSBSTORAGE)
-#define FL_ASKMETHOD(a) ((a) & LOADER_FLAGS_ASKMETHOD)
-#define FL_NOIEEE1394(a) ((a) & LOADER_FLAGS_NOIEEE1394)
-#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB)
-#define FL_GRAPHICAL(a) ((a) & LOADER_FLAGS_GRAPHICAL)
-#define FL_CMDLINE(a) ((a) & LOADER_FLAGS_CMDLINE)
-#define FL_HALT(a) ((a) & LOADER_FLAGS_HALT)
-#define FL_SELINUX(a) ((a) & LOADER_FLAGS_SELINUX)
-#define FL_VIRTPCONSOLE(a) ((a) & LOADER_FLAGS_VIRTPCONSOLE)
-#define FL_NOSTORAGE(a) ((a) & LOADER_FLAGS_NOSTORAGE)
-#define FL_NOPROBE(a) (FL_NOSTORAGE(a) | FL_NONET(a))
-#define FL_ASKNETWORK(a) ((a) & LOADER_FLAGS_ASKNETWORK)
-#define FL_UB(a) ((a) & LOADER_FLAGS_UB)
-#define FL_NOIPV6(a) ((a) & LOADER_FLAGS_NOIPV6)
+#define FL_POWEROFF(a) ((a) & LOADER_FLAGS_POWEROFF)
+#define FL_NONET(a) ((a) & LOADER_FLAGS_NONET)
+#define FL_MODDISK(a) ((a) & LOADER_FLAGS_MODDISK)
+#define FL_ISA(a) ((a) & LOADER_FLAGS_ISA)
+#define FL_SERIAL(a) ((a) & LOADER_FLAGS_SERIAL)
+#define FL_UPDATES(a) ((a) & LOADER_FLAGS_UPDATES)
+#define FL_KSFILE(a) ((a) & LOADER_FLAGS_KSFILE)
+#define FL_NOUSB(a) ((a) & LOADER_FLAGS_NOUSB)
+#define FL_NOSHELL(a) ((a) & LOADER_FLAGS_NOSHELL)
+#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB)
+#define FL_NOPCMCIA(a) ((a) & LOADER_FLAGS_NOPCMCIA)
+#define FL_RESCUE_NOMOUNT(a) ((a) & LOADER_FLAGS_RESCUE_NOMOUNT)
+#define FL_TELNETD(a) ((a) & LOADER_FLAGS_TELNETD)
+#define FL_NOPASS(a) ((a) & LOADER_FLAGS_NOPASS)
+#define FL_MEDIACHECK(a) ((a) & LOADER_FLAGS_MEDIACHECK)
+#define FL_NOUSBSTORAGE(a) ((a) & LOADER_FLAGS_NOUSBSTORAGE)
+#define FL_ASKMETHOD(a) ((a) & LOADER_FLAGS_ASKMETHOD)
+#define FL_NOPARPORT(a) ((a) & LOADER_FLAGS_NOPARPORT)
+#define FL_NOIEEE1394(a) ((a) & LOADER_FLAGS_NOIEEE1394)
+#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB)
+#define FL_GRAPHICAL(a) ((a) & LOADER_FLAGS_GRAPHICAL)
+#define FL_CMDLINE(a) ((a) & LOADER_FLAGS_CMDLINE)
+#define FL_HALT(a) ((a) & LOADER_FLAGS_HALT)
+#define FL_SELINUX(a) ((a) & LOADER_FLAGS_SELINUX)
+#define FL_VIRTPCONSOLE(a) ((a) & LOADER_FLAGS_VIRTPCONSOLE)
+#define FL_NOSTORAGE(a) ((a) & LOADER_FLAGS_NOSTORAGE)
+#define FL_NOPROBE(a) (FL_NOSTORAGE((a)) | FL_NONET((a)))
+#define FL_ASKNETWORK(a) ((a) & LOADER_FLAGS_ASKNETWORK)
+#define FL_UB(a) ((a) & LOADER_FLAGS_UB)
+#define FL_NOIPV4(a) ((a) & LOADER_FLAGS_NOIPV4)
+#define FL_NOIPV6(a) ((a) & LOADER_FLAGS_NOIPV6)
+#define FL_IP_PARAM(a) ((a) & LOADER_FLAGS_IP_PARAM)
+#define FL_IPV6_PARAM(a) ((a) & LOADER_FLAGS_IPV6_PARAM)
void startNewt(void);
void stopNewt(void);
@@ -102,7 +112,6 @@ struct loaderData_s {
int noDns;
int ipinfo_set;
int ipv6info_set;
- int noipv4, noipv6;
char * ksFile;
int method;
char * ddsrc;
diff --git a/loader2/method.c b/loader2/method.c
index ce32caab6..4cf4764b9 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -50,7 +50,7 @@
#include "urlinstall.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
int umountLoopback(char * mntpoint, char * device) {
int loopfd;
diff --git a/loader2/modules.c b/loader2/modules.c
index e8a219e57..1577afa2e 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -41,7 +41,7 @@
#include "../isys/cpio.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
static int writeModulesConf(moduleList list, char *conf);
static struct extractedModule * extractModules (char * const * modNames,
diff --git a/loader2/net.c b/loader2/net.c
index ac215f660..c73e682e9 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -53,7 +53,7 @@
#include "windows.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
char *netServerPrompt = \
N_("Please enter the following information:\n"
@@ -365,13 +365,6 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
printLoaderDataIPINFO(loaderData);
#endif
- cfg->noipv4 = 0;
- if (FL_NOIPV6(flags)) {
- cfg->noipv6 = 1;
- } else {
- cfg->noipv6 = 0;
- }
-
if (loaderData->ethtool) {
parseEthtoolSettings(loaderData);
}
@@ -419,8 +412,6 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
if (!FL_TESTING(flags)) {
waitForLink(loaderData->netDev);
- cfg->noipv4 = loaderData->noipv4;
- cfg->noipv6 = loaderData->noipv6;
cfg->noDns = loaderData->noDns;
ret = doDhcp(cfg);
}
@@ -534,8 +525,6 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
parseEthtoolSettings(loaderData);
}
- cfg->noipv4 = loaderData->noipv4;
- cfg->noipv6 = loaderData->noipv6;
cfg->noDns = loaderData->noDns;
}
@@ -630,9 +619,7 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg,
}
}
- cfg->noipv4 = newCfg.noipv4;
cfg->ipv4method = newCfg.ipv4method;
- cfg->noipv6 = newCfg.noipv6;
cfg->ipv6method = newCfg.ipv6method;
/* preserve extra dns servers for the sake of being nice */
@@ -704,7 +691,7 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg,
int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
struct networkDeviceConfig * newCfg,
struct netconfopts * opts, int methodNum) {
- int i = 0, z = 0;
+ int i = 0, z = 0, skipForm = 0;
char *dret = NULL;
newtComponent f, okay, back, answer;
newtComponent ipv4Checkbox, ipv6Checkbox, v4Method[2], v6Method[3];
@@ -713,8 +700,12 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
/* UI WINDOW 1: ask for ipv4 choice, ipv6 choice, and conf methods */
/* IPv4 checkbox */
- if (!opts->ipv4Choice)
- opts->ipv4Choice = '*';
+ if (!opts->ipv4Choice) {
+ if (FL_NOIPV4(flags) && !FL_IP_PARAM(flags))
+ opts->ipv4Choice = ' ';
+ else
+ opts->ipv4Choice = '*';
+ }
ipv4Checkbox = newtCheckbox(-1, -1, _("Enable IPv4 support"),
opts->ipv4Choice, NULL, &(opts->ipv4Choice));
@@ -723,7 +714,7 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
/* IPv6 checkbox */
if (!opts->ipv6Choice) {
- if (FL_NOIPV6(flags))
+ if (FL_NOIPV6(flags) && !FL_IPV6_PARAM(flags))
opts->ipv6Choice = ' ';
else
opts->ipv6Choice = '*';
@@ -776,53 +767,69 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
if (opts->ipv6Choice == ' ')
setMethodSensitivity(&v6Method, 3);
+ /* If the user provided any of the following boot paramters, skip
+ * prompting for network configuration information:
+ * ip=<val> ipv6=<val>
+ * noipv4 noipv6
+ * ip=<val> noipv6
+ * ipv6=<val> noipv4
+ */
+ if ((FL_IP_PARAM(flags) && FL_IPV6_PARAM(flags)) ||
+ (FL_IP_PARAM(flags) && FL_NOIPV6(flags)) ||
+ (FL_IPV6_PARAM(flags) && FL_NOIPV4(flags)) ||
+ (FL_NOIPV4(flags) && FL_NOIPV6(flags))) {
+ skipForm = 1;
+ }
+
/* run the form */
do {
- answer = newtRunForm(f);
+ if (!skipForm) {
+ answer = newtRunForm(f);
- if (answer == back) {
- newtFormDestroy(f);
- newtPopWindow();
- return LOADER_BACK;
- }
+ if (answer == back) {
+ newtFormDestroy(f);
+ newtPopWindow();
+ return LOADER_BACK;
+ }
- /* need at least one stack */
- if (opts->ipv4Choice == ' ' && opts->ipv6Choice == ' ') {
- newtWinMessage(_("Missing Protocol"), _("Retry"),
- _("You must select at least one protocol (IPv4 "
- "or IPv6)."));
- continue;
- }
+ /* need at least one stack */
+ if (opts->ipv4Choice == ' ' && opts->ipv6Choice == ' ') {
+ newtWinMessage(_("Missing Protocol"), _("Retry"),
+ _("You must select at least one protocol (IPv4 "
+ "or IPv6)."));
+ continue;
+ }
- /* NFS only works over IPv4 */
- if (opts->ipv4Choice == ' ' && methodNum == METHOD_NFS) {
- newtWinMessage(_("IPv4 Needed for NFS"), _("Retry"),
+ /* NFS only works over IPv4 */
+ if (opts->ipv4Choice == ' ' && methodNum == METHOD_NFS) {
+ newtWinMessage(_("IPv4 Needed for NFS"), _("Retry"),
_("NFS installation method requires IPv4 support."));
- continue;
+ continue;
+ }
}
/* what TCP/IP stacks do we use? what conf methods? */
if (opts->ipv4Choice == '*') {
- newCfg->noipv4 = 0;
+ flags &= ~LOADER_FLAGS_NOIPV4;
for (z = 0; z < 2; z++)
if (newtRadioGetCurrent(v4Method[0]) == v4Method[z])
newCfg->ipv4method = z;
} else {
- newCfg->noipv4 = 1;
+ flags |= LOADER_FLAGS_NOIPV4;
}
if (opts->ipv6Choice == '*') {
- newCfg->noipv6 = 0;
+ flags &= ~LOADER_FLAGS_NOIPV6;
for (z = 0; z < 3; z++)
if (newtRadioGetCurrent(v6Method[0]) == v6Method[z])
newCfg->ipv6method = z;
} else {
- newCfg->noipv6 = 1;
+ flags |= LOADER_FLAGS_NOIPV6;
}
/* do interface configuration (call DHCP here, or return for manual) */
- if ((!newCfg->noipv4 && newCfg->ipv4method == IPV4_DHCP_METHOD) ||
- (!newCfg->noipv6 && (newCfg->ipv6method == IPV6_AUTO_METHOD ||
+ if ((!FL_NOIPV4(flags) && newCfg->ipv4method == IPV4_DHCP_METHOD) ||
+ (!FL_NOIPV6(flags) && (newCfg->ipv6method == IPV6_AUTO_METHOD ||
newCfg->ipv6method == IPV6_DHCP_METHOD))) {
/* do DHCP if selected */
if (!FL_TESTING(flags)) {
@@ -850,8 +857,8 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
&& (newCfg->ipv6method == IPV6_AUTO_METHOD ||
newCfg->ipv6method == IPV6_DHCP_METHOD))
|| (newCfg->ipv4method == IPV4_DHCP_METHOD
- && newCfg->noipv6)
- || (newCfg->noipv4
+ && FL_NOIPV6(flags))
+ || (FL_NOIPV4(flags)
&& (newCfg->ipv6method == IPV6_AUTO_METHOD ||
newCfg->ipv6method == IPV6_DHCP_METHOD))) {
i = getDnsServers(newCfg);
@@ -877,8 +884,8 @@ int configureTCPIP(char * device, struct networkDeviceConfig * cfg,
newtFormDestroy(f);
newtPopWindow();
- if ((!newCfg->noipv4 && newCfg->ipv4method == IPV4_MANUAL_METHOD) ||
- (!newCfg->noipv6 && newCfg->ipv6method == IPV6_MANUAL_METHOD))
+ if ((!FL_NOIPV4(flags) && newCfg->ipv4method == IPV4_MANUAL_METHOD) ||
+ (!FL_NOIPV6(flags) && newCfg->ipv6method == IPV6_MANUAL_METHOD))
return LOADER_OK;
else
return LOADER_NOOP;
@@ -1326,15 +1333,15 @@ char *doDhcp(struct networkDeviceConfig *dev) {
/* dhcp preferences are in /usr/include/libdhcp/dhcp_nic.h */
/* calling function should catch ipv4Choice & ipv6Choice both being ' ' */
- if (dev->noipv4 || dev->ipv4method == IPV4_MANUAL_METHOD) {
+ if (FL_NOIPV4(flags) || dev->ipv4method == IPV4_MANUAL_METHOD) {
/* IPv4 disabled entirely -or- manual IPv4 config selected */
pref |= DHCPv4_DISABLE;
}
/* IPv6 enabled -and- auto neighbor discovery selected */
/* IPv6 disabled entirely -or- manual IPv6 config selected */
- if ((!dev->noipv6 && dev->ipv6method == IPV6_AUTO_METHOD) ||
- (dev->noipv6 || dev->ipv6method == IPV6_MANUAL_METHOD)) {
+ if ((!FL_NOIPV6(flags) && dev->ipv6method == IPV6_AUTO_METHOD) ||
+ (FL_NOIPV6(flags) || dev->ipv6method == IPV6_MANUAL_METHOD)) {
pref |= DHCPv6_DISABLE | DHCPv6_DISABLE_ADDRESSES;
}
@@ -1411,7 +1418,7 @@ int writeNetInfo(const char * fn, struct networkDeviceConfig * dev) {
}
}
- if (!dev->noipv6) {
+ if (!FL_NOIPV6(flags)) {
if (dev->ipv6method == IPV6_AUTO_METHOD) {
fprintf(f, "IPV6_AUTOCONF=yes\n");
} else if (dev->ipv6method == IPV6_DHCP_METHOD) {
@@ -1659,10 +1666,10 @@ void setKickstartNetwork(struct loaderData_s * loaderData, int argc,
}
if (noipv4)
- loaderData->noipv4 = 1;
+ flags |= LOADER_FLAGS_NOIPV4;
if (noipv6)
- loaderData->noipv6 = 1;
+ flags |= LOADER_FLAGS_NOIPV6;
}
if (noDns) {
diff --git a/loader2/net.h b/loader2/net.h
index 506e2e210..f7be36812 100644
--- a/loader2/net.h
+++ b/loader2/net.h
@@ -31,7 +31,7 @@ struct networkDeviceConfig {
int isDynamic;
int noDns;
int preset;
- int noipv4, noipv6, ipv4method, ipv6method;
+ int ipv4method, ipv6method;
char * vendor_class;
/* s390 settings */
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 021ca0938..f29f0e700 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -35,7 +35,7 @@
#include "../isys/imount.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
int nfsGetSetup(char ** hostptr, char ** dirptr) {
struct newtWinEntry entries[3];
diff --git a/loader2/pcmcia.c b/loader2/pcmcia.c
index bf4b3df5e..2659366e9 100644
--- a/loader2/pcmcia.c
+++ b/loader2/pcmcia.c
@@ -31,7 +31,7 @@
#include "modules.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
char * getPcicController() {
struct device ** devices;
diff --git a/loader2/telnetd.c b/loader2/telnetd.c
index 75bce5222..c62474015 100644
--- a/loader2/telnetd.c
+++ b/loader2/telnetd.c
@@ -43,7 +43,7 @@
#endif
/* boot flags */
-extern int flags;
+extern uint64_t flags;
/* Forks, keeping the loader as our child (so we know when it dies). */
int beTelnet(void) {
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 1b799eb77..d76d21253 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -40,7 +40,7 @@
#include "windows.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
static int loadSingleUrlImage(struct iurlinfo * ui, char * file,
char * dest, char * mntpoint, char * device,
diff --git a/loader2/urls.c b/loader2/urls.c
index f4a3ffe9a..7ebb227f8 100644
--- a/loader2/urls.c
+++ b/loader2/urls.c
@@ -39,7 +39,7 @@
#include "net.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
/* convert a url (ftp or http) to a ui */
int convertURLToUI(char *url, struct iurlinfo *ui) {
diff --git a/loader2/usb.c b/loader2/usb.c
index 2ad625b89..4c4e8a109 100644
--- a/loader2/usb.c
+++ b/loader2/usb.c
@@ -33,7 +33,7 @@
#include "../isys/imount.h"
/* boot flags */
-extern int flags;
+extern uint64_t flags;
/* This forces a pause between initializing usb and trusting the /proc
stuff */