문제

I'm building a custom linux kernel that should be able to access cdrom and usb mass storage devices, but not hard disks.

I tried disabling CONFIG_BLK_DEV_SD, but I lose usb mass storage support.

How can I achieve that? If not possible, is there a way to remove hard disk nodes in /dev at startup?

도움이 되었습니까?

해결책

First, you need to define, what exactly "hard disk" means.

Second, you need to express the above definition as a set of udev rules. This way, device nodes for devices you don't want would not even get created in /dev/ in the first place.

One nice tutorial for udev rules is here:

http://www.reactivated.net/writing_udev_rules.html

Relevant Q/A: https://unix.stackexchange.com/questions/66897/what-is-the-udev-rule-to-allow-specific-thumb-drive-vendors

다른 팁

Frankly, I'm amazed you even managed a bootable system with CONFIG_BLK_DEV_SD disabled: modern Linux kernels funnel virtually all storage I/O through the SCSI layer, then treat the specific types (SATA, PATA, USB mass storage, etc.) as flavors of SCSI.

I'd try disabling things at the next layer down in the system: enable SCSI disk and CD-ROM support, then disable all methods of actually talking to those disks: low-level SCSI drivers, ATA SFF support, ACHI support, etc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top