This is an old revision of the document!
Table of Contents
Ubuntu 22.04
Installeer Ubuntu met de minimal 22.04 ISO, maak een gebruiker kodi aan met als wachtwoord kodi en selecteer bij de installatie alleen SSH server
tools voor repository management
apt install software-properties-common
Deb sources voor XBMC toevoegen
keyserverinfo ophalen
curl -fsSL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6D975C4791E7EE5E" | sudo gpg --dearmor -o /usr/share/keyrings/team-xbmc.gpg
voeg vervolgens de sources toe aan apt, zet de volgende inhoud in “/etc/apt/sources.list.d/team-xbmc.list”
- team-xbmc.list
deb [arch=amd64,i386 signed-by=/usr/share/keyrings/team-xbmc.gpg] https://ppa.launchpadcontent.net/team-xbmc/ppa/ubuntu/ jammy main # deb-src [arch=amd64,i386 signed-by=/usr/share/keyrings/team-xbmc.gpg] https://ppa.launchpadcontent.net/team-xbmc/ppa/ubuntu/ jammy main
Software installeren
apt update apt upgrade apt install kodi openbox lightdm samba wsdd lm-sensors mc binutils build-essential subversion git unzip xterm dkms
Select lightdm as default display manager
Samba Configureren
Maak een /etc/samba/smb.conf aan
mcedit /etc/samba/smb.conf
en zet hier het volgende in
smb.conf
#======================= Global Settings ===================================== [global] unix charset = UTF8 workgroup = Blaat netbios name = eXcyle-MCE server string = hosts allow = hosts deny = security = user encrypt passwords = yes max log size = 0 create mask = 0777 directory mask = 0777 force create mode = 0777 force directory mode = 0777 # start windows 10 stuff usershare allow guests = yes guest ok = yes guest account = kodi #map to guest = bad user #map to guest = bad password #username map = /etc/samba/usermap.conf # end windows 10 stuff wins support = yes local master = yes os level = 2 preferred master = yes name resolve order = wins lmhosts bcast printcap name = /etc/printcap load printers = no unix extensions = no follow symlinks = yes wide links = yes #ntlm auth=true server min protocol = SMB2 client min protocol = SMB2 #log level = 2 #======================= Shares ============================================== [Roms] path = /home/kodi/roms read only = no guest ok = yes force user = kodi force group = kodi
Geluid Configureren
De user kodi audio rechten geven
usermod -G cdrom,video,audio,plugdev,users,dialout,dip,input,netdev kodi usermod -G cdrom,video,audio,plugdev,users,dialout,dip,input,netdev root
LIRC Configureren
(configuratie in combinatie met een homebrew Seriele IR receiver en een logitech harmony ingesteld als Xbox remote)
De lirc in 22.04 is niet helemaal goed, hierom gaar we lirc installeren vanaf de 18.04 repo.
voeg onderaan “/etc/apt/sources.list” de volgende repo toe: deb [signed-by=/usr/share/keyrings/3B4FE6ACC0B21F32.gpg] http://ca.archive.ubuntu.com/ubuntu/ xenial universe en installeer lirc
curl -fsSL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3B4FE6ACC0B21F32" | sudo gpg --dearmor -o /usr/share/keyrings/3B4FE6ACC0B21F32.gpg apt update apt install lirc/xenial apt-mark hold lirc
verwijder de repo weer uit “/etc/apt/sources.list” en update de sources list weer
apt update
Maak een /etc/lirc/hardware.conf aan
mcedit /etc/lirc/hardware.conf
en zet hier het volgende in
- hardware.conf
# /etc/lirc/hardware.conf # #Chosen Remote Control REMOTE="Home-brew (16x50 UART compatible serial port)" REMOTE_MODULES="lirc_dev lirc_cir" REMOTE_DRIVER="" REMOTE_DEVICE="/dev/lirc0" REMOTE_SOCKET="" REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf" REMOTE_LIRCD_ARGS="" #Chosen IR Transmitter TRANSMITTER="None" TRANSMITTER_MODULES="" TRANSMITTER_DRIVER="" TRANSMITTER_DEVICE="" TRANSMITTER_SOCKET="" TRANSMITTER_LIRCD_CONF="" TRANSMITTER_LIRCD_ARGS="" #Enable lircd START_LIRCD="true" #Don't start lircmd even if there seems to be a good config file #START_LIRCMD="false" #Try to load appropriate kernel modules LOAD_MODULES="true" # Default configuration files for your hardware if any LIRCMD_CONF="" #Forcing noninteractive reconfiguration #If lirc is to be reconfigured by an external application #that doesn't have a debconf frontend available, the noninteractive #frontend can be invoked and set to parse REMOTE and TRANSMITTER #It will then populate all other variables without any user input #If you would like to configure lirc via standard methods, be sure #to leave this set to "false" FORCE_NONINTERACTIVE_RECONFIGURATION="false" START_LIRCMD=""
Maak een /etc/lirc/lircd.conf aan
mcedit /etc/lirc/lircd.conf
en zet hier het volgende in
- lircd.conf
#This configuration has been automatically generated via #the Ubuntu LIRC package maintainer scripts. # #It includes the default configuration for the remote and/or #transmitter that you have selected during package installation. # #Feel free to add any custom remotes to the configuration #via additional include directives or below the existing #Ubuntu include directives from your selected remote and/or #transmitter. #No default remote configuration was included for Home-brew (16x50 UART compatible serial port) #You will need to include your own custom configuration for #this remote, and file a bug at https://bugs.launchpad.net/ubuntu/ source/lirc/ filebug begin remote name Harmony bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 header 9036 4442 one 610 1620 zero 610 511 ptrail 610 repeat 9032 2187 pre_data_bits 16 pre_data 0x77E1 gap 107881 min_repeat 4 toggle_bit_mask 0x0 begin codes Up 0xD069 Down 0xB069 Left 0x1069 Right 0xE069 Ok 0x2069 ChannelUp 0x5079 ChannelDown 0x3079 VolumeUp 0x5019 VolumeDown 0x3019 1 0x50E9 2 0x30E9 3 0x90E9 4 0x60E9 5 0x9019 6 0x6019 7 0x1099 8 0xE099 9 0x1059 0 0xE059 Clear 0x2059 Enter 0x4099 Red 0x10F9 Green 0xE0F9 Yellow 0x20F9 Blue 0x40F9 Mute 0xA019 Back 0xA019 Exit 0x50D9 Guide 0xA0B9 Menu 0x4069 Info 0xD099 Rec 0x30D9 Rew 0xD059 Fwd 0xB059 Pause 0xC019 Play 0xC0E9 Skip 0xB005 Replay 0xD005 Stop 0xA0E9 Prev 0xB099 Aspect 0x50B9 F1 0x90D9 F10 0x6079 F11 0xA079 F12 0xC079 F13 0x90B9 F14 0x60B9 F2 0x60D9 F3 0xA0D9 F4 0xC0D9 F5 0x1005 F6 0xE005 F7 0x2005 F8 0x4005 F9 0x9079 LargeDown 0xB0F9 LargeUp 0xD0F9 PwrToggle 0xC0B9 Queue 0x30B9 Sleep 0x4059 end codes end remote
Om kodi goed te laten reageren op de lirc commando's moet je de XBMC lirc map aanpassen
maak eerst wat verplichte mappen aan voor kodi
mkdir -p /home/kodi/.kodi/userdata mkdir -p /home/kodi/.kodi/userdata/keymaps
Maak een /home/kodi/.kodi/userdata/lircmap.xml aan
mcedit /home/kodi/.kodi/userdata/Lircmap.xml
en zet hier het volgende in
- Lircmap.xml
<lircmap> <remote device="Harmony"> <Up>Up</Up> <Down>Down</Down> <Left>Left</Left> <Right>Right</Right> <Select>Ok</Select> <Back>Menu</Back> <ChannelPlus>ChannelUp</ChannelPlus> <ChannelMinus>ChannelDown</ChannelMinus> <VolumePlus>VolumeUp</VolumePlus> <VolumeMinus>VolumeDown</VolumeMinus> <Star>Clear</Star> <Hash>Enter</Hash> <Red>Red</Red> <Green>Green</Green> <Yellow>Yellow</Yellow> <Blue>Blue</Blue> <Mute>Mute</Mute> <Back>Back</Back> <obc1>Exit</obc1> <Guide>Guide</Guide> <Menu>Prev</Menu> <obc101>Info</obc101> <Record>Rec</Record> <Reverse>Rew</Reverse> <Forward>Fwd</Forward> <Pause>Pause</Pause> <Play>Play</Play> <SkipPlus>Skip</SkipPlus> <SkipMinus>Replay</SkipMinus> <Stop>Stop</Stop> <obc2>Aspect</obc2> <MyMusic>F1</MyMusic> <obc11>F10</obc11> <obc12>F11</obc12> <obc13>F12</obc13> <obc103>F13</obc103> <obc102>F14</obc102> <MyVideo>F2</MyVideo> <MyTV>F3</MyTV> <obc6>F4</obc6> <obc7>F5</obc7> <obc16>F6</obc16> <obc5>F7</obc5> <obc9>F8</obc9> <obc10>F9</obc10> <LargeDown>LargeDown</LargeDown> <LargeUp>LargeUp</LargeUp> <obc100>PwrToggle</obc100> <obc3>Queue</obc3> <obc4>Sleep</obc4> <One>1</One> <Two>2</Two> <Three>3</Three> <Four>4</Four> <Five>5</Five> <Six>6</Six> <Seven>7</Seven> <Eight>8</Eight> <Nine>9</Nine> <Zero>0</Zero> </remote> </lircmap>
Maak een /home/kodi/.kodi/userdata/keymaps/Harmony.xml aan
mcedit /home/kodi/.kodi/userdata/keymaps/Harmony.xml
en zet hier het volgende in
- Harmony.xml
<keymap> <!-- Blue toggles watched indicator --> <!-- Yellow will toggle the library views between 'show everything' and 'show watched only' --> <Global> <remote> <red>SubtitleSearch</red> <blue>ToggleWatched</blue> <yellow>SendClick(25,14)</yellow> </remote> <universalremote> <obc100>Powerdown</obc100> <obc101>ContextMenu</obc101> <obc102>XBMC.EjectTray()</obc102> <obc103>PreviousMenu</obc103> </universalremote> </Global> <!-- Home screen --> <!-- Red update video library --> <Home> <remote> <red>UpdateLibrary(video)</red> <green>CleanLibrary(video)</green> </remote> </Home> <!-- While whatching full-screen video --> <!-- Red download subtitles --> <!-- Green Subtitle delay settings --> <!-- Yellow cycles through the subtitles --> <!-- Blue cycles through the audio streams --> <FullscreenVideo> <remote> <red>ActivateWindow(SubtitleSearch)</red> <green>SubtitleDelay</green> <yellow>NextSubtitle</yellow> <blue>AudioNextLanguage</blue> </remote> <universalremote> <obc100>Powerdown</obc100> <obc101>ContextMenu</obc101> <obc102>XBMC.EjectTray()</obc102> <obc103>PreviousMenu</obc103> </universalremote> </FullscreenVideo> </keymap>
Kodi configureren
CPU/GPU temp
Maak een /home/kodi/.kodi/userdata/advancedsettings.xml aan
mcedit /home/kodi/.kodi/userdata/advancedsettings.xml
en zet hier het volgende in
- advancedsettings.xml
<advancedsettings> <cputempcommand>echo "$(sensors -u | head -n10 | grep temp1_input | awk '{print $2 }' |awk '{printf("%d\n",$1 0.5);}') C"</cputempcommand> <gputempcommand>echo "$(sensors -u | head -n10 | grep temp2_input | awk '{print $2 }' |awk '{printf("%d\n",$1 0.5);}') C"</gputempcommand> </advancedsettings>
Draai vervolgens
sensors-detect
En laat alle sensors detecteren en aan het einde de modules autoloaden.
Autostart
Download en installeer Kodi-Openbox Xsession
wget -O openbox-kodi-master.zip https://github.com/lufinkey/kodi-openbox/archive/master.zip unzip openbox-kodi-master.zip cd kodi-openbox-master bash ./build.sh dpkg -i kodi-openbox.deb
Maak een /etc/lightdm/lightdm.conf aan
mcedit /etc/lightdm/lightdm.conf
en zet hier het volgende in
- lightdm.conf
[Seat:*] autologin-user=kodi autologin-session=kodi-openbox
Wacht op netwerk
Het wil wel eens voorkomen dat kodi al gestart wordt voordat het netwerk klaar is. Om dit te voorkomen kan je onderstaande toevoegen aan het begin van “/usr/bin/kodi-openbox-session”
# Dirty hack to wait for network before starting kodi maxwait=20 sleeptime=3 i=0 while [ $i -lt $maxwait ] do numip=`ip address show dev eno1 | grep inet | grep -v inet6 | wc -l` if [ $numip == '1' ]; then totalwait=$(($i*$sleeptime)) echo "Slept for $totalwait seconds" break fi echo "Sleeping for $sleeptime seconds" sleep $sleeptime ((i++)) done #End of dirty hack
Workaround voor crashende nmbd bij shutdown
Maak een /etc/systemd/system/before-shutdown.service aan
mcedit /etc/systemd/system/before-shutdown.service
en zet hier het volgende in
- before-shutdown.service
[Unit] Description=Do stuff before shutdown [Service] Type=oneshot RemainAfterExit=true ExecStop=/usr/bin/killall -9 nmbd [Install] WantedBy=multi-user.target
en laat deze automatisch starten
systemctl daemon-reload
systemctl enable before-shutdown.service
pas de max timeout bij afsluiten aan
mkdir /etc/systemd/system.conf.d printf '[Manager]\nDefaultTimeoutStopSec=10s' | tee -a /etc/systemd/system.conf.d/faster-shutdown.conf
Rechten
Als laatste zette we nog even de juiste rechten op alle config bestanden
chown kodi.kodi /home/kodi -R
