Login loop when remove default.target

I’m having a login loop with a jetson AGX running the jetpack 4.5 .
I want to skip running oem-config , so I create a default user in the rootfs and enter the command : rm rootfs/etc/systemd/system/default.target ,
then flash the Jetson device .

It enters a login loop when I type account and password,
but it can be accessed through headless mode.

Can anyone help me?

Thank you

default.target” is not what runs oem-config. What that target does is link to the default boot stage, either text-mode “multi-user.target” or GUI mode “graphical.target”. This file should always be present and point at one of the two above modes. oem-config is separate software even if one of those stages triggers it.

One way of correcting this (though perhaps not the “proper” way using systemctl commands), if previously this was text-mode only:
sudo ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

Similarly, if your default was a GUI, then this should restore it:
sudo ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

If you want your flash image to start with a user name/pass, then perhaps look at this script:

Do beware though that if you are shipping that product commercially, then a truly “default” name/pass which the whole world knows about might be frowned on in the state of California (Jetson’s used to come with a default name/pass, but laws there are why there was a switch to having the users create the admin name/pass on first boot).