diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index 779bc87b0b..68b62270ce 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -79,8 +79,8 @@ nearest_power_of_2() { done echo $p } -if [ "$SERENITY_ARCH" = "aarch64" ]; then - # The Aarch64 port loads from an SD card, which must have a size that is a power of 2 +if [ "$SERENITY_ARCH" = "aarch64" ] || { [ -n "$SERENITY_USE_SDCARD" ] && [ "$SERENITY_USE_SDCARD" -eq 1 ]; }; then + # SD cards must have a size that is a power of 2. The Aarch64 port loads from an SD card. DISK_SIZE_BYTES=$(nearest_power_of_2 "$DISK_SIZE_BYTES") fi diff --git a/Meta/run.sh b/Meta/run.sh index 1a4d9b9667..e9615265e4 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -254,6 +254,11 @@ else fi fi +if [ "$SERENITY_USE_SDCARD" -eq 1 ]; then + SERENITY_BOOT_DRIVE="-device sdhci-pci -device sd-card,drive=sd-boot-drive -drive id=sd-boot-drive,if=none,format=raw,file=${SERENITY_DISK_IMAGE}" + SERENITY_KERNEL_CMDLINE="$SERENITY_KERNEL_CMDLINE root=sd2:0:0" +fi + if [ -z "$SERENITY_HOST_IP" ]; then SERENITY_HOST_IP="127.0.0.1" fi