How to add boot-up script in L4T 32.2.1 system

How to add boot-up script in L4T 32.2.1 system, I tried many methods, which are invalid, including gnome / update-rc.d, or directly in /etc/rcS.d. In addition, I modified 50 before -nvidia.conf file, login as root user does not work anymore, please tell me how to solve the above two problems

There are several options to do this.
I prefer to add my boot up scripts to/etc/rc.local

sudo vi /etc/rc.local

Note that /etc/rc.local/ doesn’t exist on a Jetson by default, so you need to create it and add a shebang line at the top (e.g. #!/bin/bash), and ensure the file is executable.

But there are many more options under Linux to accomplish this.
See eg here:
https://askubuntu.com/questions/814/how-to-run-scripts-on-start-up

After ubuntu 16.04, I think systemd is the one that is used.

https://www.freedesktop.org/wiki/Software/systemd/