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.
This commit is contained in:
Arne Fitzenreiter
2015-03-30 13:11:40 +02:00
parent 0a565414dd
commit e0d006cd8e
2 changed files with 20 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ Run the installer in text mode.
ENDTEXT
KERNEL vmlinuz
INITRD instroot
APPEND novga
LABEL unattended
MENU LABEL Unattended installation

View 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."));