How to install omxiv

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
helio58
Posts: 19
Joined: Tue Jun 06, 2017 8:02 pm

How to install omxiv

Post by helio58 »

Hi is there a way to install omxiv ? its in https://github.com/HaarigerHarald/omxiv

I have try but was unable to install.
Any here that have manage to install?
Starlight5
Posts: 28
Joined: Wed Jul 08, 2015 12:14 pm

Re: How to install omxiv

Post by Starlight5 »

@helio58 yes there is. You need to install omxplayer (apt-get install omxplayer), and copy contents of opt dir from https://github.com/raspberrypi to your opt dir e.g. via SCP, then follow instruction https://thepi.io/how-to-use-your-raspbe ... ternative/

I have another problem though. Everything is working but I want to restict use of omxiv/omxplayer to separate ssh account which cannot access antything but its folder. How do I do that? Please help!
User avatar
WarHawk
Posts: 608
Joined: Thu Jul 20, 2017 8:55 am

Re: How to install omxiv

Post by WarHawk »

Starlight5 wrote: Wed Dec 19, 2018 8:29 pm @helio58 yes there is. You need to install omxplayer (apt-get install omxplayer), and copy contents of opt dir from https://github.com/raspberrypi to your opt dir e.g. via SCP, then follow instruction https://thepi.io/how-to-use-your-raspbe ... ternative/

I have another problem though. Everything is working but I want to restict use of omxiv/omxplayer to separate ssh account which cannot access antything but its folder. How do I do that? Please help!
https://www.tecmint.com/restrict-ssh-us ... g-chrooted
https://askubuntu.com/questions/1013286 ... older-only
https://unix.stackexchange.com/question ... rs-folders
Starlight5
Posts: 28
Joined: Wed Jul 08, 2015 12:14 pm

Re: How to install omxiv

Post by Starlight5 »

@WarHawk thank you for the links, but sadly I lack the understanding how to apply them to my situation.

I have built and installed omxiv, and installed omxplayer as root. It works fine. Now I will create a new user - and what do I need to do? Build&install omxiv, install omxplayer as that user, then apply restrictions to that new user with chroot instruction from the first link?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: How to install omxiv

Post by MichaIng »

First of all, you should not copy https://github.com/raspberrypi/firmware manually and only the /opt/vc content. You might end with non-matching versions or worse, a broken system.
This firmware is applied on RPi via the raspberrypi-kernel|bootloader|0|bin packages, so a simple apt update && apt full-upgrade will bring everything onto current stage, or use dietpi-config > Advanced Options > Firmware update which applies the slightly newer master branch, but all this done in a careful way.

The guide in the first link is the effective way to completely jail the user. But as you can see, this requires to copy all required binaries and libraries into the chroot environment. So you need to identify everything that is required for omxiv and make it available within the chroot environment. Some /dev /sys /proc files might be required as well.
At least I would not create copies, but hardlinks via cp -l -v source dest, so no doubled disk space is used and APT updates are applied to the chroot environment as well.
Starlight5
Posts: 28
Joined: Wed Jul 08, 2015 12:14 pm

Re: How to install omxiv

Post by Starlight5 »

I am trying to implement chroot according to Tecmint guide... how do I determine what do I need for omxplayer to work, apart from its shared libraries?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: How to install omxiv

Post by MichaIng »

Not sure, it needs ALSA and dbus access, besides the above mentioned, /run ist most likely required to allow access to the dbus socket. Not sure how ALSA access technically works. Why not simply try and error? Nothing to loose and I guess starting omxplayer from inside the chroot then should give some error message from where additional needs can be hopefully derived.
Starlight5
Posts: 28
Joined: Wed Jul 08, 2015 12:14 pm

Re: How to install omxiv

Post by Starlight5 »

First of all, thank you for support. Most people just ignore me whenever I ask related questions, making me feel like an idiot. )=
MichaIng wrote: Sat Jul 06, 2019 11:17 pm Not sure, it needs ALSA and dbus access, besides the above mentioned, /run Why not simply try and error?
Omxplayer has a very bloody long dependencies list, it gets me depressed just looking at it. Frankly even following the guide to enable shell was a chore because libs are stored in different folders. Can I do something to restrict regular user from accessing stuff with creating a chroot jail, e.g. with user permissions like on Windows - or will it be insecure?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: How to install omxiv

Post by MichaIng »

@Starlight5
Of course you can solve it via user permissions as well, but the basic issues stays the same that you need to know which files/dirs access is required to and which not. So actually the chroot is easier then since the other way round you would need to adjust permissions for every single file that you want to block access for the user. And this can even break other stuff and new files/dirs are by default world-readable.

Another idea is to only allow the user to run a single command (omxplayer) + perhaps logout/exit: https://stackoverflow.com/a/21649384
IMP easier than setting an empty string alias for every single existing command would be to override the PATH variable for this user to e.g. /home/<username>/bin and symlink the commands there that you want it to be able to call. By this at least practically changing dir, reading files etc. is not possible without the need for chroot. But I guess rbash is saver to block this on a lower level.
Post Reply