Linux boot - Stoppen Sie den Kernel, der auf eine neue Löschausgabe für den Framebuffer-Modus umschaltet

5216
Avio

Ich arbeite an einem Embedded System (basierend auf Ubuntu 12.04 LTS) und passe seinen Kernel an. Ich habe ein Problem mit upstart, mountallund plymouth. Nichts Unlösbares, denke ich, aber das eigentliche Problem ist, dass ich nicht richtig diagnostizieren kann, was passiert, weil der Kernel (oder möglicherweise plymouth) den Videomodus während des Bootvorgangs ändert. Dadurch werden die gesamten Protokollzeilen vollständig gelöscht und das Debuggen von Fehlkonfigurationen des Kernels verhindert.

Meine Grub2Konfiguration scheint in Ordnung zu sein mit:

GRUB_CMDLINE_LINUX="" GRUB_CMDLINE_LINUX_DEFAULT="acpi=force noplymouth"  GRUB_GFXMODE=1024x768x32 GRUB_GFXPAYLOAD_LINUX=keep 

Hier ist eine relevante Ausgabe von lspci:

00:00.0 Host bridge: Intel Corporation Mobile 945GSE Express Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GSE Express Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 

Und hier ist der relevante Teil meiner Kernel-Konfiguration:

CONFIG_AGP=y CONFIG_AGP_INTEL=y CONFIG_VGA_ARB=y CONFIG_VGA_ARB_MAX_GPUS=16 CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_I915=y CONFIG_DRM_I915_KMS=y CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y CONFIG_FB_BOOT_VESA_SUPPORT=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_VESA=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_VGA_CONSOLE=y CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=640 CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y 

Jeder andere Custom / Stock-Kernel bootet gut mit dieser Grub2Konfiguration. Was ich gerne hätte, ist ein einzelner Nachrichtenfluss auf einer einzelnen Konsole (mit einer Bildschirmauflösung) vom Boot-Logo bis zur Anmeldeaufforderung. Weiß jemand, was ich tun muss, um dies zu erreichen?

2

1 Antwort auf die Frage

1
Avio

It seems that finally I've reached a reasonable framebuffer configuration. These are the relevant settings inside my kernel .config:

CONFIG_AGP=y CONFIG_AGP_INTEL=y CONFIG_VGA_ARB=y CONFIG_VGA_ARB_MAX_GPUS=16 CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y CONFIG_FIRMWARE_EDID=y CONFIG_FB_BOOT_VESA_SUPPORT=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_VESA=y CONFIG_VGA_CONSOLE=y CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=640 CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y 

and this is the diff between the old and the new framebuffer configuration:

#> diff oldcfg.txt newcfg.txt --- oldcfg.txt 2012-10-01 17:30:01.000000000 +0200 +++ newcfg.txt 2012-10-01 17:29:43.000000000 +0200 @@ -2,20 +2,14 @@ CONFIG_AGP_INTEL=y CONFIG_VGA_ARB=y CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_DRM=y -CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_I915=y -CONFIG_DRM_I915_KMS=y CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y +CONFIG_FIRMWARE_EDID=y CONFIG_FB_BOOT_VESA_SUPPORT=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_MODE_HELPERS=y CONFIG_FB_VESA=y -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_VGA_CONSOLE=y CONFIG_VGACON_SOFT_SCROLLBACK=y CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=640 

This configuration produces a Knoppix-like boot output. I still don't understand who or what clears the screen just before the login prompt appears, but I'm quite satisfied for now. I'll update this answer if I'll be able to pinpoint the culprit.

EDIT: found the (two) culpright(s).

After hours of googling, I found the solution in this thread and this question. This procedure works for Ubuntu 12.04.1 LTS as also described here, but it should not differ too much for other distributions.

First, add console=tty1 to your GRUB_CMDLINE_LINUX (I also suggest to add noplymouth to inhibit plymouth and its useless splashscreen).

#> sudo vi /etc/default/grub GRUB_CMDLINE_LINUX="console=tty1 noplymouth" 

This forces the kernel log to be printed on tty1 instead of tty7 and avoid the tty switch before the login prompt.

Then just go into /etc/init and edit one or more of tty1.conf, tty2.conf, tty3.conf, tty4.conf, tty5.conf, tty6.conf or console.conf. I edited them all adding --noclear option to the getty command. For example, editing tty1.conf:

#> sudo vi /etc/init/tty1.conf 

you'll have to replace:

respawn exec /sbin/getty -8 38400 tty1 

with:

respawn exec /sbin/getty -8 38400 --noclear tty1 

That's all, now your system should boot in a single tty without clearing it.