New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add canon lasor printer driver. (CAPT Printer Driver for Linux) #65069
Conversation
- build success but may required pruning unused packages
Nix expects to find things in /include, /lib, etc. Now, libs and includes are also auto-detected for cndrvcups-common
A whole bunch of changes, based on a small initial fix.
…lated source dirs - docs to doc.nix - ccpd.service to Misc
To install the systemd service provided by a derivation:
To install the ppds:
About the
Otherwise you would have to use systemd-tmpfiles:
|
Do you need some help to finish this one ? It looks like a big packaging effort :-) |
@layus I still have no idea what to do next Instruction for building the source can be found on Arch AUR (that is what I have done) I have no idea on the remaining step for Nix/NixOS. |
Hi @wizzup, I took some time to make the extra steps. This driver is a pure mess with 32bit and 64bit binaries in the same packages, and requires to find its stuff in fixed locations. My best attempt at the moment is available in https://github.com/layus/nixpkgs/tree/canon-merge, and can be easily tested as per the instructions in Could you test it and debug/give feedback ? I own no such printer. |
Hi @layus, Thanks for help. I setup a dedicated netbook to test this, below are my steps
Also status of cups
I wipe the Arch linux installation on this test netbook during NixOS installation procress (silly me) and I can't compare any command outputs. beside |
ccpdadmin is present, but not in the system path. To add it to the system path, you can add in
or you can extract the full path to |
@wizzup It seems that I was a bit overengineering this as I added a FHS user env that may not be needed. I have written a new
but this is a good start. The file also includes Can you paste here the output of |
You can also ping me on irc/riot if you want quick interactions |
Sorry for late reply, Thanks to
Adding udev rules (source) doesn't seem to fix it.
[root@nixos:~]# lsusb [root@nixos:~]# find /dev/ | grep -i usb [root@nixos:~]# find /proc/ | grep -i usb
|
Hi, I have some update report
I think the main road block is
I didn't capture the picture of
I have collect the test scripts and outputs on this gist One more question: Do you have any idea how to set the
|
@wizzup Are you ready for another round ? I have updated my branch, and I am now using an FHS (as expected) to work around programs looking in /bin/ and /usr/bin directly. You should remove Everything works for me, except for some connection issues. The cups filters pipeline works with all the ghostcript opvp binary sh*t stuf, and ccpd seems to be able to listen on the local network, and on /dev/lp0. Once everything is set up, it should be working just like that. In case of issues, I am very interested in the output of
other interesting traces can be obtained by running ccpd by hand. You ust first stop the ccpd service, then ensure that all the sub-processes are dead (
PS: You should really setup an udev rule, your script will come in the way sooner or later. There has been reports of users that had to plug the printer before starting ccpd for example. See #65069 (comment) |
Oh, I just found the culprit for the "'Can't connect to CCPD" cups status error. You need to define 59687 (the port configured in lpadmin) in ccpd.conf
It is in the sample ccpd.conf, but not in the one written by ccpdadmin on its first invocation. |
{
udev.extraRules = ''
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26da", ATTRS{serial}=="<your serial>", SYMLINK+="usb/lbp3010", GROUP="lp"
''; and you can get your serial number with
|
I try the updated code, it is not working yet The captstatusui now read
Update logs collection is on the same previous gist Please let me know if I did anything wrong or not including any information. |
It looks very promising. ccpd is running and listening on the right ports, you have the /dev/usb/lbp3050 symlink and the message from captstatusui is one that I have never seen and seems more advanced than what I got. One issue I have with your script is that it goes quite fast, and you may be missing failures at some stages. For example, the journalctl information that you obtained is heavily truncated. It stops right after starting the filters
Looking at the previous cups session (also included in the logs) I can see
which means that all the filters started, but the backend (ccp) failed, being incapable of connecting to ccpd. This issue should be solved now (it works for me here), so I guess you either have an old ccpd running (these processes are incredibly hard to kill) or you did not allow enough time for ccpd to start. killing ccpdTo kill it, use
and then force kill anything related to ccpd with
You should really kill manually all old ccpd before making a new attempt. testing ccpd connectionTo test that the server is reachable, you can use telnet:
telnet is quite explicit on failure:
testing cups filters + backend manuallyYou can debug printing issues manually by running the cups filters in a custom script
You should see the same error message by running this script as the one printed in cups logs. you can inspect the You need not be root to run this. Other worries/issues.I am a bit surprised that the owner of /dev/usb/lbp3050 is set to root:root but this is just a world readable symlink. What are the permissions and owners of /dev/bus/usb/001/006 ? The correct order seems to be
Calling ccpdadmin may require a ccpd restart to take the new configuration. Try not calling ccpdadmin when the setup is correct. If you are willing to give even more help, you can run ccp manually, with strace, like this: |
OK, let assume the problem is around I create
Please let me know if this help or not. |
''; | ||
|
||
buildPhase = '' | ||
make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make should be called by default already, you should be able to remove this.
libtool | ||
pkgconfig | ||
|
||
cndrvcups-common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some build tools here should go to nativeBuildInputs
:
cndrvcups-common | |
nativeBuildInputs = [ autoconf automake libtool pkgconfig ]; |
@wizzup Sorry, this erro comes from the manual call of ccp. You need "PRINTER" defined in the env:
In strace, ccp should exit with a normal value after having copied (read and written) it's data to ccpd socket. Then you will have to trace ccpd to find the real culprit for the issue you previously described. For ewample, when piping "lol" in ccp, I get a trace like this, meaning it works correctly. [pid 17494] brk(NULL) = 0xf9f000 [pid 17494] brk(0xfc0000) = 0xfc0000 [pid 17494] openat(AT_FDCWD, "/dev/urandom", O_RDONLY) = 3 [pid 17494] read(3, "3\223JN\304_v\21", 8) = 8 [pid 17494] close(3) = 0 [pid 17494] getrandom("\x35", 1, GRND_NONBLOCK) = 1 [pid 17494] stat("/etc/gnutls/default-priorities", 0x7ffd1779a1e0) = -1 ENOENT (No such file or directory) [pid 17494] rt_sigaction(SIGTERM, {sa_handler=0x401450, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f69599e6c50}, NULL, 8) = 0 [pid 17494] rt_sigaction(SIGPIPE, {sa_handler=0x401450, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f69599e6c50}, NULL, 8) = 0 this part looks like the one you got before your failure [pid 17494] read(0, "lol\n", 4088) = 4 you see that my dummy input is actually read [pid 17494] stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=287, ...}) = 0 [pid 17494] openat(AT_FDCWD, "/etc/host.conf", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) [pid 17494] futex(0x7f6959b65a04, FUTEX_WAKE_PRIVATE, 2147483647) = 0 [pid 17494] openat(AT_FDCWD, "/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 3 [pid 17494] fstat(3, {st_mode=S_IFREG|0644, st_size=287, ...}) = 0 [pid 17494] read(3, "# Generated by resolvconf [more resolv.cong data] \n", 4096) = 287 [pid 17494] read(3, "", 4096) = 0 [pid 17494] close(3) = 0 [pid 17494] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 [pid 17494] connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0 [pid 17494] sendto(3, "\2\0\0\0\r\0\0\0\6\0\0\0hosts\0", 18, MSG_NOSIGNAL, NULL, 0) = 18 [pid 17494] poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}]) [pid 17494] recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="hosts\0", iov_len=6}, {iov_base="\310O\3\0\0\0\0\0", iov_len=8}], msg_iovlen=2, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[4]}], msg_controllen=20, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 14 [pid 17494] mmap(NULL, 217032, PROT_READ, MAP_SHARED, 4, 0) = 0x7f6958ed9000 [pid 17494] close(4) = 0 [pid 17494] close(3) = 0 [pid 17494] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 [pid 17494] connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0 [pid 17494] sendto(3, "\2\0\0\0\4\0\0\0\n\0\0\0localhost\0", 22, MSG_NOSIGNAL, NULL, 0) = 22 [pid 17494] poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}]) [pid 17494] read(3, "\2\0\0\0\1\0\0\0\n\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\2\0\0\0\0\0\0\0", 32) = 32 [pid 17494] readv(3, [{iov_base="localhost\0", iov_len=10}, {iov_base="\177\0\0\1\177\0\0\1", iov_len=8}], 2) = 18 [pid 17494] close(3) = 0 [pid 17494] socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3 [pid 17494] connect(3, {sa_family=AF_INET, sin_port=htons(59687), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 Here the connection to ccpd is started [pid 17494] write(3, "CCP2\7\0\0\0LBP3050", 15) = 15 [pid 17494] read(3, "CCP3\1\0\0\0", 8) = 8 [pid 17494] write(3, "\1\0\0\0\4\0\0\0lol\n", 12) = 12 [pid 17494] read(3, "CCP3\1\0\0\0", 8) = 8 [pid 17494] read(0, "", 4088) = 0 [pid 17494] write(3, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 17494] read(3, "CCP3\1\0\0\0", 8) = 8 [pid 17494] close(3) = 0 [pid 17494] exit_group(0) = ? [pid 17494] +++ exited with 0 +++ And this is a clean exit, with the socket being closed and the return value set to 0. |
The ccp trace is perfect, the ccpd trace is strange. There are a lot of To kill ccpd properly, you first need to Not sure if you run your entire script with sudo, but ccpd needs admin rigts to run properly. You have to sudo strace it. (strace sudo does not work because sudo does not allow being traced) |
Hello, I'm a bot and I thank you in the name of the community for your contributions. Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do: If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list. If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past. If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments. Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel. |
I marked this as stale due to inactivity. → More info |
Hey is there work done on this still? I know it's a bit niche but it would be nice if it got done cause probably people still need to use canon printers lol. |
Well, as you can see it is quite a complex issue, and I do not possess such a printer. So it is difficult to make progress. I guess this can be safely closed, and anyone can resume the job from here. |
Work in progress, need some help.
Motivation for this change
To fix #27323
Things done
The binaries are build from source successfully (thanks to @layus and @vcunat for helping me)
Things undone
systemd
service fileppd
files tocups
cups
steps to install the printer not included (eg. start the service) that should be done for NixOS'sconfiguration.nix
Note: I have merge the whole history from my repo, that's why the change is big. Have no idea to do it the other way to preserve contributions records form @layus
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)