Kodi

xinitrc
Both methods require you to create an xbmc user and place an .xinitrc:

First create the xbmc user

Via inittab
This is based on the way the mythtv ebuilds enable the autostart of the mythtv frontend. But since XBMC is the better fronted, I want XBMC to autostart on boot. :)

Then create the login scripts

Finally add an inittab entry which does the autologin

Shutdown
Allow the xbmc user to issue an shutdown via polkit, resulting in a shutdown option in the XBMC menu:

Note: ensure you have the udev USE flag set for shutdown to work

Hardened profile notes
XBMC runs in hardened profiles. One caveat is that to get networking fully working, CONFIG_GRKERNSEC_PROC_USER kernel option has to be unset. If you want to restrict /proc access, set CONFIG_GRKERNSEC_PROC_USERGROUP and GRKERNSEC_PROC_GID to a special group that will have access to /proc filesystem. You can then add add xbmc user to this group.

External resources

 * http://xbmc.org/