]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
installer: add option to disable grafic mode for grub.
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 30 Mar 2015 11:11:40 +0000 (13:11 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 30 Mar 2015 18:28:54 +0000 (20:28 +0200)
add novga to kernel commandline for the installer to add
GFXMODE="none" to /etc/default/grub.

config/syslinux/syslinux.cfg
src/installer/main.c

index cfb8113cf6e57fc4cda28c730bd91f45b044bebe..39521675da77d42d730d9e9f8458e9f0f4ffd47f 100644 (file)
@@ -50,6 +50,7 @@ Run the installer in text mode.
                ENDTEXT
                KERNEL vmlinuz
                INITRD instroot
+               APPEND novga
 
        LABEL unattended
                MENU LABEL Unattended installation
index 75c8c5ae0b4914e3fe1013aa9f4bfff3603bfd84..c420de3a18572760fa1a1eff837213f8be276153 100644 (file)
@@ -271,6 +271,7 @@ static struct lang {
 static struct config {
        int unattended;
        int serial_console;
+       int novga;
        int require_networking;
        int perform_download;
        int disable_swap;
@@ -280,6 +281,7 @@ static struct config {
 } config = {
        .unattended = 0,
        .serial_console = 0,
+       .novga = 0,
        .require_networking = 0,
        .perform_download = 0,
        .disable_swap = 0,
@@ -309,6 +311,10 @@ static void parse_command_line(struct config* c) {
                        if ((strcmp(key, "console") == 0) && (strncmp(val, "ttyS", 4) == 0))
                                c->serial_console = 1;
 
+                       // novga
+                       else if (strcmp(key, "novga") == 0)
+                               c->novga = 1;
+
                        // enable networking?
                        else if (strcmp(token, "installer.net") == 0)
                                c->require_networking = 1;
@@ -825,6 +831,19 @@ int main(int argc, char *argv[]) {
                replace("/harddisk/etc/inittab", "#7:2345:respawn:", "7:2345:respawn:");
        }
 
+       /* novga */
+       if (config.novga) {
+               /* grub */
+               FILE* f = fopen(DESTINATION_MOUNT_PATH "/etc/default/grub", "a");
+               if (!f) {
+                       errorbox(_("Unable to open /etc/default/grub for writing."));
+                       goto EXIT;
+               }
+
+               fprintf(f, "GRUB_GFXMODE=\"none\"\n");
+               fclose(f);
+       }
+
        rc = hw_install_bootloader(destination, logfile);
        if (rc) {
                errorbox(_("Unable to install the bootloader."));