Skip to main content
Topic: Missing /dev/sgX and makedev (Read 1091 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Missing /dev/sgX and makedev

With an Epson Perfection 1250 scanner I needed to get the plustek backend to be used, so following instructions I made this file:
Code: [Select]
/usr/local/etc/sane.d/plustek.conf:
[usb] Epson 0x04B8
device auto
While doing this I found there was no /dev/sgX or /dev/scanner type device created. The only place it appeared in /dev was as a usb device, but the number changes when unplugged and replaced, and it is in a different directory when a different USB port is used so that is not so helpful:

Code: [Select]
$ ls -l /dev/bus/usb/006/005
crw-rw-r--+ 1 root scanner 189, 644 Aug 19 13:42 /dev/bus/usb/006/005
$ ls -l /dev/bus/usb/007/002
crw-rw-r--+ 1 root scanner 189, 769 Aug 19 21:25 /dev/bus/usb/007/002

Luckily the "device auto" line works and auto finds the scanner without specifying a particular special device. But I wondered if there is something missing in the Artix config that should be auto creating a more usable / predictable device node.
I also looked at creating the missing thing manually, although didn't pursue it after the scanner worked (although after doing 2 or 3 scans half the image is yellow tinged and the other half red tinged so you have to turn off the scanner and shut xsane then start again), and I found there are 2 man pages for makedev on my OS:
Code: [Select]
$ pacman -Qo /usr/share/man/man3/gnu_dev_makedev.3.gz
/usr/share/man/man3/gnu_dev_makedev.3.gz is owned by man-pages 5.02-1
$ pacman -Qo /usr/share/man/man3/makedev.3.gz
/usr/share/man/man3/makedev.3.gz is owned by man-pages 5.02-1
But there is no makedev anywhere, so why have the man pages? Or there should be a makedev to go with them. Not much sense like it is I think.  :P

Re: Missing /dev/sgX and makedev

Reply #1
While doing this I found there was no /dev/sgX or /dev/scanner type device created
That's not how you check for scanner. Use scanimage -L command instead

If it still doesn't work. Ensure your user account has access to the scanner by adding it to the scanner group

root #gpasswd -a <username> scanner

Ensure as well that eudev-openrc (or eudev-runit) is installed and make sure eudev service were running and added to the sysvinit runlevel

Wikis you should read:
https://wiki.gentoo.org/wiki/SANE
https://wiki.archlinux.org/index.php/SANE

But there is no makedev anywhere, so why have the man pages? Or there should be a makedev to go with them. Not much sense like it is I think.  :P

Yes, it wouldn't make sense if you didn't read the manpages.

makedev() as well as major() and minor() are functions used to manage device ID number. They can be used if we add #include <sys/sysmacros.h> in some script. sysmacro.h itself can be found in /usr/include/sys/sysmacros.h provided by glibc package
If I can hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate!

 

Re: Missing /dev/sgX and makedev

Reply #2
OK, thank you for the relevant info.
I had looked on TLDP Scanner-HOWTO but now you mention it the command they use is actually MAKEDEV in capitals, it's an RPM (MAKEDEV) and deb (makedev) package but doesn't exist in Arch anywhere and is probably an outdated way to do things. So you are right, that does make sense after all.
If I plug in a USB stick it appears as /dev/bus/usb/00x/00x but also as /dev/sdx so that's what is not happening with a scanner, also I think a printer will appear as /dev/lpx so it works for other things, you wouldn't have to search about to find them if you ever wanted to address them directly and other distros seem to have a /dev/sgx or /dev/scanner or something. Not that it's terribly important if nobody else has even noticed this I suppose.