Just thought I should share my experience, in the hope that others might see this and avoid my mistake.
It seems obvious in hindsight, but I put "sudo gainroot" in /home/user/.profile, because every time I used xterm, I wanted root access.
Unfortunately, something at the end of the boot process must use a shell, and it can't run as root, because with this change the N800 halts its boot when the progress bar is fully right.
Yeah, I know, it seems obvious now, but I didn't think the change through, and kept re-doing it after a reflash (reflash, install xterm, gainroot, start adding other stuff, and it would be fine until I rebooted). I wasted lots of time.
Or maybe check if the session is interactive and only then gainroot - I don't think $TERM is defined for non-interactive sessions/logins. And isn't .login executed only by interactive logins? Could depend on the shell though.
/home/user/.profile will be executed three times during the boot process (at least on my 4.2007 N800) and each time TERM will be set to "linux" but when logging in interactively via xterm, TERM will be set to xterm so the easy solution is to check $TERM and if it's set to xterm call sudo gainroot.
I put "sudo gainroot" in /home/user/.profile, because every time I used xterm, I wanted root access.
It is a bit like having a house with front door leading directly to your bedroom :-)
You can shoot yourself in the foot quite easily and in many unexpected ways while being always root. What about creating just one letter alias to sudo gainroot in your .profile (or .bashrc if .profile reads it)?