[PATCH] Add more stuff to the exception reporting skip list.
by Chris Lumens
For me, this reduces the time from traceback to dialog from at least ten
seconds to almost instantaneous. And it's not helpful stuff either. If
you see it take a very long time to generate a traceback file, please
check the file and see if it's because something is being pickled that
doesn't need to be.
---
pyanaconda/exception.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 6df7251..5701ed2 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -167,6 +167,9 @@ def initExceptionHandling(anaconda):
conf = Config(programName="anaconda",
programVersion=isys.getAnacondaVersion(),
attrSkipList=["_intf._actions",
+ "_intf._currentAction._xklwrapper",
+ "_intf._currentAction.language.translations",
+ "_intf._currentAction.language.locales",
"_intf.storage.bootloader.password",
"_intf.storage.data",
"_intf.storage.encryptionPassphrase",
--
1.8.1.2
11 years, 2 months
[PATCH 1/2] The disk cart summary does not need a mnemonic.
by Chris Lumens
What would it do?
---
pyanaconda/ui/gui/spokes/lib/cart.glade | 1 -
pyanaconda/ui/gui/spokes/lib/cart.py | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.glade b/pyanaconda/ui/gui/spokes/lib/cart.glade
index 0e234a2..37f864e 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.glade
+++ b/pyanaconda/ui/gui/spokes/lib/cart.glade
@@ -234,7 +234,6 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Disk summary goes here</property>
<property name="use_markup">True</property>
- <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py
index 0fe9869..39d572a 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.py
+++ b/pyanaconda/ui/gui/spokes/lib/cart.py
@@ -135,9 +135,9 @@ class SelectedDisksDialog(GUIObject):
size = str(Size(bytes=long(size))).upper()
free = str(Size(bytes=long(free))).upper()
- text = P_("<b>%d d_isk; %s capacity; %s free space</b> "
+ text = P_("<b>%d disk; %s capacity; %s free space</b> "
"(unpartitioned and in filesystems)",
- "<b>%d d_isks; %s capacity; %s free space</b> "
+ "<b>%d disks; %s capacity; %s free space</b> "
"(unpartitioned and in filesystems)",
count) % (count, size, free)
self._summary_label.set_markup(text)
--
1.8.1.2
11 years, 2 months
[isomd5sum 1/2] Cleanup TABs and update Copyrights
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
checkisomd5.c | 64 +++++-----
implantisomd5.c | 20 +--
libcheckisomd5.c | 199 +++++++++++++++---------------
libimplantisomd5.c | 136 ++++++++++-----------
md5.c | 348 ++++++++++++++++++++++++++---------------------------
pyisomd5sum.c | 2 +-
6 files changed, 385 insertions(+), 384 deletions(-)
diff --git a/checkisomd5.c b/checkisomd5.c
index df06f5f..98c01d8 100644
--- a/checkisomd5.c
+++ b/checkisomd5.c
@@ -1,6 +1,6 @@
/*
* checkosmd5 - simple program to check implanted md5sum
- * Copyright (C) 2001-2007 Red Hat, Inc.
+ * Copyright (C) 2001-2013 Red Hat, Inc.
* Michael Fulbright <msf(a)redhat.com>
*
* This program is free software; you can redistribute it and/or
@@ -84,24 +84,24 @@ int processExitStatus(int rc) {
char * result;
switch (rc) {
- case ISOMD5SUM_CHECK_FAILED:
- result = "FAIL.\n\nIt is not recommended to use this media.";
- break;
- case ISOMD5SUM_CHECK_ABORTED:
- result = "UNKNOWN.\n\nThe media check was aborted.";
- break;
- case ISOMD5SUM_CHECK_NOT_FOUND:
- result = "NA.\n\nNo checksum information available, unable to verify media.";
- break;
+ case ISOMD5SUM_CHECK_FAILED:
+ result = "FAIL.\n\nIt is not recommended to use this media.";
+ break;
+ case ISOMD5SUM_CHECK_ABORTED:
+ result = "UNKNOWN.\n\nThe media check was aborted.";
+ break;
+ case ISOMD5SUM_CHECK_NOT_FOUND:
+ result = "NA.\n\nNo checksum information available, unable to verify media.";
+ break;
case ISOMD5SUM_FILE_NOT_FOUND:
- result = "NA.\n\nFile not found.";
- break;
- case ISOMD5SUM_CHECK_PASSED:
- result = "PASS.\n\nIt is OK to use this media.";
- break;
- default:
- result = "checkisomd5 ERROR - bad return value";
- break;
+ result = "NA.\n\nFile not found.";
+ break;
+ case ISOMD5SUM_CHECK_PASSED:
+ result = "PASS.\n\nIt is OK to use this media.";
+ break;
+ default:
+ result = "checkisomd5 ERROR - bad return value";
+ break;
}
fprintf(stderr, "\nThe media check is complete, the result is: %s\n", result);
@@ -126,11 +126,11 @@ int main(int argc, char **argv) {
data.gauge = 0;
struct poptOption options[] = {
- { "md5sumonly", 'o', POPT_ARG_NONE, &md5only, 0 },
- { "verbose", 'v', POPT_ARG_NONE, &data.verbose, 0 },
- { "gauge", 'g', POPT_ARG_NONE, &data.gauge, 0},
- { "help", 'h', POPT_ARG_NONE, &help, 0},
- { 0, 0, 0, 0, 0}
+ { "md5sumonly", 'o', POPT_ARG_NONE, &md5only, 0 },
+ { "verbose", 'v', POPT_ARG_NONE, &data.verbose, 0 },
+ { "gauge", 'g', POPT_ARG_NONE, &data.gauge, 0},
+ { "help", 'h', POPT_ARG_NONE, &help, 0},
+ { 0, 0, 0, 0, 0}
};
static struct termios oldt, newt;
@@ -138,28 +138,28 @@ int main(int argc, char **argv) {
optCon = poptGetContext("checkisomd5", argc, (const char **)argv, options, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
- fprintf(stderr, "bad option %s: %s\n",
- poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
- poptStrerror(rc));
- exit(1);
+ fprintf(stderr, "bad option %s: %s\n",
+ poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
+ poptStrerror(rc));
+ exit(1);
}
if (help)
- usage();
+ usage();
args = poptGetArgs(optCon);
if (!args || !args[0] || !args[0][0])
- usage();
+ usage();
if (md5only|data.verbose) {
- rc = printMD5SUM((char *)args[0]);
+ rc = printMD5SUM((char *)args[0]);
if (rc < 0) {
exit(processExitStatus(rc));
}
}
if (md5only)
- exit(0);
+ exit(0);
printf("Press [Esc] to abort check.\n");
@@ -171,7 +171,7 @@ int main(int argc, char **argv) {
tcsetattr(0, TCSANOW, &oldt);
if (data.verbose)
- printf("\n");
+ printf("\n");
exit(processExitStatus(rc));
}
diff --git a/implantisomd5.c b/implantisomd5.c
index 759f841..f116f8c 100644
--- a/implantisomd5.c
+++ b/implantisomd5.c
@@ -1,6 +1,6 @@
/*
* simple program to insert an md5sum into application data area of iso99660
- * Copyright (C) 2001-2007 Red Hat, Inc.
+ * Copyright (C) 2001-2013 Red Hat, Inc.
* Michael Fulbright <msf(a)redhat.com>
*
* This program is free software; you can redistribute it and/or
@@ -43,10 +43,10 @@ int main(int argc, char **argv) {
poptContext optCon;
struct poptOption options[] = {
- { "force", 'f', POPT_ARG_NONE, &forceit, 0 },
- { "supported-iso", 'S', POPT_ARG_NONE, &supported, 0 },
- { "help", 'h', POPT_ARG_NONE, &help, 0},
- { 0, 0, 0, 0, 0}
+ { "force", 'f', POPT_ARG_NONE, &forceit, 0 },
+ { "supported-iso", 'S', POPT_ARG_NONE, &supported, 0 },
+ { "help", 'h', POPT_ARG_NONE, &help, 0},
+ { 0, 0, 0, 0, 0}
};
@@ -54,13 +54,13 @@ int main(int argc, char **argv) {
if ((rc = poptGetNextOpt(optCon)) < -1) {
fprintf(stderr, "bad option %s: %s\n",
- poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
- poptStrerror(rc));
+ poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
+ poptStrerror(rc));
exit(1);
}
if (help)
- usage();
+ usage();
args = poptGetArgs(optCon);
if (!args || !args[0] || !args[0][0])
@@ -70,8 +70,8 @@ int main(int argc, char **argv) {
if (rc) {
fprintf(stderr, "ERROR: ");
fprintf(stderr, errstr, (char *)args[0]);
- exit(1);
+ exit(1);
} else {
- exit(0);
+ exit(0);
}
}
diff --git a/libcheckisomd5.c b/libcheckisomd5.c
index 8bca842..0454513 100644
--- a/libcheckisomd5.c
+++ b/libcheckisomd5.c
@@ -1,10 +1,10 @@
/*
- * Copyright (C) 2001-2007 Red Hat, Inc.
+ * Copyright (C) 2001-2013 Red Hat, Inc.
*
* Michael Fulbright <msf(a)redhat.com>
* Dustin Kirkland <dustin.dirkland(a)gmail.com>
- * Added support for checkpoint fragment sums;
- * Exits media check as soon as bad fragment md5sum'ed
+ * Added support for checkpoint fragment sums;
+ * Exits media check as soon as bad fragment md5sum'ed
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -55,20 +55,20 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
char *p;
if (lseek(isofd, (off_t)(16L * 2048L), SEEK_SET) == -1)
- return ((long long)-1);
+ return ((long long)-1);
offset = (16L * 2048L);
for (;1;) {
- if (read(isofd, buf, 2048) <= 0)
- return ((long long)-1);
-
- if (buf[0] == 1)
- /* found primary volume descriptor */
- break;
- else if (buf[0] == 255)
- /* hit end and didn't find primary volume descriptor */
- return ((long long)-1);
- offset += 2048L;
+ if (read(isofd, buf, 2048) <= 0)
+ return ((long long)-1);
+
+ if (buf[0] == 1)
+ /* found primary volume descriptor */
+ break;
+ else if (buf[0] == 255)
+ /* hit end and didn't find primary volume descriptor */
+ return ((long long)-1);
+ offset += 2048L;
}
/* read out md5sum */
@@ -84,47 +84,47 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
supportedfnd = 0;
loc = 0;
while (loc < 512) {
- if (!strncmp(buf2 + loc, "ISO MD5SUM = ", 13)) {
-
- /* make sure we dont walk off end */
- if ((loc + 32 + 13) > 511)
- return -1;
-
- memcpy(mediasum, buf2 + loc + 13, 32);
- mediasum[32] = '\0';
- md5fnd = 1;
- loc += 45;
- for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
- } else if (!strncmp(buf2 + loc, "SKIPSECTORS = ", 14)) {
- char *errptr;
-
- /* make sure we dont walk off end */
- if ((loc + 14) > 511)
- return -1;
-
- loc = loc + 14;
- for (p=tmpbuf; buf2[loc] != ';' && loc < 512; p++, loc++)
- *p = buf2[loc];
-
- *p = '\0';
-
- *skipsectors = strtol(tmpbuf, &errptr, 10);
- if (errptr && *errptr) {
- return -1;
- } else {
- skipfnd = 1;
- }
-
- for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
- } else if (!strncmp(buf2 + loc, "RHLISOSTATUS=1", 14)) {
- *supported = 1;
- supportedfnd = 1;
- for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
- } else if (!strncmp(buf2 + loc, "RHLISOSTATUS=0", 14)) {
- *supported = 0;
- supportedfnd = 1;
- for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
- } else if (!strncmp(buf2 + loc, "FRAGMENT SUMS = ", 16)) {
+ if (!strncmp(buf2 + loc, "ISO MD5SUM = ", 13)) {
+
+ /* make sure we dont walk off end */
+ if ((loc + 32 + 13) > 511)
+ return -1;
+
+ memcpy(mediasum, buf2 + loc + 13, 32);
+ mediasum[32] = '\0';
+ md5fnd = 1;
+ loc += 45;
+ for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
+ } else if (!strncmp(buf2 + loc, "SKIPSECTORS = ", 14)) {
+ char *errptr;
+
+ /* make sure we dont walk off end */
+ if ((loc + 14) > 511)
+ return -1;
+
+ loc = loc + 14;
+ for (p=tmpbuf; buf2[loc] != ';' && loc < 512; p++, loc++)
+ *p = buf2[loc];
+
+ *p = '\0';
+
+ *skipsectors = strtol(tmpbuf, &errptr, 10);
+ if (errptr && *errptr) {
+ return -1;
+ } else {
+ skipfnd = 1;
+ }
+
+ for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
+ } else if (!strncmp(buf2 + loc, "RHLISOSTATUS=1", 14)) {
+ *supported = 1;
+ supportedfnd = 1;
+ for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
+ } else if (!strncmp(buf2 + loc, "RHLISOSTATUS=0", 14)) {
+ *supported = 0;
+ supportedfnd = 1;
+ for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
+ } else if (!strncmp(buf2 + loc, "FRAGMENT SUMS = ", 16)) {
/* make sure we dont walk off end */
if ((loc + FRAGMENT_SUM_LENGTH) > 511)
return -1;
@@ -155,19 +155,19 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
for (p=buf2+loc; *p != ';' && loc < 512; p++, loc++);
} else {
- loc++;
- }
+ loc++;
+ }
- if ((skipfnd & md5fnd & fragsumfnd & fragcntfnd) & supportedfnd)
- break;
+ if ((skipfnd & md5fnd & fragsumfnd & fragcntfnd) & supportedfnd)
+ break;
}
if (!(skipfnd & md5fnd))
- return -1;
+ return -1;
/* get isosize */
*isosize = (buf[SIZE_OFFSET]*0x1000000+buf[SIZE_OFFSET+1]*0x10000 +
- buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL;
+ buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL;
return offset;
}
@@ -195,7 +195,7 @@ static int checkmd5sum(int isofd, char *mediasum, char *computedsum, checkCallba
MD5_CTX md5ctx, fragmd5ctx;
if ((pvd_offset = parsepvd(isofd, mediasum, &skipsectors, &isosize, &supported, fragmentsums, &fragmentcount)) < 0)
- return ISOMD5SUM_CHECK_NOT_FOUND;
+ return ISOMD5SUM_CHECK_NOT_FOUND;
/* printf("Mediasum = %s\n",mediasum); */
@@ -212,43 +212,43 @@ static int checkmd5sum(int isofd, char *mediasum, char *computedsum, checkCallba
cb(cbdata, 0, isosize - skipsectors*2048);
while (offset < isosize - skipsectors*2048) {
- nattempt = MIN(isosize - skipsectors*2048 - offset, bufsize);
+ nattempt = MIN(isosize - skipsectors*2048 - offset, bufsize);
- /* printf("%lld %lld %lld %d\n", offset, isosize, isosize-SKIPSECTORS*2048, nattempt); */
+ /* printf("%lld %lld %lld %d\n", offset, isosize, isosize-SKIPSECTORS*2048, nattempt); */
- nread = read(isofd, buf, nattempt);
- if (nread <= 0)
- break;
+ nread = read(isofd, buf, nattempt);
+ if (nread <= 0)
+ break;
if (nread > nattempt) {
nread = nattempt;
lseek(isofd, offset+nread, SEEK_SET);
}
- /* overwrite md5sum we implanted with original data */
- if (offset < apoff && offset+nread >= apoff) {
- appdata_start_offset = apoff - offset;
- appdata_end_offset = MIN(appdata_start_offset+MIN(nread, 512),
- offset + nread - apoff);
- len = appdata_end_offset - appdata_start_offset;
- memset(buf+appdata_start_offset, ' ', len);
- } else if (offset >= apoff && offset+nread < apoff + 512) {
- appdata_start_offset = 0;
- appdata_end_offset = nread;
- len = appdata_end_offset - appdata_start_offset;
- memset(buf+appdata_start_offset, ' ', len);
- } else if (offset < apoff + 512 && offset+nread >= apoff + 512) {
- appdata_start_offset = 0;
- appdata_end_offset = apoff + 512 - offset;
- len = appdata_end_offset - appdata_start_offset;
- memset(buf+appdata_start_offset, ' ', len);
- }
-
- MD5_Update(&md5ctx, buf, nread);
+ /* overwrite md5sum we implanted with original data */
+ if (offset < apoff && offset+nread >= apoff) {
+ appdata_start_offset = apoff - offset;
+ appdata_end_offset = MIN(appdata_start_offset+MIN(nread, 512),
+ offset + nread - apoff);
+ len = appdata_end_offset - appdata_start_offset;
+ memset(buf+appdata_start_offset, ' ', len);
+ } else if (offset >= apoff && offset+nread < apoff + 512) {
+ appdata_start_offset = 0;
+ appdata_end_offset = nread;
+ len = appdata_end_offset - appdata_start_offset;
+ memset(buf+appdata_start_offset, ' ', len);
+ } else if (offset < apoff + 512 && offset+nread >= apoff + 512) {
+ appdata_start_offset = 0;
+ appdata_end_offset = apoff + 512 - offset;
+ len = appdata_end_offset - appdata_start_offset;
+ memset(buf+appdata_start_offset, ' ', len);
+ }
+
+ MD5_Update(&md5ctx, buf, nread);
if (fragmentcount) {
current_fragment = offset * (fragmentcount+1) / (isosize - skipsectors*2048);
/* if we're onto the next fragment, calculate the previous sum and check */
if ( current_fragment != previous_fragment ) {
- memcpy(&fragmd5ctx, &md5ctx, sizeof(MD5_CTX));
+ memcpy(&fragmd5ctx, &md5ctx, sizeof(MD5_CTX));
MD5_Final(fragmd5sum, &fragmd5ctx);
*computedsum = '\0';
j = (current_fragment-1)*FRAGMENT_SUM_LENGTH/fragmentcount;
@@ -266,8 +266,8 @@ static int checkmd5sum(int isofd, char *mediasum, char *computedsum, checkCallba
}
}
}
- offset = offset + nread;
- if (cb)
+ offset = offset + nread;
+ if (cb)
if(cb(cbdata, offset, isosize - skipsectors*2048)) return ISOMD5SUM_CHECK_ABORTED;
}
@@ -282,17 +282,17 @@ static int checkmd5sum(int isofd, char *mediasum, char *computedsum, checkCallba
*computedsum = '\0';
for (i=0; i<16; i++) {
- char tmpstr[4];
- snprintf (tmpstr, 4, "%02x", md5sum[i]);
- strncat(computedsum, tmpstr, 2);
+ char tmpstr[4];
+ snprintf (tmpstr, 4, "%02x", md5sum[i]);
+ strncat(computedsum, tmpstr, 2);
}
/* printf("mediasum, computedsum = %s %s\n", mediasum, computedsum); */
if (strcmp(mediasum, computedsum))
- return ISOMD5SUM_CHECK_FAILED;
+ return ISOMD5SUM_CHECK_FAILED;
else
- return ISOMD5SUM_CHECK_PASSED;
+ return ISOMD5SUM_CHECK_PASSED;
}
@@ -303,7 +303,7 @@ static int doMediaCheck(int isofd, char *mediasum, char *computedsum, long long
char fragmentsums[FRAGMENT_SUM_LENGTH+1];
if (parsepvd(isofd, mediasum, &skipsectors, isosize, supported, fragmentsums, &fragmentcount) < 0) {
- return ISOMD5SUM_CHECK_NOT_FOUND;
+ return ISOMD5SUM_CHECK_NOT_FOUND;
}
rc = checkmd5sum(isofd, mediasum, computedsum, cb, cbdata);
@@ -321,7 +321,7 @@ int mediaCheckFile(char *file, checkCallback cb, void *cbdata) {
isofd = open(file, O_RDONLY);
if (isofd < 0) {
- return ISOMD5SUM_FILE_NOT_FOUND;
+ return ISOMD5SUM_FILE_NOT_FOUND;
}
rc = doMediaCheck(isofd, mediasum, computedsum, &isosize, &supported, cb, cbdata);
@@ -329,7 +329,8 @@ int mediaCheckFile(char *file, checkCallback cb, void *cbdata) {
close(isofd);
/* printf("isosize = %lld\n", isosize);
- printf("%s\n%s\n", mediasum, computedsum);*/
+ * printf("%s\n%s\n", mediasum, computedsum);
+ */
return rc;
}
@@ -354,7 +355,7 @@ int printMD5SUM(char *file) {
}
close(isofd);
-
+
printf("%s: %s\n", file, mediasum);
if ( (strlen(fragmentsums) > 0) && (fragmentcount > 0) ) {
printf("Fragment sums: %s\n", fragmentsums);
diff --git a/libimplantisomd5.c b/libimplantisomd5.c
index 4009809..d1b342d 100644
--- a/libimplantisomd5.c
+++ b/libimplantisomd5.c
@@ -1,10 +1,10 @@
/*
- * Copyright (C) 2001-2007 Red Hat, Inc.
+ * Copyright (C) 2001-2013 Red Hat, Inc.
*
* Michael Fulbright <msf(a)redhat.com>
* Dustin Kirkland <dustin.dirkland(a)gmail.com>
- * Added support for checkpoint fragment sums;
- * Exits media check as soon as bad fragment md5sum'ed
+ * Added support for checkpoint fragment sums;
+ * Exits media check as soon as bad fragment md5sum'ed
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -55,39 +55,39 @@ static int parsepvd(int isofd, char *mediasum, long long *isosize) {
unsigned char *p __attribute__((unused));
if (lseek(isofd, 16*2048, SEEK_SET) == -1)
- return ((long long)-1);
-
+ return ((long long)-1);
+
offset = (16 * 2048);
for (;1;) {
if (read(isofd, buf, 2048L) == -1)
- return ((long long)-1);
-
- if (buf[0] == 1)
- /* found primary volume descriptor */
- break;
- else if (buf[0] == 255)
- /* hit end and didn't find primary volume descriptor */
- return ((long long)-1);
- offset += 2048L;
+ return ((long long)-1);
+
+ if (buf[0] == 1)
+ /* found primary volume descriptor */
+ break;
+ else if (buf[0] == 255)
+ /* hit end and didn't find primary volume descriptor */
+ return ((long long)-1);
+ offset += 2048L;
}
-
+
/* read out md5sum */
#if 0
memcpy(mediasum, buf + APPDATA_OFFSET + 13, 32);
mediasum[32] = '\0';
for (p=mediasum; *p; p++)
- if (*p != ' ')
- break;
+ if (*p != ' ')
+ break;
/* if the md5sum was all spaces, we didn't find md5sum */
if (!*p)
- return -1;
+ return -1;
#endif
/* get isosize */
*isosize = (buf[SIZE_OFFSET]*0x1000000+buf[SIZE_OFFSET+1]*0x10000 +
- buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL;
+ buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL;
return offset;
}
@@ -95,8 +95,8 @@ static int parsepvd(int isofd, char *mediasum, long long *isosize) {
static unsigned int writeAppData(unsigned char *appdata, char *valstr, unsigned int loc) {
if (loc + strlen(valstr) > 511) {
- printf("Attempted to write too much appdata, exiting...\n");
- exit(-1);
+ printf("Attempted to write too much appdata, exiting...\n");
+ exit(-1);
}
memcpy(appdata + loc, valstr, strlen(valstr));
@@ -132,38 +132,38 @@ int implantISOFile(char *fname, int supported, int forceit, int quiet, char **er
isofd = open(fname, O_RDWR);
if (isofd < 0) {
- *errstr = "Error - Unable to open file %s\n\n";
- return -1;
+ *errstr = "Error - Unable to open file %s\n\n";
+ return -1;
}
pvd_offset = parsepvd(isofd, mediasum, &isosize);
if (pvd_offset < 0) {
- *errstr = "Could not find primary volumne!\n\n";
- return -1;
+ *errstr = "Could not find primary volumne!\n\n";
+ return -1;
}
lseek(isofd, pvd_offset + APPDATA_OFFSET, SEEK_SET);
nread = read(isofd, orig_appdata, 512);
if (!forceit) {
- dirty = 0;
- for (i=0; i < 512; i++)
- if (orig_appdata[i] != ' ')
- dirty = 1;
-
- if (dirty) {
- *errstr = "Application data has been used - not implanting md5sum!\n";
- return -1;
- }
+ dirty = 0;
+ for (i=0; i < 512; i++)
+ if (orig_appdata[i] != ' ')
+ dirty = 1;
+
+ if (dirty) {
+ *errstr = "Application data has been used - not implanting md5sum!\n";
+ return -1;
+ }
} else {
- /* write out blanks to erase old app data */
- lseek(isofd, pvd_offset + APPDATA_OFFSET, SEEK_SET);
- memset(new_appdata, ' ', 512);
- i = write(isofd, new_appdata, 512);
- if (i<0) {
- printf("write failed %d\n", i);
- perror("");
- }
+ /* write out blanks to erase old app data */
+ lseek(isofd, pvd_offset + APPDATA_OFFSET, SEEK_SET);
+ memset(new_appdata, ' ', 512);
+ i = write(isofd, new_appdata, 512);
+ if (i<0) {
+ printf("write failed %d\n", i);
+ perror("");
+ }
}
/* now do md5sum */
@@ -178,17 +178,17 @@ int implantISOFile(char *fname, int supported, int forceit, int quiet, char **er
/* sectors on burned CDs */
while (total < isosize - SKIPSECTORS*2048) {
nattempt = MIN(isosize - SKIPSECTORS*2048 - total, bufsize);
- nread = read(isofd, buf, nattempt);
+ nread = read(isofd, buf, nattempt);
- if (nread <= 0)
- break;
-
- MD5_Update(&md5ctx, buf, nread);
+ if (nread <= 0)
+ break;
+
+ MD5_Update(&md5ctx, buf, nread);
/* if we're onto the next fragment, calculate the previous sum and write */
current_fragment = total * (FRAGMENT_COUNT+1) / (isosize - SKIPSECTORS*2048);
if ( current_fragment != previous_fragment ) {
- memcpy(&fragmd5ctx, &md5ctx, sizeof(MD5_CTX));
+ memcpy(&fragmd5ctx, &md5ctx, sizeof(MD5_CTX));
MD5_Final(fragmd5sum, &fragmd5ctx);
for (i=0; i<FRAGMENT_SUM_LENGTH/FRAGMENT_COUNT; i++) {
char tmpstr[2];
@@ -199,7 +199,7 @@ int implantISOFile(char *fname, int supported, int forceit, int quiet, char **er
previous_fragment = current_fragment;
}
- total = total + nread;
+ total = total + nread;
}
free(buf);
@@ -207,17 +207,17 @@ int implantISOFile(char *fname, int supported, int forceit, int quiet, char **er
*md5str = '\0';
for (i=0; i<16; i++) {
- char tmpstr[4];
- snprintf (tmpstr, 4, "%02x", md5sum[i]);
- strncat(md5str, tmpstr, 2);
+ char tmpstr[4];
+ snprintf (tmpstr, 4, "%02x", md5sum[i]);
+ strncat(md5str, tmpstr, 2);
}
if (!quiet) {
- printf("Inserting md5sum into iso image...\n");
- printf("md5 = %s\n", md5str);
- printf("Inserting fragment md5sums into iso image...\n");
- printf("fragmd5 = %s\n", fragstr);
- printf("frags = %d\n", FRAGMENT_COUNT);
+ printf("Inserting md5sum into iso image...\n");
+ printf("md5 = %s\n", md5str);
+ printf("Inserting fragment md5sums into iso image...\n");
+ printf("fragmd5 = %s\n", fragstr);
+ printf("frags = %d\n", FRAGMENT_COUNT);
}
/* memcpy(new_appdata, orig_appdata, 512); */
memset(new_appdata, ' ', 512);
@@ -235,15 +235,15 @@ int implantISOFile(char *fname, int supported, int forceit, int quiet, char **er
free(buf);
if (supported) {
- if (!quiet)
- printf("Setting supported flag to 1\n");
- loc = writeAppData(new_appdata, "RHLISOSTATUS=1", loc);
+ if (!quiet)
+ printf("Setting supported flag to 1\n");
+ loc = writeAppData(new_appdata, "RHLISOSTATUS=1", loc);
} else {
- if (!quiet)
- printf("Setting supported flag to 0\n");
- loc = writeAppData(new_appdata, "RHLISOSTATUS=0", loc);
+ if (!quiet)
+ printf("Setting supported flag to 0\n");
+ loc = writeAppData(new_appdata, "RHLISOSTATUS=0", loc);
}
-
+
loc = writeAppData(new_appdata, ";", loc);
loc = writeAppData(new_appdata, "FRAGMENT SUMS = ", loc);
@@ -257,15 +257,15 @@ int implantISOFile(char *fname, int supported, int forceit, int quiet, char **er
free(buf);
loc = writeAppData(new_appdata, "THIS IS NOT THE SAME AS RUNNING MD5SUM ON THIS ISO!!", loc);
-
+
i = lseek(isofd, pvd_offset + APPDATA_OFFSET, SEEK_SET);
if (i<0)
- printf("seek failed\n");
+ printf("seek failed\n");
i = write(isofd, new_appdata, 512);
if (i<0) {
- printf("write failed %d\n", i);
- perror("");
+ printf("write failed %d\n", i);
+ perror("");
}
close(isofd);
diff --git a/md5.c b/md5.c
index a1bdd4a..111aa86 100644
--- a/md5.c
+++ b/md5.c
@@ -36,13 +36,13 @@ static void byteReverse(unsigned char *buf, unsigned longs);
*/
static void byteReverse(unsigned char *buf, unsigned longs)
{
- uint32 t;
- do {
- t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
- ((unsigned) buf[1] << 8 | buf[0]);
- *(uint32 *) buf = t;
- buf += 4;
- } while (--longs);
+ uint32 t;
+ do {
+ t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+ ((unsigned) buf[1] << 8 | buf[0]);
+ *(uint32 *) buf = t;
+ buf += 4;
+ } while (--longs);
}
#endif
@@ -52,19 +52,19 @@ static void byteReverse(unsigned char *buf, unsigned longs)
*/
void MD5_Init(struct MD5Context *ctx)
{
- ctx->buf[0] = 0x67452301U;
- ctx->buf[1] = 0xefcdab89U;
- ctx->buf[2] = 0x98badcfeU;
- ctx->buf[3] = 0x10325476U;
+ ctx->buf[0] = 0x67452301U;
+ ctx->buf[1] = 0xefcdab89U;
+ ctx->buf[2] = 0x98badcfeU;
+ ctx->buf[3] = 0x10325476U;
- ctx->bits[0] = 0;
- ctx->bits[1] = 0;
+ ctx->bits[0] = 0;
+ ctx->bits[1] = 0;
- if (IS_BIG_ENDIAN())
- ctx->doByteReverse = 1;
- else
- ctx->doByteReverse = 0;
+ if (IS_BIG_ENDIAN())
+ ctx->doByteReverse = 1;
+ else
+ ctx->doByteReverse = 0;
}
/*
@@ -73,46 +73,46 @@ void MD5_Init(struct MD5Context *ctx)
*/
void MD5_Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len)
{
- uint32 t;
-
- /* Update bitcount */
-
- t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
- ctx->bits[1]++; /* Carry from low to high */
- ctx->bits[1] += len >> 29;
-
- t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
-
- /* Handle any leading odd-sized chunks */
-
- if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
-
- t = 64 - t;
- if (len < t) {
- memcpy(p, buf, len);
- return;
- }
- memcpy(p, buf, t);
- if (ctx->doByteReverse) byteReverse(ctx->in, 16);
- MD5_Transform(ctx->buf, (uint32 *) ctx->in);
- buf += t;
- len -= t;
- }
- /* Process data in 64-byte chunks */
-
- while (len >= 64) {
- memcpy(ctx->in, buf, 64);
- if (ctx->doByteReverse) byteReverse(ctx->in, 16);
- MD5_Transform(ctx->buf, (uint32 *) ctx->in);
- buf += 64;
- len -= 64;
- }
-
- /* Handle any remaining bytes of data. */
-
- memcpy(ctx->in, buf, len);
+ uint32 t;
+
+ /* Update bitcount */
+
+ t = ctx->bits[0];
+ if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
+ ctx->bits[1]++; /* Carry from low to high */
+ ctx->bits[1] += len >> 29;
+
+ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
+
+ /* Handle any leading odd-sized chunks */
+
+ if (t) {
+ unsigned char *p = (unsigned char *) ctx->in + t;
+
+ t = 64 - t;
+ if (len < t) {
+ memcpy(p, buf, len);
+ return;
+ }
+ memcpy(p, buf, t);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 16);
+ MD5_Transform(ctx->buf, (uint32 *) ctx->in);
+ buf += t;
+ len -= t;
+ }
+ /* Process data in 64-byte chunks */
+
+ while (len >= 64) {
+ memcpy(ctx->in, buf, 64);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 16);
+ MD5_Transform(ctx->buf, (uint32 *) ctx->in);
+ buf += 64;
+ len -= 64;
+ }
+
+ /* Handle any remaining bytes of data. */
+
+ memcpy(ctx->in, buf, len);
}
/*
@@ -121,43 +121,43 @@ void MD5_Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len)
*/
void MD5_Final(unsigned char digest[16], struct MD5Context *ctx)
{
- unsigned count;
- unsigned char *p;
-
- /* Compute number of bytes mod 64 */
- count = (ctx->bits[0] >> 3) & 0x3F;
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- p = ctx->in + count;
- *p++ = 0x80;
-
- /* Bytes of padding needed to make 64 bytes */
- count = 64 - 1 - count;
-
- /* Pad out to 56 mod 64 */
- if (count < 8) {
- /* Two lots of padding: Pad the first block to 64 bytes */
- memset(p, 0, count);
- if (ctx->doByteReverse) byteReverse(ctx->in, 16);
- MD5_Transform(ctx->buf, (uint32 *) ctx->in);
-
- /* Now fill the next block with 56 bytes */
- memset(ctx->in, 0, 56);
- } else {
- /* Pad block to 56 bytes */
- memset(p, 0, count - 8);
- }
- if (ctx->doByteReverse) byteReverse(ctx->in, 14);
-
- /* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
-
- MD5_Transform(ctx->buf, (uint32 *) ctx->in);
- if (ctx->doByteReverse) byteReverse((unsigned char *) ctx->buf, 4);
- memcpy(digest, ctx->buf, 16);
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
+ unsigned count;
+ unsigned char *p;
+
+ /* Compute number of bytes mod 64 */
+ count = (ctx->bits[0] >> 3) & 0x3F;
+
+ /* Set the first char of padding to 0x80. This is safe since there is
+ always at least one byte free */
+ p = ctx->in + count;
+ *p++ = 0x80;
+
+ /* Bytes of padding needed to make 64 bytes */
+ count = 64 - 1 - count;
+
+ /* Pad out to 56 mod 64 */
+ if (count < 8) {
+ /* Two lots of padding: Pad the first block to 64 bytes */
+ memset(p, 0, count);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 16);
+ MD5_Transform(ctx->buf, (uint32 *) ctx->in);
+
+ /* Now fill the next block with 56 bytes */
+ memset(ctx->in, 0, 56);
+ } else {
+ /* Pad block to 56 bytes */
+ memset(p, 0, count - 8);
+ }
+ if (ctx->doByteReverse) byteReverse(ctx->in, 14);
+
+ /* Append length in bits and transform */
+ ((uint32 *) ctx->in)[14] = ctx->bits[0];
+ ((uint32 *) ctx->in)[15] = ctx->bits[1];
+
+ MD5_Transform(ctx->buf, (uint32 *) ctx->in);
+ if (ctx->doByteReverse) byteReverse((unsigned char *) ctx->buf, 4);
+ memcpy(digest, ctx->buf, 16);
+ memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}
#ifndef ASM_MD5
@@ -172,7 +172,7 @@ void MD5_Final(unsigned char digest[16], struct MD5Context *ctx)
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f, w, x, y, z, data, s) \
- ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
+ ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
@@ -181,85 +181,85 @@ void MD5_Final(unsigned char digest[16], struct MD5Context *ctx)
*/
void MD5_Transform(uint32 buf[4], uint32 const in[16])
{
- register uint32 a, b, c, d;
-
- a = buf[0];
- b = buf[1];
- c = buf[2];
- d = buf[3];
-
- MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478U, 7);
- MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756U, 12);
- MD5STEP(F1, c, d, a, b, in[2] + 0x242070dbU, 17);
- MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceeeU, 22);
- MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0fafU, 7);
- MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62aU, 12);
- MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613U, 17);
- MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501U, 22);
- MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8U, 7);
- MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7afU, 12);
- MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1U, 17);
- MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7beU, 22);
- MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122U, 7);
- MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193U, 12);
- MD5STEP(F1, c, d, a, b, in[14] + 0xa679438eU, 17);
- MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821U, 22);
-
- MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562U, 5);
- MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340U, 9);
- MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51U, 14);
- MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aaU, 20);
- MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105dU, 5);
- MD5STEP(F2, d, a, b, c, in[10] + 0x02441453U, 9);
- MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681U, 14);
- MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8U, 20);
- MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6U, 5);
- MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6U, 9);
- MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87U, 14);
- MD5STEP(F2, b, c, d, a, in[8] + 0x455a14edU, 20);
- MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905U, 5);
- MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8U, 9);
- MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9U, 14);
- MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8aU, 20);
-
- MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942U, 4);
- MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681U, 11);
- MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122U, 16);
- MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380cU, 23);
- MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44U, 4);
- MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9U, 11);
- MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60U, 16);
- MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70U, 23);
- MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6U, 4);
- MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127faU, 11);
- MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085U, 16);
- MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05U, 23);
- MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039U, 4);
- MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5U, 11);
- MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8U, 16);
- MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665U, 23);
-
- MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244U, 6);
- MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97U, 10);
- MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7U, 15);
- MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039U, 21);
- MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3U, 6);
- MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92U, 10);
- MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47dU, 15);
- MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1U, 21);
- MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4fU, 6);
- MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0U, 10);
- MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314U, 15);
- MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1U, 21);
- MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82U, 6);
- MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235U, 10);
- MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bbU, 15);
- MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391U, 21);
-
- buf[0] += a;
- buf[1] += b;
- buf[2] += c;
- buf[3] += d;
+ register uint32 a, b, c, d;
+
+ a = buf[0];
+ b = buf[1];
+ c = buf[2];
+ d = buf[3];
+
+ MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478U, 7);
+ MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756U, 12);
+ MD5STEP(F1, c, d, a, b, in[2] + 0x242070dbU, 17);
+ MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceeeU, 22);
+ MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0fafU, 7);
+ MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62aU, 12);
+ MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613U, 17);
+ MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501U, 22);
+ MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8U, 7);
+ MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7afU, 12);
+ MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1U, 17);
+ MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7beU, 22);
+ MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122U, 7);
+ MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193U, 12);
+ MD5STEP(F1, c, d, a, b, in[14] + 0xa679438eU, 17);
+ MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821U, 22);
+
+ MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562U, 5);
+ MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340U, 9);
+ MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51U, 14);
+ MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aaU, 20);
+ MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105dU, 5);
+ MD5STEP(F2, d, a, b, c, in[10] + 0x02441453U, 9);
+ MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681U, 14);
+ MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8U, 20);
+ MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6U, 5);
+ MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6U, 9);
+ MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87U, 14);
+ MD5STEP(F2, b, c, d, a, in[8] + 0x455a14edU, 20);
+ MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905U, 5);
+ MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8U, 9);
+ MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9U, 14);
+ MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8aU, 20);
+
+ MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942U, 4);
+ MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681U, 11);
+ MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122U, 16);
+ MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380cU, 23);
+ MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44U, 4);
+ MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9U, 11);
+ MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60U, 16);
+ MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70U, 23);
+ MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6U, 4);
+ MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127faU, 11);
+ MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085U, 16);
+ MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05U, 23);
+ MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039U, 4);
+ MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5U, 11);
+ MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8U, 16);
+ MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665U, 23);
+
+ MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244U, 6);
+ MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97U, 10);
+ MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7U, 15);
+ MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039U, 21);
+ MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3U, 6);
+ MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92U, 10);
+ MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47dU, 15);
+ MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1U, 21);
+ MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4fU, 6);
+ MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0U, 10);
+ MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314U, 15);
+ MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1U, 21);
+ MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82U, 6);
+ MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235U, 10);
+ MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bbU, 15);
+ MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391U, 21);
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
}
#endif
diff --git a/pyisomd5sum.c b/pyisomd5sum.c
index 5c37397..c9ed37c 100644
--- a/pyisomd5sum.c
+++ b/pyisomd5sum.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001-2012 Red Hat, Inc.
+ * Copyright (C) 2001-2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
--
1.8.1
11 years, 2 months
[blivet] Add scripts/makeupdates script
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Create a blivet updates.img for use when booting the installer image.
---
.gitignore | 3 +
scripts/makeupdates | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 243 insertions(+)
create mode 100755 scripts/makeupdates
diff --git a/.gitignore b/.gitignore
index e50959c..897cde7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,6 @@ po/en(a)quot.insert-header
po/en(a)quot.po
po/remove-potcdate.sed
po/stamp-po
+updates.img
+updates/
+
diff --git a/scripts/makeupdates b/scripts/makeupdates
new file mode 100755
index 0000000..b11b554
--- /dev/null
+++ b/scripts/makeupdates
@@ -0,0 +1,240 @@
+#!/usr/bin/python
+#
+# makeupdates - Generate an updates.img containing changes since the last
+# tag.
+#
+# Copyright (C) 2009-2013 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: David Cantrell <dcantrell(a)redhat.com>
+
+import getopt
+import os
+import shutil
+import subprocess
+import sys
+
+def getArchiveTag(spec, name="blivet"):
+ """ Get the last tag from the .spec file
+ """
+ f = open(spec)
+ lines = f.readlines()
+ f.close()
+
+ version = "0.0"
+ release = "1"
+ for line in lines:
+ if line.startswith('Version:'):
+ version = line.split()[1]
+ elif line.startswith('Release:'):
+ release = line.split()[1].split('%')[0]
+ else:
+ continue
+
+ return "-".join([name, version, release])
+
+def getArchiveTagOffset(spec, offset, name="blivet"):
+ tag = getArchiveTag(spec, name)
+
+ if not tag.count("-") >= 2:
+ return tag
+ ldash = tag.rfind("-")
+ bldash = tag[:ldash].rfind("-")
+ ver = tag[bldash+1:ldash]
+
+ if not ver.count(".") >= 1:
+ return tag
+ ver = ver[:ver.rfind(".")]
+
+ if not len(ver) > 0:
+ return tag
+ globstr = "refs/tags/" + tag[:bldash+1] + ver + ".*"
+ proc = subprocess.Popen(['git', 'for-each-ref', '--sort=taggerdate',
+ '--format=%(tag)', globstr],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE).communicate()
+ lines = proc[0].strip("\n").split('\n')
+ lines.reverse()
+
+ try:
+ return lines[offset]
+ except IndexError:
+ return tag
+
+def doGitDiff(tag, args=[]):
+ proc = subprocess.Popen(['git', 'diff', '--name-status', tag] + args,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE).communicate()
+
+ lines = proc[0].split('\n')
+ return lines
+
+def copyUpdatedFiles(tag, updates, cwd):
+ def pruneFile(src, names):
+ lst = []
+
+ for name in names:
+ if name.startswith('Makefile') or name.endswith('.pyc'):
+ lst.append(name)
+
+ return lst
+
+ def install_to_dir(fname, relpath):
+ sys.stdout.write("Including %s\n" % fname)
+ outdir = os.path.join(updates, relpath)
+ if not os.path.isdir(outdir):
+ os.makedirs(outdir)
+ shutil.copy2(file, outdir)
+
+ # Updates get overlaid onto the runtime filesystem. Anaconda expects them
+ # to be in /run/install/updates, so put them in
+ # $updatedir/run/install/updates.
+ tmpupdates = updates.rstrip('/')
+ if not tmpupdates.endswith("/run/install/updates"):
+ tmpupdates = os.path.join(tmpupdates, "run/install/updates")
+
+ lines = doGitDiff(tag)
+ for line in lines:
+ fields = line.split()
+
+ if len(fields) < 2:
+ continue
+
+ status = fields[0]
+ file = fields[1]
+
+ if status == "D":
+ continue
+
+ if file.endswith('.spec') or (file.find('Makefile') != -1) or \
+ file.endswith('.c') or file.endswith('.h') or \
+ file.endswith('.sh') or file == 'setup.py':
+ continue
+
+ if file.startswith('blivet/'):
+ # blivet stuff goes into /tmp/updates/[path]
+ dirname = os.path.join(tmpupdates, os.path.dirname(file))
+ install_to_dir(file, dirname)
+ else:
+ sys.stdout.write("Including %s\n" % (file,))
+ install_to_dir(file, tmpupdates)
+
+def _compilableChanged(tag, compilable):
+ lines = doGitDiff(tag, [compilable])
+
+ for line in lines:
+ fields = line.split()
+
+ if len(fields) < 2:
+ continue
+
+ status = fields[0]
+ file = fields[1]
+
+ if status == "D":
+ continue
+
+ if file.startswith('Makefile') or file.endswith('.h') or \
+ file.endswith('.c') or file.endswith('.py'):
+ return True
+
+ return False
+
+def addRpms(updates, add_rpms):
+ for rpm in add_rpms:
+ cmd = "cd %s && rpm2cpio %s | cpio -dium" % (updates, rpm)
+ sys.stdout.write(cmd+"\n")
+ os.system(cmd)
+
+def createUpdatesImage(cwd, updates):
+ os.chdir(updates)
+ os.system("find . | cpio -c -o | gzip -9cv > %s/updates.img" % (cwd,))
+ sys.stdout.write("updates.img ready\n")
+
+def usage(cmd):
+ sys.stdout.write("Usage: %s [OPTION]...\n" % (cmd,))
+ sys.stdout.write("Options:\n")
+ sys.stdout.write(" -k, --keep Do not delete updates subdirectory.\n")
+ sys.stdout.write(" -h, --help Display this help and exit.\n")
+ sys.stdout.write(" -t, --tag Make image from TAG to HEAD.\n")
+ sys.stdout.write(" -o, --offset Make image from (latest_tag - OFFSET) to HEAD.\n")
+ sys.stdout.write(" -a, --add Add contents of rpm to the update\n")
+
+def main(argv):
+ prog = os.path.basename(sys.argv[0])
+ cwd = os.getcwd()
+ spec = os.path.realpath(cwd + '/python-blivet.spec')
+ updates = cwd + '/updates'
+ keep, compile, help, unknown = False, False, False, False
+ tag = None
+ opts = []
+ offset = 0
+ add_rpms = []
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], 'a:t:o:kc?',
+ ['add=', 'tag=', 'offset=',
+ 'keep', 'compile', 'help'])
+ except getopt.GetoptError:
+ help = True
+
+ for o, a in opts:
+ if o in ('-k', '--keep'):
+ keep = True
+ elif o in ('-?', '--help'):
+ help = True
+ elif o in ('-t', '--tag'):
+ tag = a
+ elif o in ('-o', '--offset'):
+ offset = int(a)
+ elif o in ('-a', '--add'):
+ add_rpms.append(os.path.abspath(a))
+ else:
+ unknown = True
+
+ if help:
+ usage(prog)
+ sys.exit(0)
+ elif unknown:
+ sys.stderr.write("%s: extra operand `%s'" % (prog, sys.argv[1],))
+ sys.stderr.write("Try `%s --help' for more information." % (prog,))
+ sys.exit(1)
+
+ if not os.path.isfile(spec):
+ sys.stderr.write("You must be at the top level of the blivet source tree.\n")
+ sys.exit(1)
+
+ if not tag:
+ if offset < 1:
+ tag = getArchiveTag(spec)
+ else:
+ tag = getArchiveTagOffset(spec, offset)
+ sys.stdout.write("Using tag: %s\n" % tag)
+
+ if not os.path.isdir(updates):
+ os.makedirs(updates)
+
+ copyUpdatedFiles(tag, updates, cwd)
+
+ if add_rpms:
+ addRpms(updates, add_rpms)
+
+ createUpdatesImage(cwd, updates)
+
+ if not keep:
+ shutil.rmtree(updates)
+
+if __name__ == "__main__":
+ main(sys.argv)
--
1.8.1
11 years, 2 months
[master] Change for addons to work and minor fix
by Vratislav Podzimek
PATCH 1/2 is needed to make addons work.
Martin Sivak (1):
Try to import modules the standard way first in collect
Vratislav Podzimek (1):
Use %_prefix macro value when calling configure in makeupdates
pyanaconda/addons.py | 6 +++---
pyanaconda/ui/common.py | 29 +++++++++++++++++++++++++++--
scripts/makeupdates | 4 ++--
3 files changed, 32 insertions(+), 7 deletions(-)
--
1.7.11.7
11 years, 2 months
[PATCH] Teach TUI how to react on async events
by Martin Sivak
This involves couple of places:
- TUI is blocking and waiting for user input
- Progress HUB is in charge and is reading the progress queue
- any other part wanting to react to a message like READY, ..
This patch directly fixes the first two and adds a mechanism
to register callbacks that will react to the third one.
We (me and vpodzime) expect python-meh integration to use
this to file exception reports from text mode installation.
---
pyanaconda/ui/communication.py | 4 ++
pyanaconda/ui/tui/__init__.py | 3 +-
pyanaconda/ui/tui/hubs/progress.py | 12 +++-
pyanaconda/ui/tui/simpleline/base.py | 104 +++++++++++++++++++++++++++++++++--
pyanaconda/ui/tui/spokes/password.py | 5 +-
5 files changed, 117 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/ui/communication.py b/pyanaconda/ui/communication.py
index 19e3a24..04bb512 100644
--- a/pyanaconda/ui/communication.py
+++ b/pyanaconda/ui/communication.py
@@ -37,9 +37,13 @@ hubQ = Queue.Queue()
# _READY - [spoke_name, justUpdate]
# _NOT_READY - [spoke_name]
# _MESSAGE - [spoke_name, string]
+# _INPUT - [string]
+# _EXCEPTION - [exc]
HUB_CODE_READY = 0
HUB_CODE_NOT_READY = 1
HUB_CODE_MESSAGE = 2
+HUB_CODE_INPUT = 3
+HUB_CODE_EXCEPTION = 4
# Convenience methods to put things into the queue without the user having to
# know the details of the queue.
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 83c2beb..8da9846 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -21,6 +21,7 @@
from pyanaconda import ui
from pyanaconda.ui import common
+from pyanaconda.ui import communication
from pyanaconda.flags import flags
import simpleline as tui
from hubs.summary import SummaryHub
@@ -170,7 +171,7 @@ class TextUserInterface(ui.UserInterface):
"""Construct all the objects required to implement this interface.
This method must be provided by all subclasses.
"""
- self._app = tui.App(u"Anaconda", yes_or_no_question = YesNoDialog)
+ self._app = tui.App(u"Anaconda", yes_or_no_question=YesNoDialog, queue=communication.hubQ)
_hubs = self._list_hubs()
# First, grab a list of all the standalone spokes.
diff --git a/pyanaconda/ui/tui/hubs/progress.py b/pyanaconda/ui/tui/hubs/progress.py
index c80372e..72cb5dc 100644
--- a/pyanaconda/ui/tui/hubs/progress.py
+++ b/pyanaconda/ui/tui/hubs/progress.py
@@ -52,7 +52,17 @@ class ProgressHub(TUIHub):
while True:
# Attempt to get a message out of the queue for how we should update
# the progress bar. If there's no message, don't error out.
- (code, args) = q.get()
+ # Also flush the communication Queue at least once a second and
+ # process it's events so we can react to async evens (like a thread
+ # throwing an exception)
+ while True:
+ try:
+ (code, args) = q.get(timeout = 1)
+ break
+ except Queue.Empty:
+ pass
+ finally:
+ self.app.process_events()
if code == progress.PROGRESS_CODE_INIT:
# Text mode doesn't have a finite progress bar
diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index e3039d2..f6ed9fb 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -22,6 +22,10 @@
__all__ = ["App", "UIScreen", "Widget"]
import readline
+import Queue
+import getpass
+from pyanaconda.threads import threadMgr, AnacondaThread
+from pyanaconda.ui.communication import HUB_CODE_INPUT
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -36,7 +40,6 @@ class ExitMainLoop(Exception):
close."""
pass
-
class App(object):
"""This is the main class for TUI screen handling. It is responsible for
mainloop control and keeping track of the screen stack.
@@ -55,7 +58,7 @@ class App(object):
STOP_MAINLOOP = False
NOP = None
- def __init__(self, title, yes_or_no_question = None, width = 80):
+ def __init__(self, title, yes_or_no_question = None, width = 80, queue = None):
"""
:param title: application title for whenever we need to display app name
:type title: unicode
@@ -72,6 +75,20 @@ class App(object):
self._width = width
self.quit_question = yes_or_no_question
+ # async control queue
+ if queue:
+ self.queue = queue
+ else:
+ self.queue = Queue.Queue()
+
+ # ensure unique thread names
+ self._in_thread_counter = 0
+
+ # event handlers
+ # key: event id
+ # value: list of tuples (callback, data)
+ self._handlers = {}
+
# screen stack contains triplets
# UIScreen to show
# arguments for it's show method
@@ -81,6 +98,50 @@ class App(object):
# - False = already running loop, exit when window closes
self._screens = []
+ def register_event_handler(self, event, callback, data = None):
+ """This method registers a callback which will be called
+ when message "event" is encountered during process_events.
+
+ The callback has to accept two arguments:
+ - the received message in the form of (type, [arguments])
+ - the data registered with the handler
+
+ :param event: the id of the event we want to react on
+ :type event: number|string
+
+ :param callback: the callback function
+ :type callback: func(event_message, data)
+
+ :param data: optional data to pass to callback
+ :type data: anything
+ """
+ if not event in self._handlers:
+ self._handlers[event] = []
+ self._handlers[event].append((callback, data))
+
+ def _thread_input(self, queue, prompt, hidden):
+ """This method is responsible for interruptible user input. It is expected
+ to be used in a thread started on demand by the App class and returns the
+ input via the communication Queue.
+
+ :param queue: communication queue to be used
+ :type queue: Queue.Queue instance
+
+ :param prompt: prompt to be displayed
+ :type prompt: str
+
+ :param hidden: whether typed characters should be echoed or not
+ :type hidden: bool
+
+ """
+
+ if hidden:
+ data = getpass.getpass(prompt)
+ else:
+ data = raw_input(prompt)
+
+ queue.put((HUB_CODE_INPUT, [data]))
+
def switch_screen(self, ui, args = None):
"""Schedules a screen to replace the current one.
@@ -223,6 +284,9 @@ class App(object):
# run until there is nothing else to display
while self._screens:
+ # process asynchronous events
+ self.process_events()
+
# if redraw is needed, separate the content on the screen from the
# stuff we are about to display now
if self._redraw:
@@ -271,10 +335,38 @@ class App(object):
except ExitAllMainLoops:
raise
- def raw_input(self, prompt):
- """This method reads one input from user. Its basic form has only one line,
- but we might need to override it for more complex apps or testing."""
- return raw_input(prompt)
+ def process_events(self, return_at = None):
+ """This method processes incoming async messages and returns
+ when a specific message is encountered or when the queue
+ is empty.
+
+ If return_at message was specified, the received
+ message is returned.
+
+ If the message does not fit return_at, but handlers are
+ defined then it processes all handlers for this message
+ """
+ while return_at or not self.queue.empty():
+ event = self.queue.get()
+ if event[0] == return_at:
+ return event
+ elif event[0] in self._handlers:
+ for handler, data in self._handlers[event[0]]:
+ handler(event, data)
+
+ def raw_input(self, prompt, hidden=False):
+ """This method reads one input from user. Its basic form has only one
+ line, but we might need to override it for more complex apps or testing."""
+
+ thread_name = "AnaInputThread%d" % self._in_thread_counter
+ self._in_thread_counter += 1
+ input_thread = AnacondaThread(name=thread_name,
+ target=self._thread_input,
+ args=(self.queue, prompt, hidden))
+ input_thread.daemon = True
+ threadMgr.add(input_thread)
+ event = self.process_events(return_at=HUB_CODE_INPUT)
+ return event[1][0] # return the user input
def input(self, args, key):
"""Method called internally to process unhandled input key presses.
diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py
index f812678..bd81603 100644
--- a/pyanaconda/ui/tui/spokes/password.py
+++ b/pyanaconda/ui/tui/spokes/password.py
@@ -25,7 +25,6 @@ from pyanaconda.ui.tui.simpleline import TextWidget
from pyanaconda.ui.tui import YesNoDialog
from pyanaconda.users import validatePassword
from pwquality import PWQError
-import getpass
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -65,8 +64,8 @@ class PasswordSpoke(NormalTUISpoke):
def prompt(self, args = None):
"""Overriden prompt as password typing is special."""
- pw = getpass.getpass(_("Password: "))
- confirm = getpass.getpass(_("Password (confirm): "))
+ pw = self._app.raw_input(_("Password: "), hidden=True)
+ confirm = self._app.raw_input(_("Password (confirm): "), hidden=True)
error = None
# just returning an error is either blank or mismatched
--
1.7.11.7
11 years, 2 months
[master] Fix RAID level test
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
The string needs to be converted to a raid level before passing it to
blivet.
---
pyanaconda/ui/gui/spokes/custom.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index ddddcb3..ba93b72 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1353,11 +1353,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# what is the incremental disk space requirement for this feature?
# TODO: update this when the size spinner changes
- level = self._get_raid_level()
- min_disks = mdraid.get_raid_min_members(level)
- if min_disks <= len(factory.disks):
- factory.raid_level = level
- delta = factory.device_size - base_size
+ raid_level = self._get_raid_level()
+ if raid_level not in (None, "single"):
+ md_level = mdraid.raidLevel(raid_level)
+ min_disks = mdraid.get_raid_min_members(md_level)
+ if min_disks <= len(factory.disks):
+ factory.raid_level = md_level
+ delta = factory.device_size - base_size
def _get_current_device_type(self):
typeCombo = self.builder.get_object("deviceTypeCombo")
--
1.8.1
11 years, 2 months
[blivet] parse buffer output from resize (#913141)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
blivet/formats/fs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 5ec1948..de94ff4 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -1266,7 +1266,7 @@ class NTFS(FS):
if self.exists and os.path.exists(self.device) and \
util.find_program_in_path(self.resizefsProg):
minSize = None
- buf = util.run_program([self.resizefsProg, "-m", self.device])
+ buf = util.capture_output([self.resizefsProg, "-m", self.device])
for l in buf.split("\n"):
if not l.startswith("Minsize"):
continue
--
1.8.1
11 years, 2 months
[PATCH 1/3] If you set_markup, the label forgets set_use_underline from glade.
by Chris Lumens
---
pyanaconda/ui/gui/spokes/custom.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index dea3dce..6449d16 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -600,6 +600,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
summaryLabel.set_use_markup(True)
summaryLabel.set_markup("<span foreground='blue'><u>%s</u></span>" % summary)
+ summaryLabel.set_use_underline(True)
def _reset_storage(self):
self.__storage = self.storage.copy()
--
1.8.1.2
11 years, 2 months
[PATCH] Don't emit "gfxterm" in grub2 configs (#821355)
by Peter Jones
This seems to break a pile of hardware, and we don't want a theme on
RHEL anyway, so we shouldn't use it there.
Resolves: rhbz#821355
---
pyanaconda/bootloader.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index c24ccc3..000d493 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1349,6 +1349,7 @@ class GRUB2(GRUB):
defaults_file = "/etc/default/grub"
can_dual_boot = True
can_update = True
+ terminal_type = "console"
# requirements for boot devices
stage2_device_types = ["partition", "mdarray", "lvmlv", "btrfs volume",
@@ -1442,6 +1443,8 @@ class GRUB2(GRUB):
if self.console and self.console.startswith("ttyS"):
defaults.write("GRUB_TERMINAL=\"serial console\"\n")
defaults.write("GRUB_SERIAL_COMMAND=\"%s\"\n" % self.serial_command)
+ else:
+ defaults.write("GRUB_TERMINAL_OUTPUT=\"%s\"\n" % self.terminal_type)
# this is going to cause problems for systems containing multiple
# linux installations or even multiple boot entries with different
@@ -1903,6 +1906,7 @@ class IPSeriesGRUB2(GRUB2):
# to present the disk as a bootable target. If stage2_bootable is False, then the PReP partition
# will be marked bootable. Confusing.
stage2_bootable = False
+ terminal_type = "ofconsole"
#
# installation
--
1.8.1.2
11 years, 2 months