]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/installer/main.c
installer: use sysinfo() for memory detection
[ipfire-2.x.git] / src / installer / main.c
index 88b3735cc8354663cf1e3cd1194982ff84e71dd3..1f7ec2b4ba8f6d3cc5a85fd2ad264d3a6c816f18 100644 (file)
@@ -238,7 +238,7 @@ int main(int argc, char *argv[]) {
        int rc = 0;
        char commandstring[STRING_SIZE];
        int choice;
-       char shortlangname[10];
+       char language[STRING_SIZE];
        char message[STRING_SIZE];
        char title[STRING_SIZE];
        int allok = 0;
@@ -320,9 +320,10 @@ int main(int argc, char *argv[]) {
                assert(choice <= NUM_LANGS);
 
                fprintf(flog, "Selected language: %s (%s)\n", languages[choice].name, languages[choice].code);
+               snprintf(language, sizeof(language), languages[choice].code);
 
-               setenv("LANGUAGE", languages[choice].code, 1);
-               setlocale(LC_ALL, languages[choice].code);
+               setenv("LANGUAGE", language, 1);
+               setlocale(LC_ALL, language);
        }
 
        char* helpline = center_string(_("<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"), screen_cols);
@@ -493,6 +494,7 @@ int main(int argc, char *argv[]) {
        fprintf(flog, "  swap   : %s (%lluMB)\n", destination->part_swap, BYTES2MB(destination->size_swap));
        fprintf(flog, "  root   : %s (%lluMB)\n", destination->part_root, BYTES2MB(destination->size_root));
        fprintf(flog, "  data   : %s (%lluMB)\n", destination->part_data, BYTES2MB(destination->size_data));
+       fprintf(flog, "Memory   : %lluMB\n", BYTES2MB(hw_memory()));
 
        // Warn the user if there is not enough space to create a swap partition
        if (!unattended && !*destination->part_swap) {
@@ -598,7 +600,7 @@ int main(int argc, char *argv[]) {
        }
 
        /* Save language und local settings */
-       write_lang_configs(shortlangname);
+       write_lang_configs(language);
 
        /* Build cache lang file */
        snprintf(commandstring, STRING_SIZE, "/usr/sbin/chroot /harddisk /usr/bin/perl -e \"require '" CONFIG_ROOT "/lang.pl'; &Lang::BuildCacheLang\"");