I want to set the
TMP_WRITE_PROTECT (temporary write protection) bit on my sdcard
/dev/mmcblk0. I think this can be done by rewriting the CSD (card specific data) at
/sys/block/mmcblk0/device/csd, but surely there's already a Linux tool to do all that bit-banging and recalculate the CRC?
I've found mmc-utils, but it seems to use an incompatible interface:
# mmc extcsd read /dev/mmcblk0 ioctl: Connection timed out Could not read EXT_CSD from /dev/mmcblk0 # mmc writeprotect get /dev/mmcblk0 ioctl: Connection timed out Could not read EXT_CSD from /dev/mmcblk0
And a Stack Overflow comment mentioned a command line tool called sdtool, but does not provide a URL...