From: "Brian C. Lane" bcl@redhat.com
If unsupported_hardware is included in the kickstart file skip the interactive dialog warning and log that it is installing on unsupported hardware.
Resolves: rhbz#824963 --- anaconda.spec.in | 2 +- loader/kickstart.c | 10 ++++++++++ loader/kickstart.h | 1 + loader/loader.c | 18 +++++++++++------- loader/loader.h | 2 ++ 5 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in index ff40ccb..f5ffe0d 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define intltoolver 0.31.2-3 %define libnlver 1.0 %define libselinuxver 1.6 -%define pykickstartver 1.74.11 +%define pykickstartver 1.74.12 %define rpmpythonver 4.2-0.61 %define slangver 2.0.6-2 %define yumver 2.9.2 diff --git a/loader/kickstart.c b/loader/kickstart.c index 0429d9d..27f5f66 100644 --- a/loader/kickstart.c +++ b/loader/kickstart.c @@ -89,6 +89,8 @@ static void setUpdates(struct loaderData_s * loaderData, int argc, char ** argv); static void setVnc(struct loaderData_s * loaderData, int argc, char ** argv); +static void setUnsupportedHw(struct loaderData_s * loaderData, int argc, + char ** argv);
struct ksCommandNames ksTable[] = { { KS_CMD_NFS, "nfs", setKickstartNfs }, @@ -110,6 +112,7 @@ struct ksCommandNames ksTable[] = { { KS_CMD_MEDIACHECK, "mediacheck", setMediaCheck }, { KS_CMD_UPDATES, "updates", setUpdates }, { KS_CMD_VNC, "vnc", setVnc }, + { KS_CMD_UNSUPPORTED_HW, "unsupported_hardware", setUnsupportedHw }, { KS_CMD_NONE, NULL, NULL } };
@@ -435,6 +438,13 @@ void getKickstartFile(struct loaderData_s *loaderData) { return; }
+static void setUnsupportedHw(struct loaderData_s * loaderData, int argc, + char ** argv) { + logMessage(INFO, "kickstart setting unsupported_hardware"); + flags |= LOADER_FLAGS_UNSUPPORTED_HW; + return; +} + static void setVnc(struct loaderData_s * loaderData, int argc, char ** argv) { logMessage(INFO, "kickstart forcing graphical mode over vnc"); diff --git a/loader/kickstart.h b/loader/kickstart.h index 24612cf..4a67940 100644 --- a/loader/kickstart.h +++ b/loader/kickstart.h @@ -41,6 +41,7 @@ #define KS_CMD_MEDIACHECK 17 #define KS_CMD_UPDATES 18 #define KS_CMD_VNC 19 +#define KS_CMD_UNSUPPORTED_HW 20
int ksReadCommands(char * cmdFile); int ksGetCommand(int cmd, char ** last, int * argc, char *** argv); diff --git a/loader/loader.c b/loader/loader.c index 52ddc5d..8c967be 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1276,13 +1276,17 @@ static void checkTaintFlag(void) { }
if (l & (1 << 28)) { - startNewt(); - newtWinMessage(_("Unsupported Hardware Detected"), _("OK"), - _("This hardware (or a combination thereof) is not " - "supported by Red Hat. For more information on " - "supported hardware, please refer to " - "http://www.redhat.com/hardware.")); - stopNewt(); + if(!FL_UNSUPPORTED_HW(flags)) { + startNewt(); + newtWinMessage(_("Unsupported Hardware Detected"), _("OK"), + _("This hardware (or a combination thereof) is not " + "supported by Red Hat. For more information on " + "supported hardware, please refer to " + "http://www.redhat.com/hardware.")); + stopNewt(); + } else { + logMessage(WARNING, "Installing on Unsupported Hardware."); + } }
g_free(contents); diff --git a/loader/loader.h b/loader/loader.h index 6df95f9..564dc6c 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -73,6 +73,7 @@ #define LOADER_FLAGS_AUTOMODDISK (((uint64_t) 1) << 40) #define LOADER_FLAGS_NOEJECT (((uint64_t) 1) << 41) #define LOADER_FLAGS_NOVERIFYSSL (((uint64_t) 1) << 42) +#define LOADER_FLAGS_UNSUPPORTED_HW (((uint64_t) 1) << 43)
#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT) #define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE) @@ -112,6 +113,7 @@ #define FL_AUTOMODDISK(a) ((a) & LOADER_FLAGS_AUTOMODDISK) #define FL_NOEJECT(a) ((a) & LOADER_FLAGS_NOEJECT) #define FL_NOVERIFYSSL(a) ((a) & LOADER_FLAGS_NOVERIFYSSL) +#define FL_UNSUPPORTED_HW(a) ((a) & LOADER_FLAGS_UNSUPPORTED_HW)
void startNewt(void); void stopNewt(void);
This looks good to me, but what about the pykickstart part? I tried to 'git grep' in the pykickstart's rhel6-branch and didn't find anything making this work.
On Fri, 2012-09-28 at 10:37 -0700, Brian C. Lane wrote:
From: "Brian C. Lane" bcl@redhat.com
If unsupported_hardware is included in the kickstart file skip the interactive dialog warning and log that it is installing on unsupported hardware.
Resolves: rhbz#824963
anaconda.spec.in | 2 +- loader/kickstart.c | 10 ++++++++++ loader/kickstart.h | 1 + loader/loader.c | 18 +++++++++++------- loader/loader.h | 2 ++ 5 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in index ff40ccb..f5ffe0d 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define intltoolver 0.31.2-3 %define libnlver 1.0 %define libselinuxver 1.6 -%define pykickstartver 1.74.11 +%define pykickstartver 1.74.12 %define rpmpythonver 4.2-0.61 %define slangver 2.0.6-2 %define yumver 2.9.2 diff --git a/loader/kickstart.c b/loader/kickstart.c index 0429d9d..27f5f66 100644 --- a/loader/kickstart.c +++ b/loader/kickstart.c @@ -89,6 +89,8 @@ static void setUpdates(struct loaderData_s * loaderData, int argc, char ** argv); static void setVnc(struct loaderData_s * loaderData, int argc, char ** argv); +static void setUnsupportedHw(struct loaderData_s * loaderData, int argc,
char ** argv);
struct ksCommandNames ksTable[] = { { KS_CMD_NFS, "nfs", setKickstartNfs }, @@ -110,6 +112,7 @@ struct ksCommandNames ksTable[] = { { KS_CMD_MEDIACHECK, "mediacheck", setMediaCheck }, { KS_CMD_UPDATES, "updates", setUpdates }, { KS_CMD_VNC, "vnc", setVnc },
- { KS_CMD_UNSUPPORTED_HW, "unsupported_hardware", setUnsupportedHw }, { KS_CMD_NONE, NULL, NULL }
};
@@ -435,6 +438,13 @@ void getKickstartFile(struct loaderData_s *loaderData) { return; }
+static void setUnsupportedHw(struct loaderData_s * loaderData, int argc,
char ** argv) {
- logMessage(INFO, "kickstart setting unsupported_hardware");
- flags |= LOADER_FLAGS_UNSUPPORTED_HW;
- return;
+}
static void setVnc(struct loaderData_s * loaderData, int argc, char ** argv) { logMessage(INFO, "kickstart forcing graphical mode over vnc"); diff --git a/loader/kickstart.h b/loader/kickstart.h index 24612cf..4a67940 100644 --- a/loader/kickstart.h +++ b/loader/kickstart.h @@ -41,6 +41,7 @@ #define KS_CMD_MEDIACHECK 17 #define KS_CMD_UPDATES 18 #define KS_CMD_VNC 19 +#define KS_CMD_UNSUPPORTED_HW 20
int ksReadCommands(char * cmdFile); int ksGetCommand(int cmd, char ** last, int * argc, char *** argv); diff --git a/loader/loader.c b/loader/loader.c index 52ddc5d..8c967be 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1276,13 +1276,17 @@ static void checkTaintFlag(void) { }
if (l & (1 << 28)) {
startNewt();
newtWinMessage(_("Unsupported Hardware Detected"), _("OK"),
_("This hardware (or a combination thereof) is not "
"supported by Red Hat. For more information on "
"supported hardware, please refer to "
"http://www.redhat.com/hardware."));
stopNewt();
if(!FL_UNSUPPORTED_HW(flags)) {
startNewt();
newtWinMessage(_("Unsupported Hardware Detected"), _("OK"),
_("This hardware (or a combination thereof) is not "
"supported by Red Hat. For more information on "
"supported hardware, please refer to "
"http://www.redhat.com/hardware."));
stopNewt();
} else {
logMessage(WARNING, "Installing on Unsupported Hardware.");
}
}
g_free(contents);
diff --git a/loader/loader.h b/loader/loader.h index 6df95f9..564dc6c 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -73,6 +73,7 @@ #define LOADER_FLAGS_AUTOMODDISK (((uint64_t) 1) << 40) #define LOADER_FLAGS_NOEJECT (((uint64_t) 1) << 41) #define LOADER_FLAGS_NOVERIFYSSL (((uint64_t) 1) << 42) +#define LOADER_FLAGS_UNSUPPORTED_HW (((uint64_t) 1) << 43)
#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT) #define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE) @@ -112,6 +113,7 @@ #define FL_AUTOMODDISK(a) ((a) & LOADER_FLAGS_AUTOMODDISK) #define FL_NOEJECT(a) ((a) & LOADER_FLAGS_NOEJECT) #define FL_NOVERIFYSSL(a) ((a) & LOADER_FLAGS_NOVERIFYSSL) +#define FL_UNSUPPORTED_HW(a) ((a) & LOADER_FLAGS_UNSUPPORTED_HW)
void startNewt(void); void stopNewt(void);
On Mon, 2012-10-01 at 09:01 +0200, Vratislav Podzimek wrote:
This looks good to me, but what about the pykickstart part? I tried to 'git grep' in the pykickstart's rhel6-branch and didn't find anything making this work.
Oh, I've overlooked the second patch. Sorry for the noise and ACK to both.
anaconda-patches@lists.fedorahosted.org