I am building some rootfs images based on generic-efi profile. When booting the minimal image It throws and error about the terminal because the TERM variable is not properly set by getty systemd service.
I have tracked the issue to here. In that function $TERM is being substituted by the build host. I am building the images on GitHub and the TERM variable is being replaced by unknown in this case.
The variable needs to be escaped in that configure_cli_autologin function.
This function was introduced in this MR maybe @linux-aarhus can take a look at it.
BTW, I tried to open the issue and send the fix as merge request on gitlab but I was unable to sign up. It does not seem to allow new registrations.
Thank you for reporting this. I am not the proper maintainer - I just jump in when assistance is required - and I am not an expert on bash - my apologies for the error.
The MR you mention worked as expected in local tests (buildarmimg - tested on RPI - no errors) but I can see that an unintended variable expansion could happen.
I have created a merge request with a proposed fix - escaping the \$TERM variable and for good measure the %I variable as well.
I also removed a doubled // slash in the path and added a necessary check for host architecture as a qemu package required on x86_64 has been made an optional dependency.
I don’t think that % symbol needs to be escaped here. In that case the output is ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root \%I $TERM.
Maybe the easiest fix is to use ‘EOF’ to disable variable expansion inside the whole block:
BTW, I have also seen that after running the OEM install script the system keeps login as root automatically on every boot. I guess that this line was supposed to delete the autologin.conf file but the path is wrong:
rm -rf /etc/systemd/getty\@tty1.service.d
Shouldn’t it be /etc/systemd/system/getty\@tty1.service.d?