Linux 内核启动 Logo 居中显示

Linux 内核启动 Logo 居中显示需要修改下列两个源文件:
1. drivers/video/console/fbcon.c

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 10c0b74..cdb3b6c 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -589,6 +589,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
        if (fb_get_color_depth(&info->var, &info->fix) == 1)
                erase &= ~0x400;
        logo_height = fb_prepare_logo(info, ops->rotate);
+       logo_height += (info->var.yres - 110) / 2;
        logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height);
        q = (unsigned short *) (vc->vc_origin +
                                vc->vc_size_row * rows);

2. drivers/video/fbmem.c

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index b066475..c8e7fc0 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -468,8 +468,8 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
                fb_set_logo(info, logo, logo_new, fb_logo.depth);
        }
 
-       image.dx = 0;
-       image.dy = y;
+       image.dx = (info->var.xres - 400) / 2;
+       image.dy = (info->var.yres - 110) / 2 - 70;
        image.width = logo->width;
        image.height = logo->height;

Over!

4 thoughts on “Linux 内核启动 Logo 居中显示”

Leave a Reply

Your email address will not be published. Required fields are marked *