dhruvvyas90 / qemu-rpi-kernel

Qemu kernel for emulating Rpi on QEMU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with emulation 0f raspi3

itolallen opened this issue · comments

qemu-system-aarch64 -M raspi3 -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -dtb dtbs/bcm2710-rpi-3-b-plus.dtb -sd 2020-02-13-raspbian-buster-lite.img -kernel kernel8.img -m 1G -smp 4 -serial stdio -usb -device usb-mouse -device usb-kbd

Result:
WARNING: Image format was not specified for '2020-02-13-raspbian-buster-lite.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-aarch64: Invalid SD card size: 1.72 GiB
SD card size has to be a power of 2, e.g. 2 GiB.
You can resize disk images with 'qemu-img resize '
(note that this will lose data if you make the image smaller than it currently is).

How to do?

Try qemu-img resize 2020-02-13-raspbian-buster-lite.img 2G

That's the way it works for example here: hardillb/dockerpi@2c90c4e

^^yeah that's how you fix the error resize it

Hi, I'm using a physical sd card on windows 10 and with the following command:

qemu-system-aarch64.exe -M raspi3b -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -dtb bcm2710-rpi-3-b-plus.dtb -hda \\.\PhysicalDrive2 -kernel kernel8.img -m 1G -smp 4 -serial stdio -usb -device usb-mouse -device usb-kbd

Is there any workaround to let qemu use it?
I guess qemu-img cannot resize a physical drive :)

@Gnafu : May be have it resized on RPi and then use the image / or use standard resizing commands as if you're using it on an RPi. I'm not sure if you can resize it using qemu-img. Hope this helps.

@dhruvvyas90 It's a physical drive, not an image.
I tried recompiling qemu without the check that prevents usage of non-multiple-of-two sized drives, but then it fails with another error (I don't recall the exact message)