BaReinhard's Tech Blog

A blog of various technologies, largely based around the Raspberry Pi.

Follow me on GitHub Follow me on Instagram

Faster Boot Times for Headless Raspberry Pi

Hello Folks, Today we will be editing our /boot/cmdline.txt for the goal of speeding up our boot time.

$ sudo nano /boot/cmdline.txt

We will change the content to :

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty3 loglevel=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait logo.nologo quiet splash vt.global_cuursor_default=0

The important bits are as follows:

loglevel=0
quiet
splash
logo.nologo
console=tty3
vt.global_cuursor_default=0

Please make sure that all these are seperated with a space and all placed on a single line.

Additional work can be used to quicken things up: We need to tell dmesg to be quiet

sudo nano /etc/rc.local

add dmesg --console-off just above exit 0

Change the auto login in systemd, hides login message:

sudo nano /etc/systemd/system/autologin\@.service

Find the line:

ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM

and change it to the following:

ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM

Next we will remove the kernel version from showing when you auto-login

sudo nano /etc/pam.d/login

Find the line:

session    optional   pam_exec.so type=open_session stdout /bin/uname -snrvm

then change it to the following:

session    optional   pam_exec.so type=open_session stdout

Now we will a .hushlogin

touch ~/.hushlogin

or we can remove the message of the day aka MOTD. This is an alternative to touch ~/.hushlogin

sudo update-rc.d motd remove

And with that we are finished!

This is great for a headless display as we dont need to see any of that text anyway. This is also great to use if you are running a python GUI on boot. This will login and then display your GUI once fully booted.

If you have any questions or concerns feel free to leave a comment.

Thanks for reading! -Brett