Changing kodi home
#1
Hi,

for special reason I need to change the directory of ~/.kodi.
I tried to check /usr/bin/kodi for some hint and found the USERDATA_DIR variable.
I sounds well defined so I changed it to my directory.
I did not change the CRSHLOG_DIR which is suitable in my environment.
kodi starts but in the log i found that SQLite still searches in the default directory for Addondb27.
I also found in the log entries like special://home/ is mapped to: /mnt/osmclasse/.kodi
which seem to be used instead of USERDATA_DIR (checked by https://kodi.wiki/view/Special_protocol)

How can I change the ~/.kodi to something like mydir/.kodi which works in /usr/bin/kodi as well as with special:// without recompiling the source?

Regards
lpk
Reply
#2
Set HOME variable to the path you want, '.kodi' will be appended.
Reply
#3
Thanks,

but that is too much. I only want to have .kodi at a different location not the full HOME.
I did this before but I encountered some issues. So only put .kodi somewhere else is enough.

Regards
LPK
Reply
#4
Only change the HOME variable for Kodi not for the whole system.
Reply
#5
I forgot to mention:
Raspberry Pi 2/3
Rasbian strech
kodi 17.6 Git:20171115-d69a54a

I am not sure where HOME resides.
So USERDATA_DIR in /usr/bin/kodi ist not the right place. Should I set KODI_HOME in .profile or in /etc/default/kodi?
.profile wil not be overridden if I do an upgrade to kodi.

Regards
LPK
Reply
#6
Why you are still asking about USERDATA_DIR and KODI_HOME, thoes are the wrong variables.
To set HOME environment variable only for Kodi, start with 'HOME=<NEW-PATH> kodi' from a terminal.
Reply
#7
Well,

echo $HOME gives usually /home/<username> on unix system

if I change HOME I am in a situation I do not want.
lets have it this way:

the users home directorie resides on a network drive. So echo $HOME gives something like /mnt/<username> and /mnt/<username> is a mount point to a directory on lets say a samba drive (CIFS). .kodi on a network drive will not work because SQLite does not work with the database on a network drive. Ok, it would help if mysql would be supported, too.
So I try to let the user have her home directory on the network drive BUT change the .kodi directory to something on the local drive. But changing HOME changes the usershome as well.
I see it very common that a special name is used for just such a purpose. That's why I thought USERDATA_DIR is just made for this.

Thats why I am asking. To me it also seems that "special://" is somehow hard coded in kodi to the result of $HOME.

Regards
LPK
Reply
#8
that USERDATA_DIR is not used is actually a bug. I'll look into it.
Reply
#9
Move it wherever you want and symlink?
Reply
#10
Well, thanks so far. I appreciate all the hints.
I also hope that the bug could be solved soon.

The symlink wiill work if you stay on a drive local to the computer but will fail if home is on the network drive. There are many more suggestion like keeping home on the local computer but put directories like Documents, Pictures, Musik, Viedo etc on the network. But this will have a great effort on the user becaues he/she will stay with the files in the "Personal Folder" on the computer itself. It is that he/she has to be strict in where the data are stored.
It might be strange to put the home on the network drive but it is also one way to keep the client as thin as possible, and backup rather simple, too. I am also thinking of a full virtiual solution, but it may break because of the video and audio drivers are on the virtual machine and the loudspeaker are on the local computer, not to methion some latency with video due to the virtualization. And it requires a lot of computing power in the central system.
So I found the solution having most of HOME on the NAS and some directories local may help a lot. to be honest there are other programs using SQLite and similar which need to keep there home local to the computer. But this is ok as long as the special home can be set by an environment variable. If it is never set the default will work as expected. But if set system it will work well too because at every place the home is well defined but at a different path transparent to the system.

Regards
LPK
Reply
#11
https://github.com/xbmc/xbmc/pull/14460
Reply

Logout Mark Read Team Forum Stats Members Help
Changing kodi home0