OK.

So I built the yaffs2 module for my ubuntu 12.10.
I did a
sudo insmod fs/yaffs2/yaffs.ko

Now I would expect to be able to mount a yaffs2 file system from the Android SDK,
so I copied
cp ~/opt/android-sdks/system-images/android-15/x86/system.img /tmp/
and did
sudo mkdir /mnt/android
and tried to mount it
sudo mount -t yaffs2 -o loop /tmp/system.img /mnt/android/

But nothing happens and dmesg shows:
[21020.202539] yaffs: dev is 7340035 name is "loop3" rw
[21020.202544] yaffs: passed flags ""
[21020.202547] yaffs: yaffs: Attempting MTD mount of 7.3,"loop3"
[21020.202577] BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
[21020.202581] IP: [<ffffffffa10a9d4b>] yaffs_internal_read_super.isra.17+0x2cb/0x9b0 [yaffs]
[21020.202593] PGD 5e2ec067 PUD 775b1067 PMD 0
[21020.202598] Oops: 0000 [#4] SMP
[21020.202602] CPU 1
[21020.202603] Modules linked in: yaffs vmnet(O) vsock(O) vmci(O) vmmon(O) dm_crypt nvidia(PO) pata_pcmcia snd_hda_codec_analog arc4 snd_hda_intel iwlwifi snd_hda_codec snd_hwdep snd_pcm tpm_infineon mac80211 snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq pcmcia snd_timer r852 snd_seq_device sm_common nand yenta_socket nand_ids mtd pcmcia_rsrc cfg80211 nand_bch bch pcmcia_core bnep rfcomm snd coretemp nand_ecc r592 uvcvideo soundcore memstick snd_page_alloc bluetooth kvm_intel kvm joydev psmouse lpc_ich hp_wmi videobuf2_core hp_accel sparse_keymap videodev lis3lv02d cdc_acm videobuf2_vmalloc mxm_wmi videobuf2_memops microcode tpm_tis serio_raw wmi parport_pc mac_hid input_polldev ppdev nfsd nfs lockd fscache auth_rpcgss nfs_acl lp sunrpc parport binfmt_misc firewire_ohci sdhci_pci firewire_core crc_itu_t sdhci e1000e video
[21020.202676]
[21020.202678] Pid: 17928, comm: mount Tainted: P      D    O 3.5.0-22-generic #34-Ubuntu Hewlett-Packard HP EliteBook 8730w/30EC
[21020.202683] RIP: 0010:[<ffffffffa10a9d4b>]  [<ffffffffa10a9d4b>] yaffs_internal_read_super.isra.17+0x2cb/0x9b0 [yaffs]
[21020.202690] RSP: 0018:ffff88007757fc28  EFLAGS: 00010246
[21020.202693] RAX: ffffffffffffffed RBX: ffffffffa10bb8e1 RCX: 000000000000c25f
[21020.202695] RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000001
[21020.202697] RBP: ffff88007757fcd8 R08: 00000000000005c4 R09: 33706f6f6c222c33
[21020.202699] R10: 332e3720666f2074 R11: 2233706f6f6c222c R12: ffff880002f67000
[21020.202701] R13: 0000000000000002 R14: ffffffffffffffed R15: 0000000000000000
[21020.202704] FS:  00007f09509b0800(0000) GS:ffff88023fc80000(0000) knlGS:0000000000000000
[21020.202706] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[21020.202708] CR2: 0000000000000001 CR3: 0000000009907000 CR4: 00000000000407e0
[21020.202710] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[21020.202712] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[21020.202715] Process mount (pid: 17928, threadinfo ffff88007757e000, task ffff8801afb79700)
[21020.202717] Stack:
[21020.202719]  0000000000000000 ffff88022f0ad800 ffff880002f67000 000000003017c9c0
[21020.202724]  ffff88007757fca8 0000000000000000 0000000000000000 0000000000000000
[21020.202728]  0000000000000000 0000000000000000 6cff880000000000 ffff880033706f6f
[21020.202732] Call Trace:
[21020.202741]  [<ffffffffa10aa449>] yaffs2_internal_read_super_mtd+0x19/0x30 [yaffs]
[21020.202748]  [<ffffffff81184feb>] mount_bdev+0x1cb/0x210
[21020.202755]  [<ffffffff8132aa48>] ? ida_get_new_above+0x218/0x2a0
[21020.202761]  [<ffffffffa10aa430>] ? yaffs_internal_read_super.isra.17+0x9b0/0x9b0 [yaffs]
[21020.202767]  [<ffffffffa10a6515>] yaffs2_mount+0x15/0x20 [yaffs]
[21020.202770]  [<ffffffff81185b23>] mount_fs+0x43/0x1b0
[21020.202774]  [<ffffffff8119ef23>] ? find_filesystem+0x63/0x80
[21020.202778]  [<ffffffff8119fdf4>] vfs_kern_mount+0x74/0x110
[21020.202782]  [<ffffffff811a0764>] do_kern_mount+0x54/0x110
[21020.202786]  [<ffffffff811a209a>] do_mount+0x26a/0x890
[21020.202791]  [<ffffffff8113dd2b>] ? strndup_user+0x5b/0x80
[21020.202794]  [<ffffffff811a280d>] sys_mount+0x8d/0xe0
[21020.202799]  [<ffffffff8168bd29>] system_call_fastpath+0x16/0x1b
[21020.202801] Code: 62 01 00 00 00 00 f0 74 0e 48 c7 c7 48 c9 0b a1 31 c0 e8 a5 c8 5c e0 8b 95 78 ff ff ff 41 bd 02 00 00 00 85 d2 0f 85 bb fe ff ff <41> 81 7e 14 00 02 00 00 0f 85 ad fe ff ff f7 05 b1 62 01 00 00
[21020.202845] RIP  [<ffffffffa10a9d4b>] yaffs_internal_read_super.isra.17+0x2cb/0x9b0 [yaffs]
[21020.202852]  RSP <ffff88007757fc28>
[21020.202853] CR2: 0000000000000001
[21020.202861] ---[ end trace 66076b41e0516697 ]---
j


So any hints of what I am missing? Should this not be possible?

Jarl