Skip to content

树莓派 改开机Logo 隐藏开机日志 #1

@Temptationx

Description

@Temptationx
Owner

网上关于隐藏开机日志的教程多是基于Wheezy 的,但是在Jessie下不能全部隐藏。经过尝试后终于找到完全隐藏的方法。

一、隐藏开机自检彩虹画面

sudo nano /boot/config.txt
在最后加上 disable_splash=1

二、隐藏开机日志

sudo nano /boot/cmdline.txt
在最后加上
logo.nologo loglevel=0 quiet splash fsck.mode=skip vt.global_cursor_default=0
sudo systemctl mask getty@tty1.service

三、显示Logo
sudo apt-get install plymouth plymouth-themes
sudo apt-get install pix-plym-splash
cd /usr/share/plymouth/themes/
mkdir mytheme & cd mytheme
sudo nano mytheme.plymouth

输入一下内容:

[Plymouth Theme]
Name=MyTheme
Description=MyTheme
ModuleName=script

[script]
ImageDir=/usr/share/plymouth/themes/mytheme
ScriptFile=/usr/share/plymouth/themes/mytheme/mytheme.script

然后:
sudo nano mytheme.script

输入一下内容:

flower_image = Image("icon.png");

screen_ratio = Window.GetHeight() / Window.GetWidth();
flower_image_ratio = flower_image.GetHeight() / flower_image.GetWidth();

if (screen_ratio > flower_image_ratio)
  {  # Screen ratio is taller than image ratio, we will match the screen height
     scale_factor =  Window.GetHeight() / flower_image.GetHeight();
  }
else
  {  # Screen ratio is wider than image ratio, we will match the screen width
     scale_factor =  Window.GetWidth() / flower_image.GetWidth();
  }

scaled_flower_image = flower_image.Scale(flower_image.GetWidth()  * scale_factor*256/1920,
                                         flower_image.GetHeight() * scale_factor*256/2100);
flower_sprite = Sprite(scaled_flower_image); # Create the a sprite using the scaled image

flower_sprite.SetX(Window.GetWidth()  / 2 - scaled_flower_image.GetWidth () / 2); # Place in the centre
flower_sprite.SetY(Window.GetHeight() / 2 - scaled_flower_image.GetHeight() / 2);
flower_sprite.SetZ(-10000); # Place right at the back

主题制作好后:
sudo plymouth-set-default-theme mytheme

https://raspberrypi.stackexchange.com/questions/36657/hide-complete-boot-message-from-rpi-booting
https://unix.stackexchange.com/questions/56531/how-to-get-fewer-ttys-with-systemd
https://github.com/HerbFargus/Raspberry-Pi-Scripts/wiki/Plymouth
https://github.com/notro/fbtft/wiki/Bootsplash

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Temptationx

        Issue actions

          树莓派 改开机Logo 隐藏开机日志 · Issue #1 · Temptationx/deathsilence.github.com