summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-11-09 23:59:45 +0000
committerJeremy Katz <katzj@redhat.com>2005-11-09 23:59:45 +0000
commit77ad74255cf5a5b85fa094172f98024c91e8037f (patch)
treeafd13c49ba7c94263d772fbf0c47010fe971a054
parenta659f5539068d19d419f113eb12c5ebaf61a4154 (diff)
downloadanaconda-77ad74255cf5a5b85fa094172f98024c91e8037f.tar.gz
anaconda-77ad74255cf5a5b85fa094172f98024c91e8037f.tar.xz
anaconda-77ad74255cf5a5b85fa094172f98024c91e8037f.zip
2005-11-09 Jeremy Katz <katzj@redhat.com>
* loader2/driverdisk.c: Clean up log levels. * loader2/firewire.c: Likewise. * loader2/hardware.c: Likewise. * loader2/hdinstall.c: Likewise. * loader2/lang.c: Likewise. * loader2/loader.c: Likewise. * loader2/log.h: Likewise. * loader2/mediacheck.c: Likewise. * loader2/method.c: Likewise. * loader2/modstubs.c: Likewise. * loader2/modules.c: Likewise. * loader2/net.c: Likewise. * loader2/nfsinstall.c: Likewise. * loader2/pcmcia.c: Likewise. * loader2/urls.c: Likewise. * loader2/usb.c: Likewise.
-rw-r--r--ChangeLog17
-rw-r--r--loader2/driverdisk.c6
-rw-r--r--loader2/firewire.c2
-rw-r--r--loader2/hardware.c18
-rw-r--r--loader2/hdinstall.c12
-rw-r--r--loader2/lang.c2
-rw-r--r--loader2/loader.c19
-rw-r--r--loader2/mediacheck.c4
-rw-r--r--loader2/method.c14
-rw-r--r--loader2/modstubs.c2
-rw-r--r--loader2/modules.c4
-rw-r--r--loader2/net.c10
-rw-r--r--loader2/nfsinstall.c5
-rw-r--r--loader2/pcmcia.c4
-rw-r--r--loader2/urls.c4
-rw-r--r--loader2/usb.c6
16 files changed, 63 insertions, 66 deletions
diff --git a/ChangeLog b/ChangeLog
index f0c5112f6..1f16f66f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2005-11-09 Jeremy Katz <katzj@redhat.com>
+ * loader2/driverdisk.c: Clean up log levels.
+ * loader2/firewire.c: Likewise.
+ * loader2/hardware.c: Likewise.
+ * loader2/hdinstall.c: Likewise.
+ * loader2/lang.c: Likewise.
+ * loader2/loader.c: Likewise.
+ * loader2/log.h: Likewise.
+ * loader2/mediacheck.c: Likewise.
+ * loader2/method.c: Likewise.
+ * loader2/modstubs.c: Likewise.
+ * loader2/modules.c: Likewise.
+ * loader2/net.c: Likewise.
+ * loader2/nfsinstall.c: Likewise.
+ * loader2/pcmcia.c: Likewise.
+ * loader2/urls.c: Likewise.
+ * loader2/usb.c: Likewise.
+
* loader2/driverselect.c (getManualModuleArgs): We don't have help
about the args, don't pretend that we do.
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 2bd9e03d7..99c681350 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -67,7 +67,7 @@ static int verifyDriverDisk(char *mntpt, int flags) {
/* check for both versions */
sprintf(file, "%s/rhdd", mntpt);
if (access(file, R_OK)) {
- logMessage(WARNING, "not a new format driver disk, checking for old");
+ logMessage(DEBUGLVL, "not a new format driver disk, checking for old");
sprintf(file, "%s/rhdd-6.1", mntpt);
if (access(file, R_OK)) {
logMessage(ERROR, "can't find either driver disk identifier, bad "
@@ -208,7 +208,7 @@ int getRemovableDevices(char *** devNames) {
numDevices = i;
for (i = 0; devices[i]; i++) {
- logMessage(INFO, "devices[%d] is %s", i, devices[i]->device);
+ logMessage(DEBUGLVL, "devices[%d] is %s", i, devices[i]->device);
}
*devNames = malloc((numDevices + 1) * sizeof(*devNames));
@@ -357,7 +357,7 @@ int loadDriverFromMedia(int class, moduleList modLoaded,
case DEV_LOADFILE: {
if(ddfile == NULL) {
- logMessage(INFO, "trying to load dd from NULL");
+ logMessage(DEBUGLVL, "trying to load dd from NULL");
stage = DEV_CHOOSEFILE;
break;
}
diff --git a/loader2/firewire.c b/loader2/firewire.c
index 8df5412fe..4dfefcb6f 100644
--- a/loader2/firewire.c
+++ b/loader2/firewire.c
@@ -36,7 +36,7 @@ int firewireInitialize(moduleList modLoaded, moduleDeps modDeps,
devices = probeDevices(CLASS_FIREWIRE, BUS_PCI, 0);
if (!devices) {
- logMessage(WARNING, "no firewire controller found");
+ logMessage(INFO, "no firewire controller found");
return 0;
}
diff --git a/loader2/hardware.c b/loader2/hardware.c
index 351597129..f93e86d82 100644
--- a/loader2/hardware.c
+++ b/loader2/hardware.c
@@ -63,14 +63,14 @@ static int detectHardware(moduleInfoSet modInfo,
int numMods;
char *driver;
- logMessage(INFO, "probing buses");
+ logMessage(DEBUGLVL, "probing buses");
devices = probeDevices(CLASS_UNSPEC,
BUS_PCI | BUS_SBUS | BUS_VIO | BUS_MACIO |
BUS_PCMCIA,
PROBE_ALL);
- logMessage(INFO, "finished bus probing");
+ logMessage(DEBUGLVL, "finished bus probing");
if (devices == NULL) {
*modules = NULL;
@@ -93,24 +93,24 @@ static int detectHardware(moduleInfoSet modInfo,
/* this is kind of icky and verbose. there are better and more
* general ways to do it but this is simple and obvious */
if (!driver) {
- logMessage(WARNING, "ignoring driverless device %s", (*device)->desc);
+ logMessage(DEBUGLVL, "ignoring driverless device %s", (*device)->desc);
} else if (FL_NOPCMCIA(flags) && ((*device)->type == CLASS_SOCKET)) {
- logMessage(WARNING, "ignoring pcmcia device %s (%s)",
+ logMessage(DEBUGLVL, "ignoring pcmcia device %s (%s)",
(*device)->desc, driver);
} else if (FL_NOIEEE1394(flags) && ((*device)->type == CLASS_FIREWIRE)) {
- logMessage(WARNING, "ignoring firewire device %s (%s)",
+ logMessage(DEBUGLVL, "ignoring firewire device %s (%s)",
(*device)->desc, driver);
} else if (FL_NOUSB(flags) && ((*device)->type == CLASS_USB)) {
- logMessage(WARNING, "ignoring usb device %s (%s)", (*device)->desc,
+ logMessage(DEBUGLVL, "ignoring usb device %s (%s)", (*device)->desc,
driver);
} else if (FL_NOSTORAGE(flags) &&
(((*device)->type == CLASS_SCSI) ||
((*device)->type == CLASS_IDE) ||
((*device)->type == CLASS_RAID))) {
- logMessage(WARNING, "ignoring storage device %s (%s)",
+ logMessage(DEBUGLVL, "ignoring storage device %s (%s)",
(*device)->desc, driver);
} else if (FL_NONET(flags) && ((*device)->type == CLASS_NETWORK)) {
- logMessage(WARNING, "ignoring network device %s (%s)",
+ logMessage(DEBUGLVL, "ignoring network device %s (%s)",
(*device)->desc, driver);
} else {
modList[numMods++] = strdup(driver);
@@ -138,7 +138,7 @@ int scsiTapeInitialize(moduleList modLoaded, moduleDeps modDeps,
devices = probeDevices(CLASS_TAPE, BUS_SCSI, 0);
if (!devices) {
- logMessage(WARNING, "no scsi tape devices found");
+ logMessage(INFO, "no scsi tape devices found");
return 0;
}
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index 3777add4f..31a3a129b 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -65,7 +65,7 @@ static int loadHDImages(char * prefix, char * dir, int flags,
logMessage(INFO, "Looking for hd stage2 image %s", path);
if (!access(path, F_OK))
break;
- logMessage(WARNING, "%s does not exist: %s, trying next target", path, strerror(errno));
+ logMessage(INFO, "%s does not exist: %s, trying next target", path, strerror(errno));
}
if (!(*target)) {
@@ -73,9 +73,7 @@ static int loadHDImages(char * prefix, char * dir, int flags,
return 1;
}
- logMessage(INFO, "Found hd stage2");
-
- logMessage(INFO, "Copying %s in RAM as stage 2", path);
+ logMessage(INFO, "Found hd stage2, copying %s in RAM as stage2", path);
if ((fd = open(path, O_RDONLY)) < 0) {
logMessage(ERROR, "failed to open %s: %s", path, strerror(errno));
@@ -130,7 +128,7 @@ static int mountHDImages(char * prefix, char * dir, int flags,
logMessage(INFO, "Looking for hd stage2 image %s", path);
if (!access(path, F_OK))
break;
- logMessage(WARNING, "%s does not exist: %s, trying next target", path, strerror(errno));
+ logMessage(INFO, "%s does not exist: %s, trying next target", path, strerror(errno));
}
if (!(*target)) {
@@ -138,9 +136,7 @@ static int mountHDImages(char * prefix, char * dir, int flags,
return 1;
}
- logMessage(INFO, "Found hd stage2");
-
- logMessage(INFO, "Mounting %s on loop %s as mntpoint %s", path, device, mntpoint);
+ logMessage(INFO, "Found hd stage2, mounting %s on loop %s as mntpoint %s", path, device, mntpoint);
rc = mountLoopback(path, mntpoint, device);
if (rc) {
diff --git a/loader2/lang.c b/loader2/lang.c
index f8f5fe642..b8223a14d 100644
--- a/loader2/lang.c
+++ b/loader2/lang.c
@@ -226,7 +226,7 @@ static int setupLanguage(int choice, int flags) {
char * buf;
int i;
- logMessage(INFO, "going to set language to %s", languages[choice].lc_all);
+ logMessage(DEBUGLVL, "going to set language to %s", languages[choice].lc_all);
/* load the language only if it is displayable. if they're using
* a serial console or iSeries vioconsole, we hope it's smart enough */
if ((!strcmp(languages[choice].font, "bterm") && !FL_SERIAL(flags) &&
diff --git a/loader2/loader.c b/loader2/loader.c
index 4af8c37ed..191bdd94c 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -233,7 +233,7 @@ static void spawnShell(int flags) {
pid_t pid;
if (FL_SERIAL(flags) || FL_NOSHELL(flags)) {
- logMessage(ERROR, "not spawning a shell");
+ logMessage(INFO, "not spawning a shell");
return;
} else if (access("/bin/sh", X_OK)) {
logMessage(ERROR, "cannot open shell - /bin/sh doesn't exist");
@@ -738,21 +738,6 @@ static int haveDeviceOfType(int type, moduleList modLoaded) {
devices = probeDevices(type, BUS_UNSPEC, PROBE_LOADED);
if (devices) {
return 1;
-#if 0
- int i;
- for (i = 0; devices[i]; i++) {
- if (devices[i]->driver && mlModuleInList(devices[i]->driver,
- modLoaded)) {
- logMessage("devices[%d] is %s - %s using %s (loaded)", i, devices[i]->desc, devices[i]->device, devices[i]->driver);
- return 1;
- } else if (!devices[i]->driver) {
- logMessage("devices[%d] is %s - %s using %s (no driver)", i, devices[i]->desc, devices[i]->device, devices[i]->driver);
- return 1;
- } else {
- logMessage("devices[%d] is %s - %s using %s (not loaded)", i, devices[i]->desc, devices[i]->device, devices[i]->driver);
- }
- }
-#endif
}
return 0;
}
@@ -1487,7 +1472,7 @@ int main(int argc, char ** argv) {
while (*tmparg) {
char *idx;
- logMessage(INFO, "adding extraArg %s", *tmparg);
+ logMessage(DEBUGLVL, "adding extraArg %s", *tmparg);
idx = strchr(*tmparg, '=');
if (idx && ((idx-*tmparg) < strlen(*tmparg))) {
*idx = '\0';
diff --git a/loader2/mediacheck.c b/loader2/mediacheck.c
index 1c74049c6..b00b33d9f 100644
--- a/loader2/mediacheck.c
+++ b/loader2/mediacheck.c
@@ -92,7 +92,7 @@ int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isosize, in
mediasum[32] = '\0';
md5fnd = 1;
- logMessage(INFO, "MD5SUM -> %s", mediasum);
+ logMessage(DEBUGLVL, "MD5SUM -> %s", mediasum);
loc += 45;
for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
@@ -116,7 +116,7 @@ int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isosize, in
logMessage(ERROR, "Could not parse |%s|", errptr);
return -1;
} else {
- logMessage(INFO, "skipsectors = %d", *skipsectors);
+ logMessage(DEBUGLVL, "skipsectors = %d", *skipsectors);
skipfnd = 1;
}
diff --git a/loader2/method.c b/loader2/method.c
index 4d3e06cb3..879f98dab 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -165,7 +165,7 @@ char * validIsoImages(char * dirName, int *foundinvalid) {
}
if (mountLoopback(isoImage, "/tmp/loopimage", "loop7")) {
- logMessage(ERROR, "failed to mount %s", isoImage);
+ logMessage(WARNING, "failed to mount %s", isoImage);
errno = 0;
continue;
}
@@ -362,9 +362,9 @@ void queryIsoMediaCheck(char *isoFile, int flags) {
isoDir = strdup(dirname(tmpstr));
free(tmpstr);
- logMessage(INFO, "isoFile = %s", isoFile);
- logMessage(INFO, "isoDir = %s", isoDir);
- logMessage(INFO, "Master Timestemp = %s", master_timestamp);
+ logMessage(DEBUGLVL, "isoFile = %s", isoFile);
+ logMessage(DEBUGLVL, "isoDir = %s", isoDir);
+ logMessage(DEBUGLVL, "Master Timestemp = %s", master_timestamp);
if (!(dir = opendir(isoDir))) {
newtWinMessage(_("Error"), _("OK"),
@@ -475,7 +475,7 @@ int copyDirectory(char * from, char * to) {
i = readlink(filespec, link, sizeof(link) - 1);
link[i] = '\0';
if (symlink(link, filespec2)) {
- logMessage(ERROR, "failed to symlink %s to %s: %s",
+ logMessage(WARNING, "failed to symlink %s to %s: %s",
filespec2, link, strerror(errno));
}
} else {
@@ -487,7 +487,7 @@ int copyDirectory(char * from, char * to) {
}
outfd = open(filespec2, O_RDWR | O_TRUNC | O_CREAT, 0644);
if (outfd == -1) {
- logMessage(ERROR, "failed to create %s: %s", filespec2,
+ logMessage(WARNING, "failed to create %s: %s", filespec2,
strerror(errno));
} else {
fchmod(outfd, sb.st_mode & 07777);
@@ -618,7 +618,7 @@ int copyFileAndLoopbackMount(int fd, char * dest, int flags,
rc = copyFileFd(fd, dest);
stat(dest, &sb);
- logMessage(INFO, "copied %" PRId64 " bytes to %s (%s)", sb.st_size, dest,
+ logMessage(DEBUGLVL, "copied %" PRId64 " bytes to %s (%s)", sb.st_size, dest,
((rc) ? " incomplete" : "complete"));
if (rc) {
diff --git a/loader2/modstubs.c b/loader2/modstubs.c
index f4a345411..d341e4491 100644
--- a/loader2/modstubs.c
+++ b/loader2/modstubs.c
@@ -137,7 +137,7 @@ int ourInsmodCommand(int argc, char ** argv) {
rc = init_module(modbuf, sb.st_size, "");
}
if (rc != 0)
- logMessage(ERROR, "failed to insert module (%d)", errno);
+ logMessage(WARNING, "failed to insert module (%d)", errno);
return rc;
}
diff --git a/loader2/modules.c b/loader2/modules.c
index 1db4ba73c..b8a30dfd9 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -339,12 +339,12 @@ static int loadModule(const char * modName, struct extractedModule * path,
if (!strcmp(modName, "usb-storage") && usbWasLoaded == 0) {
int slp;
usbWasLoaded++;
- logMessage(INFO, "sleeping for usb-storage stabilize...");
+ logMessage(DEBUGLVL, "sleeping for usb-storage stabilize...");
for (slp = 0; slp < 10; slp++) {
if (scsiDiskCount() > 0) break;
sleep(2);
}
- logMessage(INFO, "slept %d seconds", slp * 2);
+ logMessage(DEBUGLVL, "slept %d seconds", slp * 2);
}
modLoaded->mods[num].firstDevNum = deviceCount;
modLoaded->mods[num].lastDevNum = scsiDiskCount();
diff --git a/loader2/net.c b/loader2/net.c
index 907d98b9b..ebd6d2485 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -128,14 +128,14 @@ static int waitForLink(char * dev) {
/* try to wait for a valid link -- if the status is unknown or
* up continue, else sleep for 1 second and try again for up
* to five times */
- logMessage(INFO, "waiting for link...");
+ logMessage(DEBUGLVL, "waiting for link...");
while (tries < num_link_checks) {
if (get_link_status(dev) != 0)
break;
sleep(1);
tries++;
}
- logMessage(INFO, "%d seconds.", tries);
+ logMessage(DEBUGLVL, "%d seconds.", tries);
if (tries < num_link_checks)
return 0;
return 1;
@@ -360,7 +360,7 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
newtPopWindow();
if (chptr) {
- logMessage(INFO, "pump told us: %s", chptr);
+ logMessage(DEBUGLVL, "pump told us: %s", chptr);
return;
}
@@ -397,7 +397,7 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
(inet_aton(c,&addr))) {
cfg->dev.dnsServers[cfg->dev.numDns] = addr;
cfg->dev.numDns++;
- logMessage(INFO, "adding %s", inet_ntoa(addr));
+ logMessage(DEBUGLVL, "adding %s", inet_ntoa(addr));
c = strtok(NULL, ",");
}
logMessage(INFO, "dnsservers is %s", loaderData->dns);
@@ -617,7 +617,7 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg,
i = 2;
}
} else {
- logMessage(INFO, "pump told us: %s", chptr);
+ logMessage(DEBUGLVL, "pump told us: %s", chptr);
i = 0;
}
}
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 3cf8b729d..be9ffd3a4 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -137,12 +137,11 @@ char * mountNfsImage(struct installMethod * method,
IMOUNT_RDONLY, NULL)) {
char mntPath[1024];
- logMessage(INFO, "mounted %s on /mnt/source", fullPath);
snprintf(mntPath, sizeof(mntPath), "/mnt/source/%s/base/stage2.img", getProductPath());
if (!access(mntPath, R_OK)) {
logMessage(INFO, "can access %s", mntPath);
rc = mountStage2(mntPath);
- logMessage(INFO, "after mountStage2, rc is %d", rc);
+ logMessage(DEBUGLVL, "after mountStage2, rc is %d", rc);
if (rc) {
if (rc == -1) {
foundinvalid = 1;
@@ -163,7 +162,7 @@ char * mountNfsImage(struct installMethod * method,
copyUpdatesImg("/mnt/source/updates.img");
if (mountLoopback(path, "/mnt/source2", "loop1"))
- logMessage(ERROR, "failed to mount iso %s loopback", path);
+ logMessage(WARNING, "failed to mount iso %s loopback", path);
else {
snprintf(mntPath, sizeof(mntPath), "/mnt/source2/%s/base/stage2.img", getProductPath());
rc = mountStage2(mntPath);
diff --git a/loader2/pcmcia.c b/loader2/pcmcia.c
index 4ecd1686e..df4466c24 100644
--- a/loader2/pcmcia.c
+++ b/loader2/pcmcia.c
@@ -46,7 +46,7 @@ char * getPcicController() {
if (devices[x]->driver) {
char *tmp;
- logMessage(INFO, "found pcmcia adapter %s", devices[x]->driver);
+ logMessage(DEBUGLVL, "found pcmcia adapter %s", devices[x]->driver);
if (!pcic)
tmp = strdup(devices[x]->driver);
else {
@@ -59,7 +59,7 @@ char * getPcicController() {
}
if (!pcic) {
- logMessage(WARNING, "no pcic controller found");
+ logMessage(DEBUGLVL, "no pcic controller found");
}
return pcic;
} else {
diff --git a/loader2/urls.c b/loader2/urls.c
index a9bcc974f..a674298dc 100644
--- a/loader2/urls.c
+++ b/loader2/urls.c
@@ -81,8 +81,8 @@ int convertURLToUI(char *url, struct iurlinfo *ui) {
*url = '/';
ui->prefix = strdup(url);
- logMessage(INFO, "url address %s", ui->address);
- logMessage(INFO, "url prefix %s", ui->prefix);
+ logMessage(DEBUGLVL, "url address %s", ui->address);
+ logMessage(DEBUGLVL, "url prefix %s", ui->prefix);
return 0;
}
diff --git a/loader2/usb.c b/loader2/usb.c
index 5bdc89de3..5b2d95c32 100644
--- a/loader2/usb.c
+++ b/loader2/usb.c
@@ -41,7 +41,7 @@ static void sleepUntilUsbIsStable(void) {
int i, count = 0;
/* sleep for a maximum of 20 seconds, minimum of 2 seconds */
- logMessage(INFO, "waiting for usb to become stable...");
+ logMessage(DEBUGLVL, "waiting for usb to become stable...");
for (i = 0; i < 20; i++) {
stat("/proc/bus/usb/devices", &sb);
if (last == sb.st_mtime) {
@@ -57,7 +57,7 @@ static void sleepUntilUsbIsStable(void) {
last = sb.st_mtime;
sleep(1);
}
- logMessage(INFO, "%d seconds.", i);
+ logMessage(DEBUGLVL, "%d seconds.", i);
}
int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
@@ -74,7 +74,7 @@ int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
devices = probeDevices(CLASS_USB, BUS_PCI, 0);
if (!devices) {
- logMessage(WARNING, "no usb controller found");
+ logMessage(DEBUGLVL, "no usb controller found");
return 0;
}