Comment 14 for bug 703180

Revision history for this message
C Michal (michal-physics) wrote : Re: SD card reader doesn't work on new Dell XPS

I set up a hot-key to call a tiny suid program that triggers the rescan. Works great.
Put the following in rescan.c:

#include <stdio.h>
main(){
  FILE *outfile;
  outfile=fopen("/sys/bus/pci/rescan","w");
  if (outfile != NULL){
    fprintf(outfile,"1\n");
    fclose(outfile);
  }
  else printf("permission denied\n");
}

then compile with:
gcc rescan.c -o rescan
sudo cp rescan /usr/local/bin
sudo chown root /usr/local/bin/rescan
sudo chmod u+s /usr/local/bin/rescan

then in system->preferences->keyboard shortcuts, create a custom keybinding (Add). The command should point to /usr/local/bin/rescan, and set whatever key combination you like - I used the gears button on the top left of the keyboard, which produces 'super-L'