debian/0000775000000000000000000000000012317020351007162 5ustar debian/kerneloops-daemon.kerneloops.default0000664000000000000000000000012412315364343016341 0ustar # Whether the daemon should be started at boot time. # Set to 1 to start. ENABLED=1 debian/patches/0000775000000000000000000000000012315364343010623 5ustar debian/patches/ubuntu-set-poll-to-60-seconds.patch0000664000000000000000000000100612315364343017217 0ustar Index: kerneloops/kerneloops.c =================================================================== --- kerneloops.orig/kerneloops.c 2014-03-07 11:55:45.507716000 +0000 +++ kerneloops/kerneloops.c 2014-03-07 12:02:00.213119687 +0000 @@ -214,7 +214,7 @@ /* now, start polling for oopses to occur */ - g_timeout_add_seconds(10, scan_dmesg, NULL); + g_timeout_add_seconds(60, scan_dmesg, NULL); g_main_loop_run(loop); dbus_bus_remove_match(bus, "type='signal',interface='org.kerneloops.submit.ping'", &error); debian/patches/ubuntu-handle-allocs-and-memleak.patch0000664000000000000000000000276212315364343020052 0ustar Index: trunk/dmesg.c =================================================================== --- trunk.orig/dmesg.c 2014-03-05 08:55:54.557313506 -0800 +++ trunk/dmesg.c 2014-03-05 08:58:20.045311713 -0800 @@ -83,6 +83,8 @@ char *c9; c9 = memchr(c, '\n', buffer + buflen - c); /* a \n will always be found */ + if (!c9) + return 0; assert(c9); len = c9 - c; @@ -299,6 +301,8 @@ len += strlen(lines_info[q].ptr)+1; oops = calloc(len, 1); + if (!oops) + goto fail; for (q = oopsstart; q <= oopsend; q++) { strcat(oops, lines_info[q].ptr); @@ -340,6 +344,8 @@ len += strlen(lines_info[q].ptr)+1; oops = calloc(len, 1); + if (!oops) + goto fail; for (q = oopsstart; q <= oopsend; q++) { strcat(oops, lines_info[q].ptr); @@ -363,6 +369,8 @@ char *buffer; buffer = calloc(getpagesize()+1, 1); + if (!buffer) + return -1; syscall(__NR_syslog, 3, buffer, getpagesize()); extract_oops(buffer, strlen(buffer), 0); Index: trunk/kerneloops-submit.c =================================================================== --- trunk.orig/kerneloops-submit.c 2014-03-05 08:55:54.557313506 -0800 +++ trunk/kerneloops-submit.c 2014-03-05 08:55:54.553313507 -0800 @@ -47,6 +47,8 @@ { char *c, *c1, *c2; c = malloc(size*nmemb + 1); + if (!c) + return 0; memset(c, 0, size*nmemb + 1); memcpy(c, ptr, size*nmemb); c1 = strstr(c, "201 "); @@ -56,6 +58,7 @@ if (c2) *c2 = 0; strncpy(result_url, c1, 4095); } + free(c); return size * nmemb; } debian/patches/series0000664000000000000000000000053012315364343012036 0ustar remove_test_dbg.patch add_missing_include.patch link_against_dbus-glib.patch libnotify0.7.patch l10n_da.patch l10n_de.patch ubuntu-kernoops-user.patch ubuntu-change-syslog-location.patch ubuntu-ignore-newline.patch ubuntu-add-submit-pipe.patch ubuntu-adapt-dmesg.patch ubuntu-handle-allocs-and-memleak.patch ubuntu-set-poll-to-60-seconds.patch debian/patches/l10n_da.patch0000664000000000000000000000516412315364343013070 0ustar diff --git a/po/da.po b/po/da.po new file mode 100644 index 0000000..df9062a --- /dev/null +++ b/po/da.po @@ -0,0 +1,75 @@ +# Danish translation kerneloops. +# Copyright (C) 2011 kerneloops og nedenstående oversættere. +# This file is distributed under the same license as the kerneloops package. +# Joe Hansen , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: kerneloops\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-01-01 06:36-0800\n" +"PO-Revision-Date: 2011-01-07 17:30+01:00\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: kerneloops-applet.c:170 kerneloops-applet.c:212 +msgid "Always" +msgstr "Altid" + +#: kerneloops-applet.c:332 +#, c-format +msgid "Connecting to system bus failed: %s\n" +msgstr "Forbindelse til systembus mislykkedes: %s\n" + +#: kerneloops-applet.c:190 +msgid "" +"Diagnostic information from your Linux kernel has been sent to www.kerneloops.org for the Linux kernel " +"developers to work on. \n" +"Thank you for contributing to improve the quality of the Linux kernel.\n" +msgstr "" +"Diagnostisk information fra din Linuxkerne er blevet sendt til www.kerneloops.org, så at udviklerne " +"på Linuxkernen kan arbejde for forbedringer. \n" +"Tak for dit bidrag til forbedring af kvaliteten på Linuxkernen.\n" + +#: kerneloops-applet.c:188 +msgid "Kernel bug diagnostic information sent" +msgstr "diagnostisk information for kernefejlsøgning blev sendt" + +#: kerneloops-applet.c:176 +msgid "Never" +msgstr "Aldrig" + +#: kerneloops-applet.c:214 +msgid "Never again" +msgstr "Aldrig igen" + +#: kerneloops-applet.c:174 +msgid "No" +msgstr "Nej" + +#: kerneloops-applet.c:143 +msgid "" +"There is diagnostic information available for this failure. Do you want to " +"submit this information to the www." +"kerneloops.org website for use by the Linux kernel developers?\n" +msgstr "" +"Der er diagnostisk information tilgængelig for denne fejl. Ønsker du at sende " +"denne information til hjemmesiden www." +"kerneloops.org, så udviklerne på Linuxkernen kan bruge informationen?\n" + +#: kerneloops-applet.c:172 +msgid "Yes" +msgstr "Ja" + +#: kerneloops-applet.c:141 +msgid "Your system had a kernel failure" +msgstr "Dit system har en kernefejl" + +#: kerneloops-applet.c:343 +msgid "kerneloops client" +msgstr "klient for kerneloops" debian/patches/remove_test_dbg.patch0000664000000000000000000000060212315364343015012 0ustar --- kerneloops-0.12+git20090217.orig/Makefile +++ kerneloops-0.12+git20090217/Makefile @@ -40,7 +40,7 @@ kerneloops.8.gz: kerneloops.8 gzip -9 -c $< > $@ clean: - rm -f *~ *.o *.ko DEADJOE kerneloops kerneloops-applet *.out */*~ kerneloops.8.gz + rm -f *~ *.o *.ko DEADJOE kerneloops kerneloops-applet *.out */*~ kerneloops.8.gz test/*.dbg @(cd po/ && $(MAKE) $@) dist: clean debian/patches/ubuntu-adapt-dmesg.patch0000664000000000000000000003000212315364343015345 0ustar Description: Ubuntu changes to dmesg.c Squashed together changes to dmesg.c from the previous ubuntu package. Changes are: - Serveral changes for which no related changelog entries were found: - Use array of struct instead of two arrays for lineptrs and levels. - Grow lineptr aray in chunks. - Change lines into zero terminated strings. - Add some asserts. - Change some str* calls into mem* counterparts. - Ignore two WARNINGS of EDAC (LP: 422536, 525792) Forwarded: no Origin: vendor, ??? Bug-Ubuntu: http://bugs.launchpad.net/bugs/422536 Bug-Ubuntu: http://bugs.launchpad.net/bugs/525792 Index: kerneloops-0.12+git20090217/dmesg.c =================================================================== --- kerneloops-0.12+git20090217.orig/dmesg.c 2012-05-25 12:08:04.898374121 +0200 +++ kerneloops-0.12+git20090217/dmesg.c 2012-05-25 12:09:18.234732652 +0200 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -36,101 +37,119 @@ #include "kerneloops.h" -static char **linepointer; +struct line_info { + char *ptr; + char level; +}; -static char *linelevel; +static struct line_info *lines_info; +static int lines_info_alloc; static int linecount; -#define MAX(A,B) ((A) > (B) ? (A) : (B)) +#define MIN(A,B) ((A) < (B) ? (A) : (B)) +#define REALLOC_CHUNK 1000 +static int set_line_info(int index, char *linepointer, char linelevel) +{ + if (index >= lines_info_alloc) { + struct line_info *new_info; + new_info = realloc(lines_info, + (lines_info_alloc + REALLOC_CHUNK) * sizeof(struct line_info)); + if (!new_info) + return -1; + lines_info_alloc += REALLOC_CHUNK; + lines_info = new_info; + } + + lines_info[index].ptr = linepointer; + lines_info[index].level = linelevel; + return 0; +} /* * This function splits the dmesg buffer data into lines - * (null terminated). The linepointer array is assumed to be - * allocated already. + * (null terminated). */ -static void fill_linepointers(char *buffer, int remove_syslog) +static int fill_lineinfo(char *buffer, size_t buflen, int remove_syslog) { - char *c; + char *c, *linepointer, linelevel; linecount = 0; + if (!buflen) + return 0; + buffer[buflen - 1] = '\n'; /* the buffer usually ends with \n, but let's make sure */ c = buffer; - while (c) { + while (c < buffer + buflen) { int len = 0; char *c9; - c9 = strchr(c, '\n'); - if (c9) - len = c9 - c; + c9 = memchr(c, '\n', buffer + buflen - c); /* a \n will always be found */ + assert(c9); + len = c9 - c; /* in /var/log/messages, we need to strip the first part off, upto the 3rd ':' */ if (remove_syslog) { char *c2; + int i; /* skip non-kernel lines */ c2 = memmem(c, len, "kernel:", 7); if (!c2) c2 = memmem(c, len, "kerneloops:", 11); - if (!c2) { - c2 = c9; - if (c2) { - c = c2 + 1; - continue; - } else - break; + if (!c2) + goto next_line; + + /* skip to message in "Jan 01 01:23:45 hostname kernel: message" */ + for (i = 0; i < 3; i++) { + c = memchr(c, ':', len); + if (!c) + goto next_line; + c++; + len = c9 - c; } - c = strchr(c, ':'); - if (!c) - break; - c++; - c = strchr(c, ':'); - if (!c) - break; c++; - c = strchr(c, ':'); - if (!c) - break; - c++; - if (*c) - c++; + len--; } - linepointer[linecount] = c; - linelevel[linecount] = 0; + linepointer = c; + linelevel = 0; /* store and remove kernel log level */ - if (*c == '<' && *(c+2) == '>') { - linelevel[linecount] = *(c+1); - c = c + 3; - linepointer[linecount] = c; + if (len >= 3 && *c == '<' && *(c+2) == '>') { + linelevel = *(c+1); + c += 3; + len -= 3; + linepointer = c; } /* remove jiffies time stamp counter if present */ if (*c == '[') { char *c2, *c3; - c2 = strchr(c, '.'); - c3 = strchr(c, ']'); + c2 = memchr(c, '.', len); + c3 = memchr(c, ']', len); if (c2 && c3 && (c2 < c3) && (c3-c) < 14 && (c2-c) < 8) { - c = c3+1; + c = c3 + 1; if (*c == ' ') c++; - linepointer[linecount] = c; + len = c9 - c; + linepointer = c; } } - c = strchr(c, '\n'); /* turn the \n into a string termination */ - if (c) { - *c = 0; - c = c+1; - } + assert(c + len == c9); + *c9 = '\0'; /* turn the \n into a string termination */ /* if we see our own marker, we know we submitted everything upto here already */ - if (strstr(linepointer[linecount], "www.kerneloops.org")) { + if (memmem(linepointer, len, "www.kerneloops.org", 18)) { linecount = 0; - linepointer[0] = NULL; + lines_info[0].ptr = NULL; } + if (set_line_info(linecount, linepointer, linelevel) < 0) + return -1; linecount++; +next_line: + c = c9 + 1; } + return 0; } - /* * extract_oops tries to find oops signatures in a log */ @@ -142,23 +161,17 @@ int oopsend; int inbacktrace = 0; - linepointer = calloc(buflen+1, sizeof(char*)); - if (!linepointer) - return; - linelevel = calloc(buflen+1, sizeof(char)); - if (!linelevel) { - free(linepointer); - linepointer = NULL; - return; - } + lines_info = NULL; + lines_info_alloc = 0; - fill_linepointers(buffer, remove_syslog); + if (fill_lineinfo(buffer, buflen, remove_syslog) < 0) + goto fail; oopsend = linecount; i = 0; while (i < linecount) { - char *c = linepointer[i]; + char *c = lines_info[i].ptr; if (c == NULL) { i++; @@ -187,7 +200,9 @@ if (strstr(c, "NETDEV WATCHDOG")) oopsstart = i; if (strstr(c, "WARNING:") && - !strstr(c, "appears to be on the same physical disk")) + !strstr(c, "appears to be on the same physical disk") && + !strstr(c, "ECC is NOT currently enabled by the BIOS") && + !strstr(c, "ECC is disabled by BIOS. Module will NOT be loaded.")) oopsstart = i; if (strstr(c, "Unable to handle kernel")) oopsstart = i; @@ -203,7 +218,7 @@ oopsstart = i-3; if (oopsstart >= 0 && testmode) { printf("Found start of oops at line %i\n", oopsstart); - printf(" start line is -%s-\n", linepointer[oopsstart]); + printf(" start line is -%s-\n", lines_info[oopsstart].ptr); if (oopsstart != i) printf(" trigger line is -%s-\n", c); } @@ -213,7 +228,7 @@ int i2; i2 = i+1; while (i2 < linecount && i2 < (i+50)) { - if (strstr(linepointer[i2], "---[ end trace")) { + if (strstr(lines_info[i2].ptr, "---[ end trace")) { inbacktrace = 1; i = i2; break; @@ -224,15 +239,15 @@ } /* a calltrace starts with "Call Trace:" or with the " [<.......>] function+0xFF/0xAA" pattern */ - if (oopsstart >= 0 && strstr(linepointer[i], "Call Trace:")) + if (oopsstart >= 0 && strstr(lines_info[i].ptr, "Call Trace:")) inbacktrace = 1; - else if (oopsstart >= 0 && inbacktrace == 0 && strlen(linepointer[i]) > 8) { + else if (oopsstart >= 0 && inbacktrace == 0 && strlen(lines_info[i].ptr) > 8) { char *c1, *c2, *c3; - c1 = strstr(linepointer[i], ">]"); - c2 = strstr(linepointer[i], "+0x"); - c3 = strstr(linepointer[i], "/0x"); - if (linepointer[i][0] == ' ' && linepointer[i][1] == '[' && linepointer[i][2] == '<' && c1 && c2 && c3) + c1 = strstr(lines_info[i].ptr, ">]"); + c2 = strstr(lines_info[i].ptr, "+0x"); + c3 = strstr(lines_info[i].ptr, "/0x"); + if (lines_info[i].ptr[0] == ' ' && lines_info[i].ptr[1] == '[' && lines_info[i].ptr[2] == '<' && c1 && c2 && c3) inbacktrace = 1; } else @@ -240,38 +255,38 @@ if (oopsstart >= 0 && inbacktrace > 0) { char c2, c3; - c2 = linepointer[i][0]; - c3 = linepointer[i][1]; + c2 = lines_info[i].ptr[0]; + c3 = lines_info[i].ptr[1]; /* line needs to start with " [" or have "] ["*/ if ((c2 != ' ' || c3 != '[') && - strstr(linepointer[i], "] [") == NULL && - strstr(linepointer[i], "--- Exception") == NULL && - strstr(linepointer[i], " LR =") == NULL && - strstr(linepointer[i], "<#DF>") == NULL && - strstr(linepointer[i], "") == NULL && - strstr(linepointer[i], "") == NULL && - strstr(linepointer[i], "<>") == NULL) + strstr(lines_info[i].ptr, "] [") == NULL && + strstr(lines_info[i].ptr, "--- Exception") == NULL && + strstr(lines_info[i].ptr, " LR =") == NULL && + strstr(lines_info[i].ptr, "<#DF>") == NULL && + strstr(lines_info[i].ptr, "") == NULL && + strstr(lines_info[i].ptr, "") == NULL && + strstr(lines_info[i].ptr, "<>") == NULL) oopsend = i-1; /* oops lines are always more than 8 long */ - if (strlen(linepointer[i]) < 8) + if (strlen(lines_info[i].ptr) < 8) oopsend = i-1; /* single oopses are of the same loglevel */ - if (linelevel[i] != prevlevel) + if (lines_info[i].level != prevlevel) oopsend = i-1; /* The Code: line means we're done with the backtrace */ - if (strstr(linepointer[i], "Code:") != NULL) + if (strstr(lines_info[i].ptr, "Code:") != NULL) oopsend = i; - if (strstr(linepointer[i], "Instruction dump::") != NULL) + if (strstr(lines_info[i].ptr, "Instruction dump::") != NULL) oopsend = i; /* if a new oops starts, this one has ended */ - if (strstr(linepointer[i], "WARNING:") != NULL && oopsstart != i) + if (strstr(lines_info[i].ptr, "WARNING:") != NULL && oopsstart != i) oopsend = i-1; - if (strstr(linepointer[i], "Unable to handle") != NULL && oopsstart != i) + if (strstr(lines_info[i].ptr, "Unable to handle") != NULL && oopsstart != i) oopsend = i-1; /* kernel end-of-oops marker */ - if (strstr(linepointer[i], "---[ end trace") != NULL) + if (strstr(lines_info[i].ptr, "---[ end trace") != NULL) oopsend = i; if (oopsend <= i) { @@ -281,12 +296,12 @@ len = 2; for (q = oopsstart; q <= oopsend; q++) - len += strlen(linepointer[q])+1; + len += strlen(lines_info[q].ptr)+1; oops = calloc(len, 1); for (q = oopsstart; q <= oopsend; q++) { - strcat(oops, linepointer[q]); + strcat(oops, lines_info[q].ptr); strcat(oops, "\n"); } /* too short oopses are invalid */ @@ -298,7 +313,7 @@ free(oops); } } - prevlevel = linelevel[i]; + prevlevel = lines_info[i].level; i++; if (oopsstart > 0 && i-oopsstart > 50) { oopsstart = -1; @@ -319,15 +334,15 @@ oopsend = i-1; len = 2; - while (oopsend > 0 && linepointer[oopsend] == NULL) + while (oopsend > 0 && lines_info[oopsend].ptr == NULL) oopsend--; for (q = oopsstart; q <= oopsend; q++) - len += strlen(linepointer[q])+1; + len += strlen(lines_info[q].ptr)+1; oops = calloc(len, 1); for (q = oopsstart; q <= oopsend; q++) { - strcat(oops, linepointer[q]); + strcat(oops, lines_info[q].ptr); strcat(oops, "\n"); } /* too short oopses are invalid */ @@ -338,10 +353,9 @@ oopsend = linecount; free(oops); } - free(linepointer); - free(linelevel); - linepointer = NULL; - linelevel = NULL; +fail: + free(lines_info); + lines_info = NULL; } int scan_dmesg(void __unused *unused) @@ -366,7 +380,7 @@ struct stat statb; FILE *file; int ret; - size_t buflen; + size_t buflen, nread; memset(&statb, 0, sizeof(statb)); @@ -380,13 +394,13 @@ * to /var/log/messages before we read it in... we try to * deal with it by reading at most 1023 bytes extra. If there's * more than that.. any oops will be in dmesg anyway. - * Do not try to allocate an absurt amount of memory; ignore + * Do not try to allocate an absurd amount of memory; ignore * older log messages because they are unlikely to have * sufficiently recent data to be useful. 32MB is more * than enough; it's not worth looping through more log * if the log is larger than that. */ - buflen = MAX(statb.st_size+1024, 32*1024*1024); + buflen = MIN(statb.st_size+1024, 32*1024*1024); buffer = calloc(buflen, 1); assert(buffer != NULL); @@ -396,11 +410,11 @@ return; } fseek(file, -buflen, SEEK_END); - ret = fread(buffer, 1, buflen-1, file); + nread = fread(buffer, 1, buflen, file); fclose(file); - if (ret > 0) - extract_oops(buffer, buflen-1, issyslog); + if (nread > 0) + extract_oops(buffer, nread, issyslog); free(buffer); if (opted_in >= 2) submit_queue(); debian/patches/libnotify0.7.patch0000664000000000000000000000231312315364343014067 0ustar --- kerneloops-0.12+git20090217.orig/kerneloops-applet.c +++ kerneloops-0.12+git20090217/kerneloops-applet.c @@ -51,6 +51,10 @@ #include #include +#ifndef NOTIFY_CHECK_VERSION +#define NOTIFY_CHECK_VERSION(x,y,z) 0 +#endif + static DBusConnection *bus; @@ -240,8 +244,13 @@ static void got_a_message(void) /* if there's a notification active already, close it first */ close_notification(); +#if NOTIFY_CHECK_VERSION(0,7,0) + notify = notify_notification_new(summary, message, + "/usr/share/kerneloops/icon.png"); +#else notify = notify_notification_new(summary, message, "/usr/share/kerneloops/icon.png", NULL); +#endif notify_notification_set_timeout(notify, 0); notify_notification_set_urgency(notify, NOTIFY_URGENCY_CRITICAL); @@ -306,8 +315,13 @@ static void sent_an_oops(void) url_to_oops[0] = 0; +#if NOTIFY_CHECK_VERSION(0,7,0) + notify = notify_notification_new(summary, message, + "/usr/share/kerneloops/icon.png"); +#else notify = notify_notification_new(summary, message, "/usr/share/kerneloops/icon.png", NULL); +#endif notify_notification_set_timeout(notify, 5000); notify_notification_set_urgency(notify, NOTIFY_URGENCY_LOW); debian/patches/ubuntu-add-submit-pipe.patch0000664000000000000000000003662012315364343016157 0ustar Description: Add pipe submission option - Adds a config file option that allows to set another tool which will receive the report piped into stdin. Change the configuration to make apport the default. - Split off code to submit to kerneloops.org into its own binary called submit-kerneloops. - Don't scan the log-file, only look at dmesg (LP: 429000). - Don't report oopses with WARNING in them (LP: 346303). Forwarded: no Origin: vendor, ??? Bug-Ubuntu: http://bugs.launchpad.net/bugs/429000 Bug-Ubuntu: http://bugs.launchpad.net/bugs/346303 Index: kerneloops-0.12+git20090217/configfile.c =================================================================== --- kerneloops-0.12+git20090217.orig/configfile.c 2012-05-25 12:39:40.855642988 +0200 +++ kerneloops-0.12+git20090217/configfile.c 2012-05-25 12:55:53.480397910 +0200 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,7 @@ int opted_in; int allow_distro_to_pass_on; char *submit_url; +char *submit_pipe; char *log_file; @@ -84,6 +86,17 @@ if (c) submit_url = strdup(c); } + c = strstr(line, "submit-pipe "); + if (c) { + c += 12; + while (*c) { + if ( !isspace(*c) && *c != '=') + break; + c++; + } + if (*c) + submit_pipe = strdup(c); + } c = strstr(line, "log-file "); if (c) { c += 9; Index: kerneloops-0.12+git20090217/kerneloops.conf =================================================================== --- kerneloops-0.12+git20090217.orig/kerneloops.conf 2012-05-25 12:39:40.815642797 +0200 +++ kerneloops-0.12+git20090217/kerneloops.conf 2012-05-25 12:39:55.023712254 +0200 @@ -39,3 +39,10 @@ # log-file = /var/log/kern.log + +# +# Script or program to pipe oops submits to +# Comment out for no pipe submission +# + +submit-pipe = /usr/share/apport/kernel_oops Index: kerneloops-0.12+git20090217/kerneloops.h =================================================================== --- kerneloops-0.12+git20090217.orig/kerneloops.h 2012-05-25 12:39:40.875643085 +0200 +++ kerneloops-0.12+git20090217/kerneloops.h 2012-05-25 12:39:55.023712254 +0200 @@ -45,6 +45,7 @@ extern int opted_in; extern int allow_distro_to_pass_on; extern char *submit_url; +extern char *submit_pipe; extern char *log_file; extern int testmode; Index: kerneloops-0.12+git20090217/submit.c =================================================================== --- kerneloops-0.12+git20090217.orig/submit.c 2012-05-25 12:39:40.831642868 +0200 +++ kerneloops-0.12+git20090217/submit.c 2012-05-25 12:39:55.023712254 +0200 @@ -25,15 +25,16 @@ #define _BSD_SOURCE #include #include +#include #include +#include #include #include #include +#include #include -#include - #include "kerneloops.h" @@ -112,7 +113,7 @@ } -void write_detail_file(void) +static void write_detail_file(void) { int temp_fileno; FILE *tmpf; @@ -143,14 +144,75 @@ close(temp_fileno); } -void unlink_detail_file(void) +static void unlink_detail_file(void) { if (detail_filename) { unlink(detail_filename); free(detail_filename); + detail_filename = NULL; } } +static void pipe_oopses(void) +{ + struct oops *oops; + struct oops *queue; + + if (access(submit_pipe, X_OK) != 0) { + printf("Cant access %s, not submitting oopses\n", submit_pipe); + return; + } + + queue = queued_oopses; + queued_oopses = NULL; + barrier(); + oops = queue; + while (oops) { + FILE *pipe_file; + int len; + char pipe[4096]; + + if (strstr(oops->text, "WARNING:")) + return; + + if (strstr(oops->text, "NETDEV WATCHDOG:")) + return; + + len = snprintf(pipe, 4096, "%s %d", submit_pipe, oops->checksum); + if (len > 4096) { + printf("Pipe name too long, aborting\n"); + return; + } + + pipe_file = popen(pipe, "w"); + if (pipe_file) { + size_t written = 0; + int err; + char *buf = oops->text; + size_t to_write = strlen(oops->text); + + do { + written = fwrite(buf, 1, to_write, pipe_file); + if (written == to_write) + break; + buf += written; + to_write -= written; + } while (errno == EINTR); + if (written < to_write) { + perror("aborting, writing to pipe failed"); + } + + err = pclose(pipe_file); + if (err != 0) + perror("closing pipe failed"); + } else { + perror("aborting, popen failed"); + return; + } + + oops = oops->next; + } +} static void print_queue(void) { @@ -175,39 +237,97 @@ } -static void write_logfile(int count) +static void write_logfile(int count, char *result_url) { openlog("kerneloops", 0, LOG_KERN); - syslog(LOG_WARNING, "Submitted %i kernel oopses to www.kerneloops.org", count); + syslog(LOG_WARNING, "Submitted %i kernel oopses to www.kerneloops.org", + count); + if (result_url && result_url[0]) + syslog(LOG_WARNING, "kerneloops.org: oops is posted as %s", + result_url); closelog(); } -char result_url[4096]; +static char result_url[4096]; -size_t writefunction( void *ptr, size_t size, size_t nmemb, void __attribute((unused)) *stream) +int submit_oops(struct oops *oops) { - char *c, *c1, *c2; - c = malloc(size*nmemb + 1); - memset(c, 0, size*nmemb + 1); - memcpy(c, ptr, size*nmemb); - printf("received %s \n", c); - c1 = strstr(c, "201 "); - if (c1) { - c1+=4; - c2 = strchr(c1, '\n'); - if (c2) *c2 = 0; - strncpy(result_url, c1, 4095); + char *submit_prog = "kerneloops-submit"; + int in_pipe[2]; + int out_pipe[2]; + int pid; + + if (pipe(in_pipe)) { + perror("pipe"); + return 1; + } + + if (pipe(out_pipe)){ + perror("pipe"); + return 1; + } + + pid = fork(); + if (pid < 0) { + perror("fork"); + } else if (pid == 0) { + //child + close(in_pipe[1]); + close(out_pipe[0]); + dup2(in_pipe[0], 0); + dup2(out_pipe[1], 1); + if (execvp(submit_prog, NULL)) { + perror("execl"); + exit(255); + } + exit(0); + } else { + // parent + size_t written = 0; + char *buf = oops->text; + size_t to_write = strlen(oops->text); + int status; + ssize_t count; + char url[4096]; + close(in_pipe[0]); + close(out_pipe[1]); + do { + written = write(in_pipe[1], buf, to_write); + if (written == to_write) + break; + buf += written; + to_write -= written; + } while (errno == EINTR); + if (written < to_write) { + perror("aborting, writing to pipe failed"); + return 1; + } + close(in_pipe[1]); + waitpid(pid, &status, 0); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + perror("child failed"); + close(out_pipe[0]); + return 1; + } + count = read(out_pipe[0], url, 4095); + if (count < 0) { + perror("read from child"); + return 1; + } + close(out_pipe[0]); + printf("url is %s\n", url); + strncpy(result_url, url, 4095); } - return size * nmemb; + return 0; } void submit_queue(void) { - int result; struct oops *oops; struct oops *queue; int count = 0; + unlink_detail_file(); memset(result_url, 0, 4096); if (testmode) { @@ -220,53 +340,28 @@ barrier(); oops = queue; while (oops) { - CURL *handle; - struct curl_httppost *post = NULL; - struct curl_httppost *last = NULL; + int err; struct oops *next; - - handle = curl_easy_init(); - - printf("DEBUG SUBMIT URL is %s \n", submit_url); - curl_easy_setopt(handle, CURLOPT_URL, submit_url); - - /* set up the POST data */ - curl_formadd(&post, &last, - CURLFORM_COPYNAME, "oopsdata", - CURLFORM_COPYCONTENTS, oops->text, CURLFORM_END); - - if (allow_distro_to_pass_on) { - curl_formadd(&post, &last, - CURLFORM_COPYNAME, "pass_on_allowed", - CURLFORM_COPYCONTENTS, "yes", CURLFORM_END); - } - - curl_easy_setopt(handle, CURLOPT_HTTPPOST, post); - curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, writefunction); - result = curl_easy_perform(handle); - - curl_formfree(post); - curl_easy_cleanup(handle); + err = submit_oops(oops); next = oops->next; free(oops->text); free(oops); oops = next; - count++; + if (!err) + count++; } - if (count && !testmode) - write_logfile(count); - - if (count) + if (count) { + write_logfile(count, result_url); dbus_say_thanks(result_url); + } + /* * If we've reached the maximum count, we'll exit the program, * the program won't do any useful work anymore going forward. */ - if (submitted >= MAX_CHECKSUMS-1) { - unlink_detail_file(); + if (submitted >= MAX_CHECKSUMS-1) exit(EXIT_SUCCESS); - } } void clear_queue(void) @@ -284,17 +379,27 @@ free(oops); oops = next; } - write_logfile(0); + unlink_detail_file(); + write_logfile(0, NULL); } void ask_permission(void) { - if (!newoops && !pinged) + if (!newoops) return; - pinged = 0; - newoops = 0; - if (queued_oopses) { - write_detail_file(); - dbus_ask_permission(detail_filename); + if (!submit_pipe) { + if (!pinged) + return; + pinged = 0; + newoops = 0; + if (queued_oopses) { + write_detail_file(); + dbus_ask_permission(detail_filename); + } + } else { + newoops = 0; + if (queued_oopses) { + pipe_oopses(); + } } } Index: kerneloops-0.12+git20090217/Makefile =================================================================== --- kerneloops-0.12+git20090217.orig/Makefile 2012-05-25 12:39:40.895643188 +0200 +++ kerneloops-0.12+git20090217/Makefile 2012-05-25 14:07:29.393399559 +0200 @@ -21,7 +21,7 @@ LDF_A := -Wl,--as-needed `pkg-config --libs libnotify gtk+-2.0 dbus-glib-1` LDF_D := -Wl,--as-needed `pkg-config --libs glib-2.0 dbus-glib-1` `curl-config --libs` -Wl,"-z relro" -Wl,"-z now" -all: kerneloops kerneloops-applet kerneloops.8.gz +all: kerneloops kerneloops-applet kerneloops-submit kerneloops.8.gz noui: kerneloops kerneloops.8.gz @@ -36,6 +36,9 @@ kerneloops-applet: kerneloops-applet.o gcc kerneloops-applet.o $(LDF_A)-o kerneloops-applet +kerneloops-submit: kerneloops-submit.o configfile.o + gcc kerneloops-submit.o configfile.o $(LDF_D) -o kerneloops-submit + kerneloops.8.gz: kerneloops.8 gzip -9 -c $< > $@ @@ -58,6 +61,10 @@ -mkdir -p $(DESTDIR)$(SBINDIR) install -m 0755 kerneloops $(DESTDIR)$(SBINDIR)/ +install-kerneloops-submit: kerneloops-submit + -mkdir -p $(DESTDIR)$(BINDIR) + install -m 0755 kerneloops-submit $(DESTDIR)$(BINDIR)/ + install-applet: kerneloops-applet -mkdir -p $(DESTDIR)$(BINDIR) -mkdir -p $(DESTDIR)/etc/xdg/autostart @@ -66,9 +73,9 @@ desktop-file-install --mode 0644 --dir=$(DESTDIR)/etc/xdg/autostart/ kerneloops-applet.desktop install -m 0644 icon.png $(DESTDIR)/usr/share/kerneloops/icon.png -install: install-system install-kerneloops install-applet +install: install-system install-kerneloops install-applet install-kerneloops-submit -install-noui: install-system install-kerneloops +install-noui: install-system install-kerneloops install-kerneloops-submit # This is for translators. To update your po with new strings, do : Index: kerneloops-0.12+git20090217/kerneloops-submit.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ kerneloops-0.12+git20090217/kerneloops-submit.c 2012-05-25 13:44:52.798767502 +0200 @@ -0,0 +1,120 @@ +/* + * Copyright 2007, Intel Corporation + * + * This file is part of kerneloops.org + * + * This program file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * 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 General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program in a file named COPYING; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * Authors: + * Arjan van de Ven + * James Westby + */ + +#include +#include +#include +#include +#include +#include + +#include "kerneloops.h" + + +static char result_url[4096]; + +static void write_logfile(char *result_url) +{ + openlog("kerneloops-submit", 0, LOG_KERN); + syslog(LOG_WARNING, "Submitted 1 kernel oopses to www.kerneloops.org"); + syslog(LOG_WARNING, "kerneloops.org: oops is posted as %s", result_url); + closelog(); +} + +static size_t writefunction( void *ptr, size_t size, size_t nmemb, void __attribute((unused)) *stream) +{ + char *c, *c1, *c2; + c = malloc(size*nmemb + 1); + memset(c, 0, size*nmemb + 1); + memcpy(c, ptr, size*nmemb); + c1 = strstr(c, "201 "); + if (c1) { + c1+=4; + c2 = strchr(c1, '\n'); + if (c2) *c2 = 0; + strncpy(result_url, c1, 4095); + } + return size * nmemb; +} + +void submit_oops(char *text) +{ + int result; + CURL *handle; + struct curl_httppost *post = NULL; + struct curl_httppost *last = NULL; + + handle = curl_easy_init(); + + curl_easy_setopt(handle, CURLOPT_URL, submit_url); + + /* set up the POST data */ + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "oopsdata", + CURLFORM_COPYCONTENTS, text, CURLFORM_END); + + if (allow_distro_to_pass_on) { + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "pass_on_allowed", + CURLFORM_COPYCONTENTS, "yes", CURLFORM_END); + } + + curl_easy_setopt(handle, CURLOPT_HTTPPOST, post); + curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, writefunction); + result = curl_easy_perform(handle); + + if (result_url[0]) { + write_logfile(result_url); + printf("%s\n", result_url); + } + + curl_formfree(post); + curl_easy_cleanup(handle); +} + +int main(int __unused argc, char __unused **argv) +{ + char text[10000]; + size_t resp; + char *buf = text; + size_t to_read = 10000; + + while (!feof(stdin) && !ferror(stdin)) { + resp = fread(buf, 1, to_read, stdin); + buf = buf + resp; + to_read = to_read - resp; + } + + if (ferror(stdin)) { + write_logfile("ferror(stdin)\n"); + return 1; + } + + read_config_file("/etc/kerneloops.conf"); + + submit_oops(text); + + return 0; +} Index: kerneloops-0.12+git20090217/kerneloops.c =================================================================== --- kerneloops-0.12+git20090217.orig/kerneloops.c 2012-05-25 12:39:40.911643266 +0200 +++ kerneloops-0.12+git20090217/kerneloops.c 2012-05-25 12:39:55.023712254 +0200 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,6 @@ dbus_message_append_args (message, DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID); dbus_connection_send(bus, message, NULL); dbus_message_unref(message); - syslog(LOG_WARNING, "kerneloops.org: oops is posted as %s", url); } message = dbus_message_new_signal("/org/kerneloops/submit/sent", @@ -185,12 +185,13 @@ dbus_connection_add_filter(bus, got_message, NULL, NULL); } - /* we scan dmesg before /var/log/messages; dmesg is a more accurate source normally */ - scan_dmesg(NULL); /* during boot... don't go too fast and slow the system down */ if (!testmode) sleep(10); - scan_filename(log_file, 1); + /* we scan dmesg before /var/log/messages; dmesg is a more accurate source normally */ + scan_dmesg(NULL); + /* Can cause an OOPS to be reported multiple times LP: #429000 */ + /* scan_filename(log_file, 1); */ if (argc > 2 && strstr(argv[1], "--file")) scan_filename(argv[2], 1); debian/patches/l10n_de.patch0000664000000000000000000000515012315364343013067 0ustar --- /dev/null +++ b/po/de.po @@ -0,0 +1,77 @@ +# translation of kerneloops to German +# Copyright (C) Chris Leick , 2009. +# This file is distributed under the same license as the kerneloops package. +# Chris Leick , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: kerneloops-0.10.2\n" +"Report-Msgid-Bugs-To: willy@debian.org\n" +"POT-Creation-Date: 2009-02-22 11:49+0100\n" +"PO-Revision-Date: 2009-03-16 13:05+0100\n" +"Last-Translator: Chris Leick \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: kerneloops-applet.c:170 kerneloops-applet.c:212 +msgid "Always" +msgstr "Immer" + +#: kerneloops-applet.c:332 +#, c-format +msgid "Connecting to system bus failed: %s\n" +msgstr "Verbinden zum System-Bus fehlgeschlagen: %s\n" + +#: kerneloops-applet.c:190 +msgid "" +"Diagnostic information from your Linux kernel has been sent to www.kerneloops.org for the Linux kernel " +"developers to work on. \n" +"Thank you for contributing to improve the quality of the Linux kernel.\n" +msgstr "" +"Diagnose-Information von Ihrem Linux-Kernel wurde an www.kerneloops.org gesandt, damit die " +"Kernel-Entwickler daran arbeiten können.\n" +"Vielen Dank, dass Sie zur Verbesserung des Linux-Kernels beitragen.\n" + +#: kerneloops-applet.c:188 +msgid "Kernel bug diagnostic information sent" +msgstr "Gesendete Kernel-Fehler-Diagnose-Information" + +#: kerneloops-applet.c:176 +msgid "Never" +msgstr "Niemals" + +#: kerneloops-applet.c:214 +msgid "Never again" +msgstr "Niemals wieder" + +#: kerneloops-applet.c:174 +msgid "No" +msgstr "Nein" + +#: kerneloops-applet.c:143 +msgid "" +"There is diagnostic information available for this failure. Do you want to " +"submit this information to the www." +"kerneloops.org website for use by the Linux kernel developers?\n" +msgstr "" +"Es sind dort Diagnose-Informationen für diesen Ausfall verfügbar. Möchten " +"Sie diese Information zu der www." +"kerneloops.org-Website für die Benutzung durch die " +"Linux-Kernel-Entwickler senden?\n" + +#: kerneloops-applet.c:172 +msgid "Yes" +msgstr "Ja" + +#: kerneloops-applet.c:141 +msgid "Your system had a kernel failure" +msgstr "Ihr System hatte einen Kernel-Ausfall" + +#: kerneloops-applet.c:343 +msgid "kerneloops client" +msgstr "kerneloops-Client" debian/patches/ubuntu-kernoops-user.patch0000664000000000000000000000132112315364343015775 0ustar Description: Change dbus configuration policy Set kernoops user as the owner for submitting oopses. Forwarded: no Origin: vendor, ??? Index: kerneloops-0.12+git20090217/kerneloops.dbus =================================================================== --- kerneloops-0.12+git20090217.orig/kerneloops.dbus 2009-04-23 16:30:11.000000000 +0200 +++ kerneloops-0.12+git20090217/kerneloops.dbus 2012-05-25 10:18:32.842244981 +0200 @@ -7,7 +7,7 @@ - + debian/patches/link_against_dbus-glib.patch0000664000000000000000000000174112315364343016242 0ustar --- kerneloops-0.12+git20090217.orig/Makefile +++ kerneloops-0.12+git20090217/Makefile @@ -12,13 +12,13 @@ CC?=gcc CFLAGS := -O2 -g -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -W -Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wformat -Wformat-security -Werror=format-security -MY_CFLAGS := `pkg-config --cflags libnotify gtk+-2.0` +MY_CFLAGS := `pkg-config --cflags libnotify gtk+-2.0 dbus-glib-1` # # pkg-config tends to make programs pull in a ton of libraries, not all # are needed. -Wl,--as-needed tells the linker to just drop unused ones, # and that makes the applet load faster and use less memory. # -LDF_A := -Wl,--as-needed `pkg-config --libs libnotify gtk+-2.0` +LDF_A := -Wl,--as-needed `pkg-config --libs libnotify gtk+-2.0 dbus-glib-1` LDF_D := -Wl,--as-needed `pkg-config --libs glib-2.0 dbus-glib-1` `curl-config --libs` -Wl,"-z relro" -Wl,"-z now" all: kerneloops kerneloops-applet kerneloops.8.gz debian/patches/add_missing_include.patch0000664000000000000000000000034012315364343015625 0ustar --- kerneloops-0.12+git20090217.orig/configfile.c +++ kerneloops-0.12+git20090217/configfile.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "kerneloops.h" debian/patches/ubuntu-ignore-newline.patch0000664000000000000000000000125712315364343016113 0ustar Description: Ensure that newline is stripped off Explicitely removes any trailing newlines from all lines read from the configuration file. Forwarded: no Origin: vendor, ??? Bugs-Ubuntu: http://bugs.launchpad.net/bugs/344813 Index: kerneloops-0.12+git20090217/configfile.c =================================================================== --- kerneloops-0.12+git20090217.orig/configfile.c 2012-05-25 09:19:18.000000000 +0200 +++ kerneloops-0.12+git20090217/configfile.c 2012-05-25 10:41:08.632873101 +0200 @@ -60,6 +60,9 @@ free(line); continue; } + c = strchr(line, '\n'); + if (c != NULL) + *c = '\0'; c = strstr(line, "allow-submit "); if (c) { c += 13; debian/patches/ubuntu-change-syslog-location.patch0000664000000000000000000000106612315364343017540 0ustar Description: Change location of logfile Changes the hard coded logfile into /var/log/kern.log Forwarded: no Origin: vendor, ??? Index: kerneloops-0.12+git20090217/kerneloops.conf =================================================================== --- kerneloops-0.12+git20090217.orig/kerneloops.conf 2009-04-23 16:30:11.000000000 +0200 +++ kerneloops-0.12+git20090217/kerneloops.conf 2012-05-25 10:29:22.585421414 +0200 @@ -38,4 +38,4 @@ # Path to syslog file containing full kernel logging output # -log-file = /var/log/messages +log-file = /var/log/kern.log debian/changelog0000664000000000000000000004026012317020351011036 0ustar kerneloops (0.12+git20090217-3ubuntu8) trusty; urgency=medium * source_kerneloops.py: Add missing required argument for attach_dmesg() -- Brian Murray Wed, 02 Apr 2014 07:37:37 -0700 kerneloops (0.12+git20090217-3ubuntu7) trusty; urgency=medium * Add in an apport package that captures recent kernel syslog messages and dmesg to aid in tracking down some crashes in kerneloops. -- Brian Murray Fri, 28 Mar 2014 14:26:25 -0700 kerneloops (0.12+git20090217-3ubuntu6) trusty; urgency=medium * Add ubuntu-set-poll-to-60-seconds.patch: Reduce polling to every 60 seconds (LP: #1289311). The default polling was every 10 seconds, which is a little excessive. -- Colin King Wed, 12 Mar 2014 12:33:33 +0100 kerneloops (0.12+git20090217-3ubuntu5) trusty; urgency=medium [ Colin King ] * fix memleak and add alloc null pointer checks (LP: #1287109) - memleak of buffer c in writefunction() - null pointer checks in extract_oops() and scan_dmesg() (LP: #1026251) [ Brian Murray ] * fix null pointer check in fill_lineinfo() (LP: #1026300) -- Brian Murray Wed, 05 Mar 2014 08:58:57 -0800 kerneloops (0.12+git20090217-3ubuntu4) trusty; urgency=medium * Enable kerneloops for trusty. -- Brian Murray Thu, 13 Feb 2014 14:33:45 -0800 kerneloops (0.12+git20090217-3ubuntu3) quantal; urgency=low * Disable kerneloops for quantal as it is crashing regularly. See further Launchpad bugs 1026300 and 1026251. -- Brian Murray Fri, 20 Jul 2012 09:35:30 -0700 kerneloops (0.12+git20090217-3ubuntu2) quantal; urgency=low * Enable kerneloops for quantal. -- Brian Murray Tue, 17 Jul 2012 14:13:22 -0700 kerneloops (0.12+git20090217-3ubuntu1) quantal; urgency=low * Daemon is disabled by default as the kerneloops.org web-site is down. * Merge from Debian unstable. (LP: #1006299) Remaining changes: - ubuntu-adapt-dmesg.patch - Avoid bug 422536's WARNING as it isn't a WARN(). - Avoid another way that edac complains loudly. (LP: 525792) - ubuntu-add-submit-pipe.patch - Add a "submit-pipe" configuration option for passing the oops to another tool. Set it to pipe to apport for Ubuntu. - Add kerneloops-submit which will allow apport to submit an oops. - submit.c: do not report OOPSes with WARNING in them (LP: 346303) - Don't scan the log file, just rely on dmesg for now to avoid a flood of duplicate reports. Thanks Matt Zimmerman. (LP: 429000) - ubuntu-change-syslog-location.patch - Change log-file option to point to /var/log/kern.log instead of /var/log/messages. - ubuntu-ignore-newline.patch - Ensure that the newline is not included in the value when parsing string values (LP: 344813) - Create a kernoops system user and run the daemon as that, using start-stop-daemon. (Running in the adm group ensures it can read the logs). - Add postinst/postrm to add/remove the user. - Depend on adduser. - Tweak the dbus conf so that the new user can own the dbus names (ubuntu-kernoops-user.patch). - Don't stop the daemon in runlevels 0 or 6 as sendsigs can quite happily kill it for us. - Add apport to Recommends as it will be needed to report any oopses now if you don't edit the configuration file. -- Stefan Bader Tue, 12 Jun 2012 15:05:45 +0200 kerneloops (0.12+git20090217-3) unstable; urgency=low * QA upload. * Add missing build dependency on libdbus-glib-1-dev (Closes: #669456) -- Michael Biebl Thu, 19 Apr 2012 22:06:26 +0200 kerneloops (0.12+git20090217-2) unstable; urgency=low * QA upload. * Orphan the package with QA Team approval * Split package into applet and daemon packages (Closes: #476328) * debian/control: - Add ${misc:Depends} to Depends - Bump debhelper compatibitily to 8 - Bump Standards-Version to 3.9.2 - Add lsb-base Dependency - Set arch:linux-any as this software is only relevant with Linux kernel - Add Homepage field - Add Vcs- fields * debian/rules: - Switch to dh sequence * Switch to dpkg-source 3.0 (quilt) format and split up existing patches * debian/copyright: Add Copyright statements * debian/kerneloops.init: - Use our own version of the init file instead of upstream one - Use LSB function for logging (Closes: #477418) - Source /etc/default/kerneloops instead of /etc/sysconfig/kerneloops (Closes: #588493) - Exit immediately if the package is not installed (Closes: #496253, 540684) * Add debian/gbp.conf file * debian/patches/l10n_da.patch: Add Danish translation (Closes: #610098) * debian/patches/l10n_de.patch: Add German translation (Closes: #624658) -- Laurent Bigonville Thu, 01 Dec 2011 17:37:21 +0100 kerneloops (0.12+git20090217-1.1) unstable; urgency=low * Non-maintainer upload * Fix compatibility with libnotify 0.7 API (closes: #636297) * Add now missing dependencies on libgtk2.0-dev * Add dbus-glib-1 to pkg-config calls in Makefile -- Jérémy Bobbio Fri, 05 Aug 2011 18:53:41 +0200 kerneloops (0.12+git20090217-1ubuntu19) precise; urgency=low * Disable kerneloops for final release. -- Martin Pitt Tue, 17 Apr 2012 18:09:39 +0200 kerneloops (0.12+git20090217-1ubuntu18) precise; urgency=low * Enable kerneloops for precise. -- Brian Murray Fri, 13 Jan 2012 03:55:50 -0800 kerneloops (0.12+git20090217-1ubuntu17) precise; urgency=low * Disable kerneloops, while kerneloops.org is offline. -- Martin Pitt Thu, 24 Nov 2011 11:06:44 +0100 kerneloops (0.12+git20090217-1ubuntu16) precise; urgency=low * Re-enable kerneloops for precise. -- Martin Pitt Mon, 17 Oct 2011 08:03:20 +0200 kerneloops (0.12+git20090217-1ubuntu15) oneiric; urgency=low * Disable kerneloops for final release. -- Brian Murray Mon, 19 Sep 2011 10:05:14 -0700 kerneloops (0.12+git20090217-1ubuntu14) oneiric; urgency=low * submit.c: do not report OOPSes with NETDEV WATCHDOG in them -- Brian Murray Tue, 09 Aug 2011 09:23:35 -0700 kerneloops (0.12+git20090217-1ubuntu13) oneiric; urgency=low * debian/kerneloops.default: set kerneloops default permissions to 0644 (LP: #811419) -- Brian Murray Mon, 18 Jul 2011 14:40:32 -0700 kerneloops (0.12+git20090217-1ubuntu12) oneiric; urgency=low [ Brian Murray ] * submit.c: do not report OOPSes with WARNING in them (LP: #346303) * debian/kerneloops.default: re-enable kerneloops for oneiric, now that apport is enabled. * kerneloops-applet.c: modify number of arguments for notify_notification_new [ Kees Cook ] * debian/control: add libgtk2.0-dev and libdbus-glib-1-dev to Build Depends. * Makefile: add dbus to pkg-config calls. -- Brian Murray Wed, 13 Jul 2011 12:38:39 -0700 kerneloops (0.12+git20090217-1ubuntu11) natty; urgency=low * Disable kerneloops for final release. -- Brian Murray Thu, 14 Apr 2011 14:35:26 -0700 kerneloops (0.12+git20090217-1ubuntu10) natty; urgency=low * Re-enable kerneloops for natty, now that Apport is enabled again. -- Brian Murray Thu, 03 Mar 2011 13:22:44 -0800 kerneloops (0.12+git20090217-1ubuntu9) maverick; urgency=low * Disable kerneloops for final release. -- Martin Pitt Tue, 28 Sep 2010 09:34:47 +0200 kerneloops (0.12+git20090217-1ubuntu8) maverick; urgency=low * Re-enable kerneloops for maverick. -- James Westby Fri, 04 Jun 2010 13:57:14 -0400 kerneloops (0.12+git20090217-1ubuntu7) lucid; urgency=low * debian/kerneloops.default: Disable kerneloops for the final release. -- Martin Pitt Mon, 19 Apr 2010 10:35:48 +0200 kerneloops (0.12+git20090217-1ubuntu6) lucid; urgency=low * Avoid another way that edac complains loudly. (LP: #525792) -- James Westby Mon, 22 Feb 2010 19:48:37 +0000 kerneloops (0.12+git20090217-1ubuntu5) lucid; urgency=low * Avoid bug 422536's WARNING as it isn't a WARN(). * Re-enable kerneloops by default. * Call update-rc.d with arguments that mean the link isn't installed for rc0 or rc6, matching the headers. (LP: #452000) * Install the autostart file in the correct place (LP: #440301) -- James Westby Tue, 16 Feb 2010 17:27:25 +0000 kerneloops (0.12+git20090217-1ubuntu4.1) karmic-proposed; urgency=low * Don't start kerneloops on boot in stable releases, for the same reasons that we disable appport. (LP: #471137) -- James Westby Mon, 02 Nov 2009 15:13:28 +0000 kerneloops (0.12+git20090217-1ubuntu4) karmic; urgency=low * Install the autostart file so that if the user installs kerneloops-applet it will at least start, leaving them to just choose in the config file whether to use it. * Also add "Replaces kerneloops" on the kerneloops-applet package as files moved there too. -- James Westby Thu, 24 Sep 2009 12:02:35 +0100 kerneloops (0.12+git20090217-1ubuntu3) karmic; urgency=low * Install kerneloops.conf in the kerneloops-daemon package. Thanks Matt Zimmerman. (LP: #428891) * Don't scan the log file, just rely on dmesg for now to avoid a flood of duplicate reports. Thanks Matt Zimmerman. (LP: #429000) -- James Westby Mon, 14 Sep 2009 16:16:49 +0100 kerneloops (0.12+git20090217-1ubuntu2) karmic; urgency=low * Move submit-pipe to be before asking, and still use apport for Ubuntu. This puts apport in control of prompting the user. * Add apport to Recommends as it will be needed to report any oopses now if you don't edit the configuration file. * Add kerneloops-submit which will allow apport to submit an oops. * Split kerneloops-applet and kerneloops-daemon package. This means that servers can just install the daemon without gtk, and we don't have to install the applet by default now that we will use apport to do the prompting. Thanks Tim Abbott. (LP: #337757) (-daemon isn't really needed at this stage, but that is the way Debian plan to go, so we use that to avoid clashes) * Don't try and start the daemon if it isn't there. Thanks again to Tim Abbott. -- James Westby Tue, 25 Aug 2009 15:07:01 +0100 kerneloops (0.12+git20090217-1ubuntu1) karmic; urgency=low * Merge from Debian, remaining changes: - Add a "submit-pipe" configuration option for passing the oops to another tool. Set it to pipe to apport for Ubuntu. - Ensure that the newline is not included in the value when parsing string values (LP: #344813) - Add Homepage field. - Create a kernoops system user and run the daemon as that, using start-stop-daemon. (Running in the adm group ensures it can read the logs). - Add postinst/postrm to add/remove the user. - Depend on adduser. - Tweak the dbus conf so that the new user can own the dbus names. - Append -O0 to CFLAGS when building in debug mode honoring noopt DEB_BUILD_OPTIONS. - Honor nocheck in DEB_BUILD_OPTIONS. - Change log-file option to point to /var/log/kern.log instead of /var/log/messages. - Debianise the default location. - If the notification daemon doesn't support actions then use a dialog instead. * Remove debian/applied-patches as updating them is too much headache. * Remove Vcs URIs as they don't point to the one used for packaging. * The Makefile now deletes the test/*.dbg files, so debian/rules doesn't have to. * Don't stop the daemon in runlevels 0 or 6 as sendsigs can quite happily kill it for us. -- James Westby Thu, 11 Jun 2009 13:15:41 +0100 kerneloops (0.12+git20090217-1) unstable; urgency=low * New upstream version (closes: #512174) - Fixes log parsing (closes: #487796) - Tells the user what is being sent (closes: #510026) * Changed init script to start in runlevel 2 (closes: #484493) * Include patch from Cyril Brulebois to report status (closes: #509022) * Add watch file (closes: #506346) * Add German translation (closes: #522412) -- Matthew Wilcox Thu, 23 Apr 2009 11:14:24 -0400 kerneloops (0.12-0ubuntu5) jaunty; urgency=low * debian/applied-patches/kerneloops-applet.c.patch: Updated patch to include a fix for box packing so expander fills and expands submitted by Cody Russell. (LP: #344377) -- Ken VanDine Wed, 25 Mar 2009 15:27:17 -0400 kerneloops (0.12-0ubuntu4) jaunty; urgency=low [ Ken VanDine ] * debian/applied-patches/kerneloops-applet.c.patch: Convert notification to a dialog. Applied inline, since package has no patch system. (LP: #344377) * debian/rules: Remove test/*dbg, these should be cleaned by the Makefile * debian/applied-patches/submit.c.patch: Fix the config parser so that it will actually work with apport. Thanks to Matt Zimmerman for the patch! (LP: #344813) [ Martin Pitt ] * Moved *.patch to debian/applied-patches/, to be a little less confusing. -- Ken VanDine Thu, 19 Mar 2009 08:48:36 -0400 kerneloops (0.12-0ubuntu3) jaunty; urgency=low * debian/{postinst,postrm}: create/remove kernoops system user. * kerneloops.init: - Debianify defaults location. - use start-stop-daemon to handle daemon init, including running as non-root user with log-readable permissions (group "adm"). * configfile.c, kerneloops.{c,h}, kerneloops.conf: - create "log-file" config setting, populate to /var/log/kern.log. * kerneloops.dbus: switch to "kernoops" user instead of "root". * debian/control: - add "adduser" as Depend now that there is a system user. - document Vcs URIs. - add Homepage URL. - update standards version (no changes needed). -- Kees Cook Tue, 17 Feb 2009 14:43:23 -0800 kerneloops (0.12-0ubuntu2) jaunty; urgency=low * configfile.c:read_configfile(): Properly dereference "*c" configfile parsing char* when checking chars. * Append -O0 to CFLAGS when building in debug mode honoring noopt DEB_BUILD_OPTIONS. * Honor nocheck in DEB_BUILD_OPTIONS. -- Loic Minier Tue, 03 Feb 2009 11:07:28 +0100 kerneloops (0.12-0ubuntu1) jaunty; urgency=low * New upstream release. Adapt our patches, remove Matt's hardcoded apport patch. * Apply Jim Lieb's support for a "submit-pipe" configuration option and set it to pipe to /usr/share/apport/kernel_oops. -- Martin Pitt Mon, 02 Feb 2009 15:30:21 +0100 kerneloops (0.10-2ubuntu2) jaunty; urgency=low * kerneloops.dbus: LP: #318774. - send_path without send_destination applies to all services, since destination already allowed, this line is unnecessary. -- Scott James Remnant Tue, 09 Dec 2008 17:11:02 -0800 kerneloops (0.10-2ubuntu1) intrepid; urgency=low * Add support for dumping an apport crash report if apport (>=0.115) is installed -- Matt Zimmerman Fri, 19 Sep 2008 00:55:09 +0100 kerneloops (0.10-2) unstable; urgency=low * Fixed missing build dependency -- Matthew Wilcox Tue, 08 Apr 2008 06:44:14 -0400 kerneloops (0.10-1) unstable; urgency=low * New upstream version * Install init.d script (closes: #459433) * Depend on libcurl4-gnutls-dev | libcurl-dev in order to get the same library on all the buildds * Drop our manpage in favour of the one now provided by upstream * Run test suite as part of build -- Matthew Wilcox Wed, 09 Jan 2008 20:43:31 -0500 kerneloops (0.7-1) unstable; urgency=low * New upstream version - Fixes memory leak (closes: #458177) -- Matthew Wilcox Sat, 29 Dec 2007 13:03:23 -0500 kerneloops (0.3-1) unstable; urgency=low * New upstream version -- Matthew Wilcox Fri, 14 Dec 2007 10:47:41 -0500 kerneloops (0.1-1) unstable; urgency=low * Initial Release -- Matthew Wilcox Wed, 05 Dec 2007 17:30:10 -0500 debian/watch0000664000000000000000000000010612315364343010222 0ustar version=3 http://www.kerneloops.org/download/kerneloops-(.*)\.tar\.gz debian/source_kerneloops.py0000664000000000000000000000043312317020255013300 0ustar '''apport package hook for kerneloops (c) 2014 Canonical Ltd. Author: Brian Murray ''' from apport import hookutils import re def add_info(report): hookutils.attach_dmesg(report) report['KernelSyslog'] = hookutils.recent_syslog(re.compile(r'kernel:')) debian/compat0000664000000000000000000000000212315364343010372 0ustar 8 debian/copyright0000664000000000000000000000123012315364343011123 0ustar This package was debianised by Matthew Wilcox in December 2007. It was downloaded from http://www.kerneloops.org/ The primary upstream author is Arjan van de Ven Copyright: * Copyright (C) 2007 Intel Corporation * Copyright (C) 2005-2007 Marcel Holtmann * Copyright (C) 2006-2007 Bastien Nocera This software is supplied under the terms of the GNU General Public License version 2. The full text of the license can be found at: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html On Debian/GNU systems, this can be found as /usr/share/common-licenses/GPL-2 . debian/gbp.conf0000664000000000000000000000023312315364343010611 0ustar [DEFAULT] debian-branch = debian upstream-branch = upstream pristine-tar = True [git-buildpackage] tarball-dir = ../tarballs/ export-dir = ../build-area/ debian/control0000664000000000000000000000366312315364343010607 0ustar Source: kerneloops Build-Depends: debhelper (>= 8), libcurl4-gnutls-dev | libcurl-dev, libgtk2.0-dev, libnotify-dev, libdbus-glib-1-dev, desktop-file-utils Section: utils Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian QA Group Standards-Version: 3.9.2 Homepage: http://www.kerneloops.org/ Vcs-Git: git://anonscm.debian.org/git/collab-maint/kerneloops.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/kerneloops.git Package: kerneloops Architecture: linux-any Section: oldlibs Priority: extra Depends: kerneloops-applet, ${misc:Depends} Description: kernel oops tracker (transitional package) This is a transitional package for splitting the kerneloops package into the kerneloops-daemon package and the kerneloops-applet package. In the future, the kerneloops package will contain only the kerneloops daemon, and not the applet. If you want the kerneloops applet, you should explicitly install the kerneloops-applet package. Package: kerneloops-daemon Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.2-14), adduser Replaces: kerneloops (<< 0.12+git20090217-2) Breaks: kerneloops (<< 0.12+git20090217-2) Recommends: apport Description: kernel oops tracker kerneloops is a daemon that collects kernel crash information and then submits the extracted signature to the kerneloops.org website for statistical analysis and presentation to the Linux kernel developers. Package: kerneloops-applet Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends}, kerneloops-daemon (= ${binary:Version}) Replaces: kerneloops (<< 0.12+git20090217-2) Breaks: kerneloops (<< 0.12+git20090217-2) Description: applet for the kernel oops tracker The kerneloops applet allows the kerneloops crash reporting utility to ask a desktop user for permission before submitting an oops report to the kerneloops.org website. debian/source/0000775000000000000000000000000012315364343010474 5ustar debian/source/format0000664000000000000000000000001412315364343011702 0ustar 3.0 (quilt) debian/kerneloops-daemon.install0000664000000000000000000000026512317020166014203 0ustar etc/kerneloops.conf etc/dbus-1/system.d/kerneloops.dbus usr/sbin/kerneloops usr/bin/kerneloops-submit usr/share/man/man8/ debian/source_kerneloops.py usr/share/apport/package-hooks debian/rules0000775000000000000000000000030112315364343010246 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ override_dh_installinit: dh_installinit -pkerneloops-daemon --name=kerneloops debian/kerneloops-applet.install0000664000000000000000000000012512315364343014226 0ustar etc/xdg/autostart/ usr/bin/kerneloops-applet usr/share/kerneloops/ usr/share/locale/ debian/kerneloops-daemon.kerneloops.init0000775000000000000000000000603012315364343015665 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: kerneloops # Required-Start: $remote_fs $named $network $time $syslog # Required-Stop: $remote_fs $named $network $time $syslog # Default-Start: 2 3 4 5 # Default-Stop: 1 # Short-Description: Tool to automatically collect and submit kernel crash signatures # Description: A tool that collects and submits kernel crash # signatures to the kerneloops.org website for use by the Linux # kernel developers. ### END INIT INFO # Author: Laurent Bigonville # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Kernel Oops catching service" NAME=kerneloops DAEMON=/usr/sbin/$NAME PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME ENABLED=1 # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME [ "$ENABLED" = "1" ] || exit 0 # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present # and status_of_proc is working. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --chuid kernoops:adm \ --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --chuid kernoops:adm \ --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \ || return 2 pidofproc $DAEMON > $PIDFILE } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : debian/kerneloops-daemon.postinst0000664000000000000000000000232412315364343014424 0ustar #!/bin/sh # postinst script for kerneloops # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) # add the system user NEED=kernoops if ! getent passwd $NEED >/dev/null; then adduser --quiet --system --disabled-password \ --gecos "Kernel Oops Tracking Daemon" \ --home / --no-create-home $NEED fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/kerneloops-daemon.postrm0000664000000000000000000000175712315364343014076 0ustar #!/bin/sh # postrm script for kerneloops # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge) deluser --quiet --system kernoops >/dev/null || true ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0