I created the script.
To use it please ssh into the pi or get on a commandline as user osmc.
I only tested this on PI 2. It might work on the 1 but I am not sure.
This only installs retropie for now. I will do a post tomorrow on how to integrate it into kodi.
You need to stop Kodi before running emulationstation as the input will be grabbed by kodi otherwise.
Now the good stuff:
Note: Everything you do with this is on your own risk!
On a shell go to the osmc home directory:
cd /home/osmc
Download the script:
wget https://raw.githubusercontent.com/mcobit/retropie-osmc/master/INSTALL_RETROPIE_ON_OSMC_RC.sh
Run the script:
chmod +x INSTALL_RETROPIE_ON_OSMC_RC.sh
sudo ./INSTALL_RETROPIE_ON_OSMC_RC.sh
Wait a long time and pray.
If you see the dialog of the RetroPie-Setup script,
choose binary installation!!!
If you see it again, ignore uninstallable packages and select cancel afterwards. The rest of the script will continue.
Good luck!