View Single Post
Posts: 502 | Thanked: 366 times | Joined on Jun 2010 @ /dev/null
#20
In linux, executables aren't indicated by their filename extensions (which is completely the opposite of what windows does). This is where the tool `file' comes in handy.
With file, it can describe to you what sort of file it is. It isn't foolproof but it is very handy for getting started with understanding the various files (until you decide you want to dig into understanding the headers of the files, which is usually where the tool file works its magic).

Here is an example of how it works:
Code:
Nokia-N900:~$ file /bin/bash   
/bin/bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), stripped
As for locating the programs, debian linux utilises dpkg to centralise installation/uninstallation/etc of various programs. There are many switches for dpkg but I'll give you an example which would be something that you would want to achieve here. We assume mediaplayer would have the package name mediaplayer (assumptions initially may not be right for beginners but as one is more familiar with linux, their assumptions maybe more accurate):
Code:
Nokia-N900:~$ dpkg -l mediaplayer*| grep ii| awk '{ print $2 }'
mediaplayer
mediaplayer-l10n-cscz
mediaplayer-l10n-dadk
mediaplayer-l10n-dede
mediaplayer-l10n-engb
mediaplayer-l10n-enus
mediaplayer-l10n-eses
mediaplayer-l10n-esmx
mediaplayer-l10n-fifi
mediaplayer-l10n-frca
mediaplayer-l10n-frfr
mediaplayer-l10n-itit
mediaplayer-l10n-mr0
mediaplayer-l10n-nlnl
mediaplayer-l10n-nono
mediaplayer-l10n-plpl
mediaplayer-l10n-ptpt
mediaplayer-l10n-ruru
mediaplayer-l10n-svse
mediaplayer-restore
mediaplayerhomeapplet
Now I'm not going into too much detail as what each of those commands do or describing on various aspects of shell stuff . `dpkg -l' simply lists packages with a nice banner by default, `grep' just prints out anything from standard input (stdin) that matches whatever you want, in my case its `ii', awk is a powerful tool that allows one to print exact lines from say for example a table.

From that output we can see the very first line is the actual package we want to query for the list of files that came with the package:
Code:
Nokia-N900:~$ dpkg -L mediaplayer
/.
/usr
/usr/share
/usr/share/dbus-1
/usr/share/dbus-1/services
/usr/share/dbus-1/services/com.nokia.mediaplayer.service
/usr/share/doc
/usr/share/doc/mediaplayer
/usr/share/doc/mediaplayer/copyright
/usr/share/doc/mediaplayer/changelog.Debian.gz
/usr/share/gconf
/usr/share/gconf/schemas
/usr/share/gconf/schemas/mediaplayer.schemas
/usr/share/mime
/usr/share/mime/packages
/usr/share/mime/packages/mediaplayer-service-mime.xml
/usr/share/applications
/usr/share/applications/hildon
/usr/share/applications/hildon/mediaplayer.desktop
/usr/share/pixmaps
/usr/share/pixmaps/mediaplayer
/usr/share/pixmaps/mediaplayer/1bit_alpha_round_corner_button.png
/usr/share/pixmaps/mediaplayer/1bit_alpha_round_corner_button_active.png
/usr/bin
/usr/bin/mediaplayer.launch
/etc
/etc/others-menu
/etc/others-menu/extra_applications
/etc/osso-backup
/etc/osso-backup/applications
/etc/osso-backup/applications/mediaplayer.conf
/usr/bin/mediaplayer
/etc/others-menu/extra_applications/0000_mediaplayer.desktop
The output isn't particularly useful, so instead we shall just create oneliner script that will incorporate `file' and make the output much more useful:
Code:
Nokia-N900:~$ for i in `dpkg -L mediaplayer`; do file $i; done                                
/.: directory
/usr: directory
/usr/share: directory
/usr/share/dbus-1: directory
/usr/share/dbus-1/services: directory
/usr/share/dbus-1/services/com.nokia.mediaplayer.service: ASCII text
/usr/share/doc: directory
/usr/share/doc/mediaplayer: ERROR: cannot open `/usr/share/doc/mediaplayer' (No such file or directory)
/usr/share/doc/mediaplayer/copyright: ERROR: cannot open `/usr/share/doc/mediaplayer/copyright' (No such file or directory)
/usr/share/doc/mediaplayer/changelog.Debian.gz: ERROR: cannot open `/usr/share/doc/mediaplayer/changelog.Debian.gz' (No such file or directory)
/usr/share/gconf: directory
/usr/share/gconf/schemas: directory
/usr/share/gconf/schemas/mediaplayer.schemas: ASCII English text
/usr/share/mime: directory
/usr/share/mime/packages: directory
/usr/share/mime/packages/mediaplayer-service-mime.xml: XML document text
/usr/share/applications: directory
/usr/share/applications/hildon: directory
/usr/share/applications/hildon/mediaplayer.desktop: ASCII text, with very long lines
/usr/share/pixmaps: symbolic link to `/opt/usr/share/pixmaps'
/usr/share/pixmaps/mediaplayer: directory
/usr/share/pixmaps/mediaplayer/1bit_alpha_round_corner_button.png: PNG image data, 96 x 96, 8-bit colormap, non-interlaced
/usr/share/pixmaps/mediaplayer/1bit_alpha_round_corner_button_active.png: PNG image data, 96 x 96, 8-bit colormap, non-interlaced
/usr/bin: directory
/usr/bin/mediaplayer.launch: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), stripped
/etc: directory
/etc/others-menu: directory
/etc/others-menu/extra_applications: directory
/etc/osso-backup: directory
/etc/osso-backup/applications: directory
/etc/osso-backup/applications/mediaplayer.conf: ASCII text
/usr/bin/mediaplayer: symbolic link to `maemo-invoker'
/etc/others-menu/extra_applications/0000_mediaplayer.desktop: symbolic link to `/usr/share/applications/hildon/mediaplayer.desktop'
From that output we can determine where is the exact location of the program:
Code:
/usr/bin/mediaplayer.launch: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), stripped
It is weird if your script and that directory disappeared, I'd try and reinstall it from the command line: apt-get install --reinstall dbus-scripts

That will restore the directory along with the scripts but whatever you had before would have been lost. There is an ugly hack that I can think of right now, which would involve setting the file immutable but I cannot vouch if it is safe for use with N900: chattr +i /etc/dbusscripts.d/foo.conf (as root)

raver2011: I'm guessing your issue is with the head deck you have which is probably incapable of playing through bluetooth. Which methods have you tried? I don't have a head deck in my car (I ripped my old Sony out because it was dead and it doesn't have bluetooth functionality).

vittoriob4: This could either be the use of silence profile or something else which I wouldn't know of. With the silence profile enabled, it will be evident when you have an incoming call as mediaplayer will stop playing the music and then the rtcom-call-ui may play the requested music as ringtone.

Last edited by tuxsavvy; 2011-07-30 at 03:10. Reason: Should respond to other people's enquiries :p
 

The Following 2 Users Say Thank You to tuxsavvy For This Useful Post: