Skip to main content
deleted 26 characters in body
Source Link
Chan Kim
  • 459
  • 1
  • 13
  • 28

It shows no process there. What am I doing wrong in making initrd.img file?

It shows no process there. What am I doing wrong in making initrd.img file?

It shows no process there. What am I doing wrong?

added 1042 characters in body
Source Link
Chan Kim
  • 459
  • 1
  • 13
  • 28

I'm trying to run u-boot on qemu arm64 virtual machine. (qemu 6.2.0, u-boot v2022.07) so I compiled u-boot using qemu_arm64_defconfig, it does build u-boot (and not u-boot-spl). I made initrd following http://lists.busybox.net/pipermail/busybox/2004-September/046827.htmlU-Boot "Wrong Ramdisk Image Format" with initramfs on BeagleBone black. This is the command I made the initrd.img with.

Create a 2MB file # dd if=/dev/zero of=initrdfs bs=1024 count=40960 Make a file system out of it # mke2fsmkimage -N 1024 initrdfs Now mount it using loop back (make sure you have loop driver) # sudoA mountarm64 -o loop initrdfs /mnt Copy your busybox onto the newfile system #T cpramdisk -dpRd busybox/_install../* ../mnt../ unmount it busybox- #umount 1.32.1/mnt compress it with gzip # gzip -9c initrdfs >initramfs.cpio.gz initrd.img 

So, referencing the above environment variables, this is the command I ran qemu with.(qemu generates the dtb at the first DRAM location, 0x40000000).

=> booti 0x40400000 0x44000000 0x40000000  Wrong## Loading init Ramdisk from Legacy Image Formatat 44000000 ... Image Name: Created: 2023-05-30 2:50:14 UTC  Image Type: AArch64 Linux RAMDisk Image (gzip compressed) Data Size: 6671800 Bytes = 6.4 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 40000000 Booting using the fdt blob at 0x40000000 Loading Ramdisk imageto isbe771000, corruptend orbedcddb8 invalid... OK Loading Device Tree to 00000000be66e000, end 00000000be770fff ... OK Starting kernel ... 

It shows no process there. What am I doing wrong in making initrd.img file?

And when u-boot runs (before I give booti command), previously before I give booti command above at the prompt, I see this output.

U-Boot 2022.07 (May 29 2023 - 16:05:33 +0900) DRAM: 2 GiB Core: 45 devices, 12 uclasses, devicetree: board Flash: 32 MiB Loading Environment from Flash... *** Warning - bad CRC, using default environment In: pl011@9000000 Out: pl011@9000000 Err: pl011@9000000 Net: eth0: virtio-net#32 Hit any key to stop autoboot: 0 starting USB... No working controllers found USB is stopped. Please issue 'usb start' first. scanning bus for devices... Device 0: unknown device Device 0: 1af4 VirtIO Block Device Type: Hard Disk Capacity: 6.8 MB = 0.0 GB (14024 x 512) ... is now current device ** No partition table - virtio 0 ** Couldn't find partition virtio 0:1 Device 0: unknown device starting USB... No working controllers found BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (2 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40200000 Loading: * TFTP error: 'Access violation' (2) Not retrying... BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (0 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40400000 Loading: * TFTP error: 'Access violation' (2) Not retrying... 

it looks like u-boot is trying to load uboot.scr.uimg file at 0x40200000. What is uboot.scr.uimg and how can I make it?

I'm trying to run u-boot on qemu arm64 virtual machine. (qemu 6.2.0, u-boot v2022.07) so I compiled u-boot using qemu_arm64_defconfig, it does build u-boot (and not u-boot-spl). I made initrd following http://lists.busybox.net/pipermail/busybox/2004-September/046827.html. This is the command I made the initrd.img with.

Create a 2MB file # dd if=/dev/zero of=initrdfs bs=1024 count=40960 Make a file system out of it # mke2fs -N 1024 initrdfs Now mount it using loop back (make sure you have loop driver) # sudo mount -o loop initrdfs /mnt Copy your busybox onto the newfile system # cp -dpR busybox/_install/* /mnt/ unmount it - #umount /mnt compress it with gzip # gzip -9c initrdfs > initrd.img 

So, referencing the above environment variables, this is the command I ran qemu.(qemu generates the dtb at the first DRAM location, 0x40000000).

=> booti 0x40400000 0x44000000 0x40000000 Wrong Ramdisk Image Format Ramdisk image is corrupt or invalid 

What am I doing wrong in making initrd.img file?

And when u-boot runs (before I give booti command), I see this output.

Device 0: unknown device starting USB... No working controllers found BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (2 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40200000 Loading: * TFTP error: 'Access violation' (2) Not retrying... BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (0 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40400000 Loading: * TFTP error: 'Access violation' (2) Not retrying... 

looks like u-boot is trying to load uboot.scr.uimg file at 0x40200000. What is uboot.scr.uimg and how can I make it?

I'm trying to run u-boot on qemu arm64 virtual machine. (qemu 6.2.0, u-boot v2022.07) so I compiled u-boot using qemu_arm64_defconfig, it does build u-boot (and not u-boot-spl). I made initrd following U-Boot "Wrong Ramdisk Image Format" with initramfs on BeagleBone black. This is the command I made the initrd.img with.

mkimage -A arm64 -T ramdisk -d ../../../busybox-1.32.1/initramfs.cpio.gz initrd.img 

So, referencing the above environment variables, this is the command I ran qemu with.(qemu generates the dtb at the first DRAM location, 0x40000000).

=> booti 0x40400000 0x44000000 0x40000000  ## Loading init Ramdisk from Legacy Image at 44000000 ... Image Name: Created: 2023-05-30 2:50:14 UTC  Image Type: AArch64 Linux RAMDisk Image (gzip compressed) Data Size: 6671800 Bytes = 6.4 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 40000000 Booting using the fdt blob at 0x40000000 Loading Ramdisk to be771000, end bedcddb8 ... OK Loading Device Tree to 00000000be66e000, end 00000000be770fff ... OK Starting kernel ... 

It shows no process there. What am I doing wrong in making initrd.img file?

And when u-boot runs (before I give booti command), previously before I give booti command above at the prompt, I see this output.

U-Boot 2022.07 (May 29 2023 - 16:05:33 +0900) DRAM: 2 GiB Core: 45 devices, 12 uclasses, devicetree: board Flash: 32 MiB Loading Environment from Flash... *** Warning - bad CRC, using default environment In: pl011@9000000 Out: pl011@9000000 Err: pl011@9000000 Net: eth0: virtio-net#32 Hit any key to stop autoboot: 0 starting USB... No working controllers found USB is stopped. Please issue 'usb start' first. scanning bus for devices... Device 0: unknown device Device 0: 1af4 VirtIO Block Device Type: Hard Disk Capacity: 6.8 MB = 0.0 GB (14024 x 512) ... is now current device ** No partition table - virtio 0 ** Couldn't find partition virtio 0:1 Device 0: unknown device starting USB... No working controllers found BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (2 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40200000 Loading: * TFTP error: 'Access violation' (2) Not retrying... BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (0 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40400000 Loading: * TFTP error: 'Access violation' (2) Not retrying... 

it looks like u-boot is trying to load uboot.scr.uimg file at 0x40200000. What is uboot.scr.uimg and how can I make it?

Source Link
Chan Kim
  • 459
  • 1
  • 13
  • 28

Testing u-boot on qemu arm64 virtual machine

I'm trying to run u-boot on qemu arm64 virtual machine. (qemu 6.2.0, u-boot v2022.07) so I compiled u-boot using qemu_arm64_defconfig, it does build u-boot (and not u-boot-spl). I made initrd following http://lists.busybox.net/pipermail/busybox/2004-September/046827.html. This is the command I made the initrd.img with.

Create a 2MB file # dd if=/dev/zero of=initrdfs bs=1024 count=40960 Make a file system out of it # mke2fs -N 1024 initrdfs Now mount it using loop back (make sure you have loop driver) # sudo mount -o loop initrdfs /mnt Copy your busybox onto the newfile system # cp -dpR busybox/_install/* /mnt/ unmount it - #umount /mnt compress it with gzip # gzip -9c initrdfs > initrd.img 

I saw in include/configs/qemu-arm.h,

#define CONFIG_EXTRA_ENV_SETTINGS \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ "fdt_addr=0x40000000\0" \ "scriptaddr=0x40200000\0" \ "pxefile_addr_r=0x40300000\0" \ "kernel_addr_r=0x40400000\0" \ "ramdisk_addr_r=0x44000000\0" \ BOOTENV 

So, referencing the above environment variables, this is the command I ran qemu.(qemu generates the dtb at the first DRAM location, 0x40000000).

 qemu-system-aarch64 -machine virt,gic-version=max,secure=on,virtualization=true -cpu max u-boot -m 2G -nographic -bios u-boot.bin -device loader,file=linux-5.15.68/arch/arm64/boot/Image,addr=0x40400000 -device loader,file=initrd.img,addr=0x44000000 

u-boot runs and command prompt comes up. So I ran

=> booti 0x40400000 0x44000000 0x40000000 Wrong Ramdisk Image Format Ramdisk image is corrupt or invalid 

What am I doing wrong in making initrd.img file?

And when u-boot runs (before I give booti command), I see this output.

Device 0: unknown device starting USB... No working controllers found BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (2 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40200000 Loading: * TFTP error: 'Access violation' (2) Not retrying... BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (0 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40400000 Loading: * TFTP error: 'Access violation' (2) Not retrying... 

looks like u-boot is trying to load uboot.scr.uimg file at 0x40200000. What is uboot.scr.uimg and how can I make it?