qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Using qemu to access a raw dump from a nand


From: Peter Maydell
Subject: Re: [Qemu-discuss] Using qemu to access a raw dump from a nand
Date: Tue, 9 Jul 2019 09:35:38 +0100

On Mon, 8 Jul 2019 at 18:20, Andre Cirne <address@hidden> wrote:
> I would like to mount on a virtual machine a partition wich is on a  dump
> of a nand flash.
> This disk would not be the primary disk but a secondary disk.
>
> I am using the next command to create the virtual machine.
>
> qemu-system-arm -nographic -M virt -m 64   -device
> nand,chip_id=0x59,id=myubiflash  -drive
> if=mtd,format=raw,file=100000.ubi,id=myubiflash
> openwrt-armvirt-32-zImage-initramfs

I don't think '-device nand' is likely to actually do
anything useful on the 'virt' board.

The virt board supports a couple of flash devices but they
are intended for the UEFI bios and it's unlikely that putting
your flash blob there is going to help much. QEMU doesn't
care whether a drive image came from a NAND flash originally
or anything else, so the simplest approach is probably to
create a virtio-blk and use your flash dump as the disk
image. That will let your guest access it as a block device
(mount it if it has a filesystem, or just do raw reads of it
if not).

> qemu-system-arm: -drive if=mtd,format=raw,file=100000.ubi,id=myubiflash:
> machine type does not support if=mtd,bus=0,unit=0

if=mtd says "try to plug this device into the system as MTD",
and so the error is telling you "this system doesn't have any
way to plug in MTD".

(This is an aside, because I don't think that fixing this
is going to help you, but: your id= options look odd. Generally
you specify id=myname on the -drive (which gives it a name),
and then you specify drive=myname on some other option (which
I would guess here would be the -device nand...) to say
"use this specific drive". (If you do this style of things you
want if=none, to say "don't try to autoplug this"; otherwise
QEMU will complain that you've tried to do two things with
the drive at once.) You don't want to give two different objects
the same id=name (as you've done with the drive and the nand device)
because then you can't tell them apart.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]