From e0d006cd8e186d28ce11d20a9ab6f8462de882fe Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Mon, 30 Mar 2015 13:11:40 +0200 Subject: [PATCH] installer: add option to disable grafic mode for grub. add novga to kernel commandline for the installer to add GFXMODE="none" to /etc/default/grub. --- config/syslinux/syslinux.cfg | 1 + src/installer/main.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/config/syslinux/syslinux.cfg b/config/syslinux/syslinux.cfg index cfb8113cf6..39521675da 100644 --- a/config/syslinux/syslinux.cfg +++ b/config/syslinux/syslinux.cfg @@ -50,6 +50,7 @@ Run the installer in text mode. ENDTEXT KERNEL vmlinuz INITRD instroot + APPEND novga LABEL unattended MENU LABEL Unattended installation diff --git a/src/installer/main.c b/src/installer/main.c index 75c8c5ae0b..c420de3a18 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -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.")); -- 2.39.5