module for usb pen drive - c

I am making a module to do some basic stuff in my pen drive following the example here . its stating that the usb storage(in my case pen drive) device uses usb-storage driver . I saw in hardware info that its usb_storage(which is same as usb-storage as when i do rmmod usb -storage it states that ERROR: Module usb_storage does not exist in /proc/modules) . I have done even lsmod with and without device its not showing any module name usb-storage.
My doubt is simple how to know which module controles which device and i know it could be unloaded by rmmod (module name).

Assuming that your kernel actually has usb-storage support this means the module is built in to the kernel and cannot be removed.
Try rebuilding your kernel after changing the usb-storage support to be built as a module, rather than directly into the kernel.

There should be no problem removing the module if you are the Super user. Otherwise, change to super user then try to remove it. It can be done by sudo su command.
And for the list of modules being used, you can view the device log by dmesg and check out.

Related

google coral dev board wont boot from usb otg

I am trying to use serial download with the google coral dev board with uuu, imx_usb_loader, or similar. I have a working uboot, but it does not appear to have the necessary usb functionality built into the spl because I get this error.
U-Boot SPL 2022.04 (Sep 01 2022 - 02:38:53 -0500)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3200MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
SPL: Unsupported Boot Device 12
SPL: failed to boot from all boot devices (err=-6)
### ERROR ### Please RESET the board ###
I have the following added to my uboot config.
CONFIG_CMD_FASTBOOT=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_GADGET_MANUFACTURER="FSL"
CONFIG_USB_GADGET_VENDOR_NUM=0x0525
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
CONFIG_USB_DWC3=y
CONFIG_FSL_FASTBOOT=y
CONFIG_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x40480000
CONFIG_FASTBOOT_BUF_SIZE=0x40000000
CONFIG_FASTBOOT_FLASH=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
CONFIG_EFI_PARTITION=y
#CONFIG_ANDROID_BOOT_IMAGE=y
# SPL enalbe
CONFIG_SPL_USB_HOST_SUPPORT=y
CONFIG_SPL_USB_GADGET_SUPPORT=y
CONFIG_SPL_USB_SDP_SUPPORT=y
CONFIG_SDP_LOADADDR=0x40400000
CONFIG_SPL_SHOW_ERRORS=y
I have attempted to add spl_board_boot_device() to my common/spl/spl.c to no avail. I have also tried a great many other config options. Also no change, but somtimes there are compile errors... And I have made sure that the usb entries in the uboot dtsi are marked as "okay". I am not sure where to go from here. I am mainly using imx-uboot 2022.04 and mainline 2022.07

v4l2loopback "format not support" error in OBS Studio

I keep getting a weird error in OBS Studio while trying to enable my virtual camera, "format not support". This is after installing packages in Manjaro 19.0.2:
yay -S dkms linux56-headers
yay -S obs-v4l2sink v4l2loopback-dkms
Is this a OBS issue or a v4l2loopback one?
I found it. I forgot to run sudo modprobe v4l2loopback. It enables it I think.
Some stuff that help me figure out a similar issue:
Note that this issue can also arise from a video device that is not available e.g.
/dev/video1 when there is no active device /dev/video1 changing to another device e.g. /dev/video0 may resolve this error
list devices with:
ls /dev | grep video
you may be able to make additional devices available when you load the kernel module:
sudo modprobe v4l2loopback devices=2
See also:
https://github.com/CatxFish/obs-v4l2sink/issues/5

I2c eeprom file missing in user-space - SFP module

I have some linux kernel & SFP/I2C driver issue.
I am using a buildroot linux kernel for an embedded board.
I need to be able to read the eeprom file of the SFP i2c device.
1. working case:
When SFP module is inserted in my development unit board from the start (before the kernel loads up) then when startup completed i can see and read the eeprom file in the path: /sys/class/i2c-adapter/i2c-1/1-0050/eeprom
kernel prints on startup the i2c device scan result:
2. not working case:
If there is no SFP module inserted on startup,and kernel completes the boot procces, then when i'm inserting the SFP module in,i observe that the path:
/sys/class/i2c-adapter/i2c-1/1-0050/ DOESN'T include the eeprom file.
The device tree part of the sfp-eeprom code:
My guess is the SFP driver is responsible for that trigger that should happen once the SFP module is inserted, and should trigger the creation of eeprom file.
Would like to ask you what am i missing ?
some binding code from sfp driver to trigger the i2c scan or something?
Any suggestion?
Thanks in advance.
A possible workaround for this issue was found.
to use the ethtool -m interface.
from ethtool man page:
-m --dump-module-eeprom
Retrieves and if possible decodes the EEPROM from plugin modules, e.g SFP+, QSFP

usb connection event on linux without udev or libusb

I need to find a way to detect when a usb device is plugged in C on an old embedded Linux (CentOs 4).
libudev and libusb are not available so I'm a little clueless with my options here. There is dbus, however I cannot use udisks as the device I need to detect is not a storage device.
Thanks.
You can try to write a custom script and register it in /proc/sys/kernel/hotplug. When a uevent occurs, the kernel will invoke your script and pass the subsystem (usb in your case) as an argument. Then you will have to match the device (I don't know how to do that, that's probably the most tricky part).
Skeleton for your custom hotplug script that matches the USB subsystem:
$ cat my_hotplug.sh
#!/bin/sh
[ "$1" = usb ] || exit 0
echo "Do something here"
Registering your hotplug script as the uevent helper:
echo /path/to/my_hotplug.sh > /proc/sys/kernel/hotplug

What does Bad EIP value error means?

I've been writing some kernel module recently. For some modules everytime i insert them or remove them a huge kernel trace is shown on screen. The errors are somewhat like
ERROR: Bad EIP value.
or
ModuleName is tainted.
What does this imply. Any help is appreciated.
The Extended Instruction Pointer exists in x86 processors, but is somehow related to a missing WiFi driver, it seems:
Yesterday I could not reach this site and read your reactions, so I
experimented with several Linux versions: Xubuntu, Slacko-Puppy 5,4
Firefox ,Puppy Akita Beta and LinuxMintMaya. And with all the same
result, i.e. no result,
But in the last install - LinuxMintMaya - I discovered the problem,
which is be found here: http://www.linuxmint.com/rel_maya.php It
tells:
Boot hangs on systems using b43 wireless cards
So after entering this command
Code: sudo apt-get install firmware-b43-installer
LinuxMintMaya works.
To boot, the Mint page says:
An upstream issue in the kernel prevents Linux Mint 13 from booting on
computers with b43 wireless cards. If you're in this situation, try
the following:
To boot the live DVD, choose the "Compatibility mode" or add the
following kernel argument to the boot options: b43.blacklist=yes
Install Linux Mint on the hard drive If not present already, in Grub,
modify the boot options to add: b43.blacklist=yes Install the b43
firmware on the system

Resources