Bug 465288

Summary: mtd modules not auto-loaded on OLPC
Product: [Fedora] Fedora Reporter: Jeremy Katz <katzj>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwmw2, harald
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-03 02:03:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 461806    

Description Jeremy Katz 2008-10-02 16:06:13 UTC
The MTD modules for the internal nand (cafe-nand and then the varioud mtd*) aren't getting auto-loaded by udev on the OLPC

Comment 1 David Woodhouse 2008-10-02 16:23:24 UTC
The CAFÉ driver should be automatically loaded by PCI hotplug, and it should appear in /proc/mtd. That's enough for you to mount a JFFS2 file system on it and start using it.

Neither mtdblock nor mtdchar drivers will get loaded by default though, so you'll have no user-visible device nodes, and won't be able to write images to it, etc.

For the installer, I suspect you just want to autoload the mtdchar module if there are MTD devices in the system?

MTD devices won't appear in the device model yet; I have code to fix that but it isn't ready to ship yet. You need to look in /proc/mtd.

Comment 2 Jeremy Katz 2008-10-02 17:12:03 UTC
Hmmm, yeah, cafe-nand is getting auto-loaded (although it didn't look to be last time; not sure why.  I blame gremlins).  But I have no /proc/mtd at all.

FWIW, this isn't necessarily about the installer (although eventually it might be), but more about making the nand available when running off of a live image.

Comment 3 David Woodhouse 2008-10-02 18:45:52 UTC
It was gremlins that ate your /proc/mtd too. You can't have MTD devices in the system without /proc/mtd being present.

The NAND can be available and mounted as a file system, without either character or block device access being enabled. Just 'mount -tjffs2 mtd0 /mnt' or, by partition name, 'mount -tjffs2 mtd:rootfs /mnt' (not sure if you're using partitions).

Comment 4 David Woodhouse 2008-10-03 06:47:32 UTC
Well, arguably it _is_ a bug that the underlying MTD devices don't turn up in sysfs and HAL -- we could do something about that, and I'm working on it.

Attaching a character or block device to expose them to userspace is probably always going to be optional in the general case -- there will be people who just don't want that at all, because they only want to mount the file system.

Maybe we could automatically load the mtdchar.ko module whenever there are any MTD devices in the system for Fedora though?

How much does your problem get easier if you just autoload mtdchar.ko whenever mtd.ko is loaded? The char device should turn up in sysfs then, and a lot of stuff might 'just work' a little more as expected.