Howto remove getty@tty1.service from my custom build

Hello,

I have a simple question. What is a proper way of removing getty@tty1.service symbolic link from my custom yocto build? i.e. disable the service .

Kind regards,

Chris

Hi

Please have a look here.

Max

I was in a little hurry this morning so my question was not correct. I’m sorry. I actually would like to know how I prevent bitbake from including the getty@tty1.service in my custom build. i.e. what should my custom recipe look like to “remove” it from my build.

Chris

Hi

systemd seems to enable that service in its ‘make install’, e.g. when OE runs the do_install task.

You could create a bbappend to the systemd recipe which deletes the symlink at the end of do_install, e.g.:

systemd_%.bbappend:

do_install_append() {
    rm ${D}${sysconfdir}/systemd/system/getty.target.wants/getty@tty1          
}

You probably additionally need to remove the ‘console=tty1’ from the U-Boot environment’s setup variable,

e.g. by adding a patch to the U-Boot recipe or by fetching the U-Boot sources from your own git with such a patch applied.

Max

The login console is automatically enabeld by systemd depending on your kernel command line. So removing console=tty1 from boot arguments is enough to get rid of the Linux kernel console as well as login shell on the framebuffer console. In other words, using the following command in the U-Boot prompt should work:

 setenv setup 'setenv setupargs fec_mac=${ethaddr} consoleblank=0 no_console_suspend=1 console=${console},${baudrate}n8'

You need to add “.service” at the end

do_install_append() {
    rm ${D}${sysconfdir}/systemd/system/getty.target.wants/getty@tty1.service
}

Thanks for your Input.

Hi

This is working on Host Ubuntu 18.04

But not working in Ubuntu 20.04

gives and error Can’t remove /etc/systemd/system/getty.target.wants/getty@tty1, no such file or deirectory

Please find attached .bbappend file

Thanks in advance
Margish
link text

Hi @margish

Thanks for writing to the Toradex Community!

Could you ask a new question with all the necessary Information to reproduce the issue?

Thanks and best regards,
Jaski