On Saturday 19 January 2013 01:57:17 Jarl Friis wrote: > 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: [] > 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:[] [] > 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] [] > yaffs2_internal_read_super_mtd+0x19/0x30 [yaffs] > [21020.202748] [] mount_bdev+0x1cb/0x210 > [21020.202755] [] ? ida_get_new_above+0x218/0x2a0 > [21020.202761] [] ? > yaffs_internal_read_super.isra.17+0x9b0/0x9b0 [yaffs] > [21020.202767] [] yaffs2_mount+0x15/0x20 [yaffs] > [21020.202770] [] mount_fs+0x43/0x1b0 > [21020.202774] [] ? find_filesystem+0x63/0x80 > [21020.202778] [] vfs_kern_mount+0x74/0x110 > [21020.202782] [] do_kern_mount+0x54/0x110 > [21020.202786] [] do_mount+0x26a/0x890 > [21020.202791] [] ? strndup_user+0x5b/0x80 > [21020.202794] [] sys_mount+0x8d/0xe0 > [21020.202799] [] 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 [] > yaffs_internal_read_super.isra.17+0x2cb/0x9b0 [yaffs] > [21020.202852] RSP > [21020.202853] CR2: 0000000000000001 > [21020.202861] ---[ end trace 66076b41e0516697 ]--- > j > > > So any hints of what I am missing? Should this not be possible? The problem here is that you are trying to mount yaffs on a block device (that is what loop is). Yaffs works with mtd devices. For example, the PC-based Linux testing I do, I use the linux-tests/initramsim script to create a nand sim, then use mount -t yaffs2 /dev/mtdblock0 $MNTPT You might get a bit further by using the mtd tools to load that image as a simulated mtd device, but you might need to fiddle a bit to get the nandsim alignment figured out. -- Charles