nephix.wordpress.com


SD Karten Hotplug [engl]

Posted in Howto, IT by nephix on 1. April 2008

-=[ Howto auto hotplug SD Cards ]=-

1st Step:

Detect your Cardreader via typing

# lspci | grep SD

You will get an output like that:

03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter

2nd Step:

Next you login as root and type

# setpci -s 3:01.1 4c.b=0×02

whereas 3:01.1 you had to change with the output of step one.

3rd Step:

Test it, insert a SD card! If it doesn’t work, try something else. ;)
If you’re interested in auto hotplug your SD Cards at boot time follow the next step,
else you’re done here.

4th Step:

Be sure, you’re root and create new file in /etc/init.d/

# touch /etc/init.d/cardreader

Now …

# vim /etc/init.d/cardreader

and insert

#!/bin/bash

setpci -s nn:nn.n 4c.b=0×02

exit 0

and save with [esc]:wq

Now change permission of created file

# chmod 777 /etc/init.d/cardreader

Change to dir /etc/init.d/

# cd /etc/init.d/

On most distributions you can use `chkconfig`

# chkconfig -a cardreader

On gentoo

# rc-update add cardreader default

On Debian link the script to some /etc/rc* with ln -s

Done!

Leave a Reply