Jump to content

Running self-build image on QEMU arm64


Go to solution Solved by AlexK,

Recommended Posts

Posted

Hi!

 

Currently try to figure out how to run my freshly builded Armbian using QEMU arm64.

According to this tutorial: https://docs.armbian.com/Developer-Guide_Build-Preparation/  I prepare clean Jammy VM.

Build using this CMD: 

./compile.sh BOARD=qemu-uboot-arm64 BRANCH=current RELEASE=bookworm

 

Build process was going smoothly i pick up two files from output folder: 

1) Armbian-unofficial_24.5.0-trunk_Qemu-uboot-arm64_bookworm_current_6.6.29_minimal.img.qcow2 2) Armbian-unofficial_24.5.0-trunk_Qemu-uboot-arm64_bookworm_current_6.6.29_minimal.u-boot.bin

 

Currently boot up process stucked, i can run U-boot and mount qcow2 image using this CMD:

qemu-system-aarch64 \
-machine virt -cpu cortex-a57 \
-netdev user,id=net0 -device e1000,netdev=net0 \
-serial stdio \
-bios Armbian-unofficial_24.5.0-trunk_Qemu-uboot-arm64_bookworm_current_6.6.29_minimal.u-boot.bin \
-drive if=none,file=Armbian-unofficial_24.5.0-trunk_Qemu-uboot-arm64_bookworm_current_6.6.29_minimal.img.qcow2,id=mydisk \
-device ich9-ahci,id=ahci \
-device ide-hd,drive=mydisk,bus=ahci.0

 

U-boot see the drive with rootfs, but during boot process i had this error:

Failed to load '/boot/uInitrd'
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
Boot failed (err=-14)

 

Full boot process log:

U-Boot 2023.10-armbian (Mar 14 2024 - 01:18:23 +0000)

DRAM:  128 MiB
Core:  51 devices, 14 uclasses, devicetree: board
Flash: 64 MiB
Loading Environment from Flash... *** Warning - bad CRC, using default environment

In:    pl011@9000000
Out:   pl011@9000000
Err:   pl011@9000000
Net:   e1000: 52:54:00:12:34:56
       eth0: e1000#0
Hit any key to stop autoboot:  0 
Scanning for bootflows in all bootdevs
Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------  ----------------
Scanning global bootmeth 'efi_mgr':
Scanning bootdev 'fw-cfg@9020000.bootdev':
fatal: no kernel available
No working controllers found
scanning bus for devices...
Target spinup took 0 ms.
SATA link 1 timeout.
SATA link 2 timeout.
SATA link 3 timeout.
SATA link 4 timeout.
SATA link 5 timeout.
AHCI 0001.0000 32 slots 6 ports 1.5 Gbps 0x3f impl SATA mode
flags: 64bit ncq only 
  Device 0: (0:0) Vendor: ATA Prod.: QEMU HARDDISK Rev: 2.5+
            Type: Hard Disk
            Capacity: 54564.0 MB = 53.2 GB (111747072 x 512)
Scanning bootdev 'ahci_scsi.id0lun0.bootdev':
  0  script       ready   scsi         1  ahci_scsi.id0lun0.bootdev /boot/boot.scr
** Booting bootflow 'ahci_scsi.id0lun0.bootdev.part_1' with script
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: QEMU HARDDISK Rev: 2.5+
            Type: Hard Disk
            Capacity: 54564.0 MB = 53.2 GB (111747072 x 512)
Device 0: (0:0) Vendor: ATA Prod.: QEMU HARDDISK Rev: 2.5+
            Type: Hard Disk
            Capacity: 54564.0 MB = 53.2 GB (111747072 x 512)
<DIR>       4096 .
<DIR>       4096 ..
<SYM>         28 Image
<SYM>         24 dtb
<DIR>       4096 dtb-6.6.29-current-arm64
           38518 boot.bmp
               0 .next
<SYM>         28 uInitrd
             906 boot.cmd
         6040046 System.map-6.6.29-current-arm64
             978 boot.scr
        49178863 uInitrd-6.6.29-current-arm64
          318778 config-6.6.29-current-arm64
        38134272 vmlinuz-6.6.29-current-arm64
        49178799 initrd.img-6.6.29-current-arm64
KERNEL LOAD ADDRESS: kernel_addr_r : 0x40400000
INITRD LOAD ADDRESS: ramdisk_addr_r: 0x44000000
FDT LOAD ADDRESS   : fdt_addr      : 0x40000000
38134272 bytes read in 853 ms (42.6 MiB/s)
** Reading file would overwrite reserved memory **
Failed to load '/boot/uInitrd'
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
Boot failed (err=-14)
---  -----------  ------  --------  ----  ------------------------  ----------------
(1 bootflow, 1 valid)

 

Any ideas what i'm doing wrong?

  • Solution
Posted

The problem was with -m flag, i forget to allocate enough memory for VM to start, so working CMD:

qemu-system-aarch64 \
-machine virt -cpu cortex-a57 -m 512 \
-netdev user,id=net0 -device e1000,netdev=net0 \
-serial stdio \
-bios Armbian-unofficial_24.5.0-trunk_Qemu-uboot-arm64_bookworm_current_6.6.29_minimal.u-boot.bin \
-drive if=none,file=Armbian-unofficial_24.5.0-trunk_Qemu-uboot-arm64_bookworm_current_6.6.29_minimal.img.qcow2,id=mydisk \
-device ich9-ahci,id=ahci \
-device ide-hd,drive=mydisk,bus=ahci.0

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines