sy6sy2 / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS and Windows.
https://kodi.tv/
Other
6 stars 1 forks source link

Add root requirement to build doc for deb file generation #41

Closed phunkyfish closed 5 years ago

phunkyfish commented 5 years ago

Just a note for myself, not at a computer till after the weekend.

kambala-decapitator commented 5 years ago

reason: installing to jailbroken device requires owner to be root

pogarek commented 5 years ago

also let's add how to fix this for building from XCode (I've added my primary user to administrators) :

Creating org.xbmc.kodi-ios package version 18.2 revision 0~rc1
+ /usr/bin/sudo rm -rf ./org.xbmc.kodi-ios
sudo: no tty present and no askpass program specified
make: *** [/Users/piotr/gitrepos/kodi-ios/SylvainCecchetto/kodi-build/CMakeFiles/deb] Error 1
Command /bin/sh failed with exit code 2

("o tty present and no askpass program specified")

I'm not a heavy user of XCode, so I asked google and found this: https://stackoverflow.com/questions/6803329/how-to-use-sudo-inside-of-a-run-script-build-phase-in-xcode-4 ...

pogarek commented 5 years ago

I did "sudo sh" and tried to built deb target as root. It failed at:

Check dependencies
Code Signing Error: No profiles for 'org.xbmc.kodi-ios' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'org.xbmc.kodi-ios'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
phunkyfish commented 5 years ago

Yes, the -allowProvisioningUpdates I know about.

Have you restarted your Mac since adding to admin group and then try to run deb target from Xcode? I just did a test with a non admin user, added them to admin but didn’t work until a restart.

pogarek commented 5 years ago

Yes, I did a restart and it didn't helped. I run some tests and it seems, that below approach would work:

  1. Build all as user with admin permissions
  2. Create a script that will output password to standard output, for example:
    #!/bin/bash
    echo insertYourPasswordHere
  3. Save the file somewhere, for example to your home directory (/Users/xxx/pass.sh as example)
  4. run below from terminal before doing a build :
    export SUDO_ASKPASS="$HOME/pass.sh"
    alias sudo="sudo -A"
  5. make the package with Xcodebuild :
    /Users/Shared/xbmc-depends/x86_64-darwin18.5.0-native/bin/cmake --build . --target "deb" --config "Debug"

That worked for me. Probably there are better and safer options for SUDO_ASKPASS , but I'm not so good in macOS - I come from Windows :-)

phunkyfish commented 5 years ago

Well done. This must be what they do on Jenkins.

pogarek commented 5 years ago

:-) thanks. However after I made ipa from deb file and sideloaded to my iPad, I couldn't find an icon and launch it. When I try to build deb target again, it hanged on sudo again. Damn. I'll delete kodi-build dir and try again.

pogarek commented 5 years ago

Update: after successful attempt I run Xcode from terminal and tried again. It failed and , probably, messed up with shell/environment variables. Starting new terminal window and building deb from there, with askpass works again.

fuzzard commented 5 years ago

Once https://github.com/xbmc/xbmc/pull/15967 gets merged, and the ATV stuff is updated to match, hopefully the issue should be resolved.

phunkyfish commented 5 years ago

Closing as will be resolved when rebased with PR above.