- fprintf(f, "enigma2 crashed on %s", ctime(&t));
-#ifdef ENIGMA2_CHECKOUT_TAG
- fprintf(f, "enigma2 CVS TAG: " ENIGMA2_CHECKOUT_TAG "\n");
-#else
- fprintf(f, "enigma2 compiled on " __DATE__ "\n");
-#endif
-#ifdef ENIGMA2_CHECKOUT_ROOT
- fprintf(f, "enigma2 checked out from " ENIGMA2_CHECKOUT_ROOT "\n");
-#endif
- fprintf(f, "please email this file to " CRASH_EMAILADDR "\n");
- std::string buffer = getLogBuffer();
- fwrite(buffer.c_str(), buffer.size(), 1, f);
+ struct tm tm;
+ char tm_str[32];
+
+ localtime_r(&t, &tm);
+ strftime(tm_str, sizeof(tm_str), "%a %b %_d %T %Y", &tm);
+
+ XmlGenerator xml(f);
+
+ xml.open("opendreambox");
+
+ xml.open("enigma2");
+ xml.string("crashdate", tm_str);
+ xml.string("compiledate", __DATE__);
+ xml.string("contactemail", crash_emailaddr);
+ xml.comment("Please email this crashlog to above address");
+
+ xml.string("skin", getConfigString("config.skin.primary_skin", "Default Skin"));
+ xml.string("sourcedate", enigma2_date);
+ xml.string("branch", enigma2_branch);
+ xml.string("rev", enigma2_rev);
+ xml.string("version", PACKAGE_VERSION);
+ xml.close();
+
+ xml.open("image");
+ xml.stringFromFile("dreamboxmodel", "/proc/stb/info/model");
+ xml.stringFromFile("kernelcmdline", "/proc/cmdline");
+ xml.stringFromFile("nimsockets", "/proc/bus/nim_sockets");
+ if (!getConfigBool("config.plugins.crashlogautosubmit.sendAnonCrashlog", true)) {
+ xml.cDataFromFile("dreamboxca", "/proc/stb/info/ca");
+ xml.cDataFromFile("enigma2settings", eEnv::resolve("${sysconfdir}/enigma2/settings"), ".password=");
+ }
+ if (getConfigBool("config.plugins.crashlogautosubmit.addNetwork", false)) {
+ xml.cDataFromFile("networkinterfaces", "/etc/network/interfaces");
+ xml.cDataFromFile("dns", "/etc/resolv.conf");
+ xml.cDataFromFile("defaultgateway", "/etc/default_gw");
+ }
+ if (getConfigBool("config.plugins.crashlogautosubmit.addWlan", false))
+ xml.cDataFromFile("wpasupplicant", "/etc/wpa_supplicant.conf");
+ xml.cDataFromFile("imageversion", "/etc/image-version");
+ xml.cDataFromFile("imageissue", "/etc/issue.net");
+ xml.close();
+
+ xml.open("software");
+ xml.cDataFromCmd("enigma2software", "opkg list_installed | grep enigma2");
+ xml.cDataFromCmd("dreamboxsoftware", "opkg list_installed | grep dream");
+ xml.cDataFromCmd("gstreamersoftware", "opkg list_installed | grep gst");
+ xml.close();
+
+ xml.open("crashlogs");
+ xml.cDataFromString("enigma2crashlog", getLogBuffer());
+ xml.cDataFromCmd("pythonMD5sum", "find " + eEnv::resolve("${libdir}/enigma2/python/") + " -name \"*.py\" | xargs md5sum");
+ xml.close();
+
+ xml.close();
+