DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th November 2016
Angevin's Avatar
Angevin Angevin is offline
Real Name: Cypherpunk
Ghost in the Shell
 
Join Date: Nov 2009
Location: New York state
Posts: 20
Question Hotplug-diskmount and Calibre

Hey, guys, I have an ereader , Kobo aura H20 (among other things I have an OpenBSD book and some other Unix etc.. books on it), I love the thing to death and Calibre is great piece of third party software for managing it so I thankful to the port maintainer or sponsor or whatnot.

Anyway, my question is if I setup hotplug-diskmount will Calibre recognize my ereader so I can send books directly to my ereader from Calibre ? The way I have been doing it is I have been converting books with Calibre then using the shell to move the books to my ereader using /mnt and the ereader as a generic USB storage device.

I'm too lazy to test it out by setting up hotplug-diskmount if it is not going to work and plus I like installing the least amount of software from ports , as possible, for obvious reasons. However, if you guys tells me it will work then I will set it up. Hey laziness can be a good thing in Unix otherwise people would type the same kind of commands over and over again rather than using aliases and shell scripts etc... work smart not hard !

Maybe, I'm missing something here so if you know another way to do it, other than what I am proposing, then I'm all ears.

BTW, I'm loving the OpenBSD 6.0 stable one of the best version increments, yet, IMHO.

P.S. I have no experience with hotplug-diskmount but I hope I can setup certain profiles I don't want it automatically mounting anything I stick in my USB ports as that seems like a security hazard.

Thanks in advance for anyone who takes the time to answer !

Last edited by Angevin; 13th November 2016 at 10:47 AM. Reason: punctuation and to clarify a minor point and too add a point
Reply With Quote
  #2   (View Single Post)  
Old 13th November 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

The hotplug-diskmount tool issues mount(8) commands for the partitions found on a disk drive device. If your eReader does not identify as a USB mass storage device, this program isn't going to help.

For more information, install the package and read its man page.
Reply With Quote
  #3   (View Single Post)  
Old 13th November 2016
Angevin's Avatar
Angevin Angevin is offline
Real Name: Cypherpunk
Ghost in the Shell
 
Join Date: Nov 2009
Location: New York state
Posts: 20
Default

Quote:
Originally Posted by jggimi View Post
The hotplug-diskmount tool issues mount(8) commands for the partitions found on a disk drive device. If your eReader does not identify as a USB mass storage device, this program isn't going to help.

For more information, install the package and read its man page.
Ok, now I see why hotplug-diskmount probably won't work thanks for answer. I think it is supposed to be up to the instrinsic Calibre python code to handle this but Calibre is not designed to work on the BSDs plus wouldn't Calibre need root privileges or use doas or something for this to work theoretically ?

Acually, sorry, I used the wrong language; It used to be in prior versions of OpenBSD that Calibre did not recognize the device the problem now is that it recognizes my device but Calibre throws an error, in python error syntax, that it cannot communicate with the device. I don't program python so the error syntax is beyond me. When I try to send a book to the device it says the device storage is full when in reality it is only 23% used.

Code:
NoneType' object has no attribute 'endswith'

Traceback (most recent call last):
  File "/usr/local/lib/calibre/calibre/gui2/device.py", line 87, in run
    self.result = self.func(*self.args, **self.kwargs)
  File "/usr/local/lib/calibre/calibre/gui2/device.py", line 503, in _books
    mainlist = self.device.books(oncard=None, end_session=False)
  File "/usr/local/lib/calibre/calibre/devices/kobo/driver.py", line 1459, in books
    need_sync = self.parse_metadata_cache(bl, prefix, self.METADATA_CACHE)
  File "/usr/local/lib/calibre/calibre/devices/usbms/driver.py", line 485, in parse_metadata_cache
    cache_file = cls.normalize_path(os.path.join(prefix, name))
  File "/usr/local/lib/python2.7/posixpath.py", line 70, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
^^ I give it some credit though posix.path.py seems to indicate it is at least attempting POSIX standards.


Code:
$df -h | grep sd2i
/dev/sd2i      3.2G    737M    2.5G    23%    /mnt
(BTW, I don't have it mounted on /mnt when I try to use Calibre I just did that to see if the device memory was full)

Also, there does not seem to be a manpage installed with calibre. I checked to see if it was installed outside my $MANPATH :

Code:
  $cd /usr/libexec && ./locate.updatedb && locate calibre | grep man
^^ the above will show some other results but not the pertinent info i.e. the existence of a man page.

It does not show that a man page is installed on the system but if I do that command with the multimedia player mpv it shows a man page is installed on the system.

Also, there is nothing on calibre in /usr/local/share/doc

There is calibre documentation online but I am skeptical it is going to cover this issue since the developer Kovid Goyal seems indifferent to or even hostile to Calibre working on the *BSDs that is why he makes a Linux port but not a BSD one.

I am going to play around with it and see if I can get it to work. Calibre seems to let me change the device settings, to some degree, but so far it does not look like it is advanced enough.

Last edited by Angevin; 13th November 2016 at 11:28 PM. Reason: punctuation add some info
Reply With Quote
  #4   (View Single Post)  
Old 13th November 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

  • It appears that your device will attach as mass storage, as you are able to mount /dev/sd2i. You should be able to manage its contents as you would any filesystem.
  • You may see exactly what files are installed or will install with any package, with the -L option of the pkg_info(1) command.
  • The pkg_info() also provides a brief description of a package. Issuing the command $ pkg_info calibre tells me what Calibre can do, who the $MAINTAINER is, and it also informs me that there is no USB/MTP access for Calibre on OpenBSD. MTP = Media Transfer Protocol.
Reply With Quote
  #5   (View Single Post)  
Old 14th November 2016
Angevin's Avatar
Angevin Angevin is offline
Real Name: Cypherpunk
Ghost in the Shell
 
Join Date: Nov 2009
Location: New York state
Posts: 20
Thumbs up Thanks the issue is solved

Quote:
Originally Posted by jggimi View Post
  • It appears that your device will attach as mass storage, as you are able to mount /dev/sd2i. You should be able to manage its contents as you would any filesystem.
  • You may see exactly what files are installed or will install with any package, with the -L option of the pkg_info(1) command.
  • The pkg_info() also provides a brief description of a package. Issuing the command $ pkg_info calibre tells me what Calibre can do, who the $MAINTAINER is, and it also informs me that there is no USB/MTP access for Calibre on OpenBSD. MTP = Media Transfer Protocol.
Yeah, thanks for the info : I need to start using pkg_info more seriously, I'm not used to using pkg_info for that specifically ( I've used it for other things though using different parameters) just reading man pages and docs on the system. I've been away from OpenBSD, on a hiatus, but have been back since 5.9 and 6.0 so I'm slightly rusty.

BTW, that is what I have been doing, before these posts, is managing /dev/sd2i like I would any filesystem that is how I have been using Calibre, with my eReader, on OpenBSD, since it has been ported to OpenBSD. It is really not that big of a deal it is only a minor hassle the important thing is Calibre is ported generally to OpenBSD not that it works with USB/MTP.

The problem is obviously the MTP support, like my android phone, but I found a workaround to sync music and other files , on my phone, using an external memory card etc...

Your reply was very helpful thanks so much for the answer it seems this issue is now solved. No, seriously, your reply was very very helpful and I truly appreciate it. I learned a valuable lesson too -- to not just read man pages and docs but to use pkg_info as well !

Last edited by Angevin; 14th November 2016 at 12:54 AM. Reason: fix spelling error
Reply With Quote
  #6   (View Single Post)  
Old 14th November 2016
Angevin's Avatar
Angevin Angevin is offline
Real Name: Cypherpunk
Ghost in the Shell
 
Join Date: Nov 2009
Location: New York state
Posts: 20
Default Sorry for wasting your time jggimi

Actually, sorry, I want to apologize for wasting your time I found this information :

"When given an installed package name (or a location of a package which is to be installed), pkg_info(1) will show more detailed information about that specific package. "

https://www.openbsd.org/faq/faq15.html

In my defense, though, it is not obvious, at least not to me, from the pkg_info(1) man page that you can just type :

$pkg_info <package name> (without the tgz extension)


However, it is obvious that you can just type $pkg_info as a simple unix command.

Maybe, the OpenBSD people realize it is not obvious so they made the FAQ ?

It is obvious from the man page that it is a simple unix command which indicates that you could simply type $pkg_info and get a list of packages or something but it is not obvious that you could just type $pkg_info <package name> (without the tgz extension) without any switches. At least not to me it wasn't obvious maybe to you guys it is. Maybe, I just need to get better at understanding man pages. It is not like I never used pkg_info before I just usually use it with switches.

The information is also in the DESCR file in /usr/ports/textproc/calibre/pkg/DESCR

I guess I prefer the man pages to reading the docs on the OpenBSD website but I need to read more docs on the OpenBSD website more often because I wouldn't have thought of that functionality from just reading the man page by itself. Again, my apologies.

Then, again, I have the newest Absolute OpenBSD book too and I wouldn't be surprised if that information is in it as well.

In closing read the freaking docs and RTFM mofos ! Seriously, don't waste other people's time.

P.S. I feel like an idiot right now but no really I wasn't being an idiot I was just being an inconsiderate lazy jerk ! I probably did not drink enough coffee or something.
__________________
"Those who do not understand UNIX are condemned to reinvent it, poorly." -- Henry Spencer

Systemd is ripe for and asking for someone to make the mother of all rootkits for it.

Last edited by Angevin; 14th November 2016 at 11:44 AM. Reason: add information
Reply With Quote
  #7   (View Single Post)  
Old 14th November 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Not to worry; I knew you weren't a pkg_info() user. Now, you have become one.
Reply With Quote
Reply

Tags
calibre, ereader, hotplug-diskmount

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre device detection on 5.3-beta fails with python error sysfu OpenBSD Packages and Ports 0 12th March 2013 05:42 AM


All times are GMT. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick