qemu-rpi-kernel icon indicating copy to clipboard operation
qemu-rpi-kernel copied to clipboard

Problem with emulation 0f raspi3

Open itolallen opened this issue 4 years ago • 5 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?

itolallen avatar Jan 13 '21 02:01 itolallen

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

That's the way it works for example here: https://github.com/hardillb/dockerpi/commit/2c90c4eb6bbaa028a13de61767fb6f80787b23d4

mrtwnklr avatar Jan 13 '21 21:01 mrtwnklr

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

MrDiagnose avatar Jan 16 '21 15:01 MrDiagnose

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 avatar May 19 '22 14:05 Gnafu

@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 avatar Jun 08 '22 15:06 dhruvvyas90

@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)

Gnafu avatar Jun 08 '22 15:06 Gnafu