"kernel" => "busybox"
[oweals/busybox.git] / scripts / kconfig / confdata.c
index 301774f0c3ecaefcc8ba79e4cee13fcab4b4fe0a..2930446544882b87092a4672e22a2fb6c9c9081c 100644 (file)
@@ -22,7 +22,7 @@ static int conf_lineno, conf_warnings, conf_unsaved;
 
 const char conf_def_filename[] = ".config";
 
-const char conf_defname[] = "arch/$ARCH/defconfig";
+const char conf_defname[] = "scripts/defconfig";
 
 const char *conf_confnames[] = {
        ".config",
@@ -395,15 +395,24 @@ int conf_write(const char *name)
                char buf[sizeof("#define AUTOCONF_TIMESTAMP "
                                "\"YYYY-MM-DD HH:MM:SS some_timezone\"\n")];
                buf[0] = '\0';
-               if (use_timestamp)
-                       strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
-                               "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now));
+               if (use_timestamp) {
+                       size_t ret = \
+                               strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
+                                       "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now));
+                       /* if user has Factory timezone or some other odd install, the
+                        * %Z above will overflow the string leaving us with undefined
+                        * results ... so let's try again without the timezone.
+                        */
+                       if (ret == 0)
+                               strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
+                                       "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now));
+               }
                fprintf(out_h, "/*\n"
                               " * Automatically generated C config: don't edit\n"
                               " * Linux kernel version: %s\n"
                               " */\n"
                               "%s"
-                              "#define AUTOCONF_INCLUDED\n",
+                              "\n",
                               sym_get_string_value(sym),
                               buf);
        }
@@ -428,8 +437,10 @@ int conf_write(const char *name)
                                               " */\n", str);
                } else if (!(sym->flags & SYMBOL_CHOICE)) {
                        sym_calc_value(sym);
+/* bbox: we want to all syms
                        if (!(sym->flags & SYMBOL_WRITE))
                                goto next;
+*/
                        sym->flags &= ~SYMBOL_WRITE;
                        type = sym->type;
                        if (type == S_TRISTATE) {