agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
548 stars 417 forks source link

Kirkstone on raspberry pi won't boot #1112

Open weiqj opened 2 years ago

weiqj commented 2 years ago

I am using this repo with meta-rpi. Honister boots perfectly. However kirkstone won't.

Hardware is Raspberry Pi 4.

Also, how to enable serial print out of kernel and rootfs logs? Adding ENABLE_UART = "1" in local.conf only enables login terminal on serial.

nickbetteridge commented 2 years ago

I can confirm this - using a rpi4b, I get a quick bios raspberry image then the hdmi dies. Uart throws out an 'ERR'

agherzan commented 2 years ago

@weiqj have you tried a "dry" build with a minimum set of kirkstone layers, ENABLE_UART=1, one a basic image (core-image-base)? @nickbetteridge have you checked your board against a RaspberryPi OS image?

nickbetteridge commented 2 years ago

@agherzan I haven't checked against a RaspberryPi OS image, but I have just tried a rpi4_64 buildroot image, which also failed - however, the buildroot non-64 image worked - I suspect it's the same with meta-raspberrypi - I'll try and find time to try meta-raspberrypi out with machine=raspberrypi4

agherzan commented 2 years ago

Can you update your initial report with a clear and minimum set of build steps that reproduces this issue?

nickbetteridge commented 2 years ago

I used docker -

RUN git clone -b kirkstone git://git.yoctoproject.org/poky.git

WORKDIR /home/nick/poky

RUN git clone -b kirkstone https://github.com/openembedded/meta-openembedded.git

RUN git clone -b kirkstone git://git.yoctoproject.org/meta-virtualization

RUN /bin/bash -c "source ./oe-init-build-env \
    && bitbake-layers add-layer ../meta-openembedded/meta-oe \
    && bitbake-layers add-layer ../meta-openembedded/meta-python \
    && bitbake-layers add-layer ../meta-openembedded/meta-networking \
    && bitbake-layers add-layer ../meta-openembedded/meta-filesystems \
    && bitbake-layers add-layer ../meta-openembedded/meta-perl \
    && bitbake-layers add-layer ../meta-virtualization" || true

WORKDIR /home/nick/poky/build

RUN echo 'DISTRO_FEATURES += " virtualization"' >> conf/local.conf
RUN echo 'ENABLE_UART = "1"' >> conf/local.conf

WORKDIR /home/nick/poky

RUN git clone -b kirkstone git://git.yoctoproject.org/meta-raspberrypi.git

RUN /bin/bash -c "source ./oe-init-build-env \
    && bitbake-layers add-layer ../meta-raspberrypi" || true

WORKDIR /home/nick/poky/build

RUN echo 'MACHINE = "raspberrypi4-64"' >> conf/local.conf

WORKDIR /home/nick/poky

RUN /bin/bash -c "source ./oe-init-build-env && bitbake core-image-minimal" || true
agherzan commented 2 years ago

@nickbetteridge That is not a minimum set of reproducible steps. I would expect a setup that has oe-core + meta-rpi with specific revisions, poky distro and a core image.

weiqj commented 1 year ago

I am building 32 bit image of Raspberry Pi 4. I noticed that the green led flashes 7 times, which indicates "kernel.img not found". But I already put zImage onto the SD card.

weiqj commented 1 year ago

Nevermind, I renamed zImage into kernel.img, now the Rpi4 is able to boot correctly. meta-rpi script needs to be modified copy_boot.sh, line 199: from sudo cp "${src}/${KERNEL_IMAGETYPE}" "${mnt}/${KERNEL_IMAGETYPE}" to sudo cp "${src}/${KERNEL_IMAGETYPE}" "${mnt}/kernel.img"

I am wondering why it worked before.

agherzan commented 1 year ago

What script is that? I'm missing a bit of context here.

weiqj commented 1 year ago

What script is that? I'm missing a bit of context here.

The script is "copy_boot.sh" from meta-rpi. It literally copies "zImage" to the boot partition. Apparently somehow the new bootloader expects a file name of "kernel.img"

Renaming zImage into kernel.img solves the problem. I am wondering why the name zImage worked before.

agherzan commented 1 year ago

Sorry, what is meta-rpi?

weiqj commented 1 year ago

https://github.com/jumpnow/meta-rpi

I-am-Harsh commented 1 year ago

I have run into this same issue, dunfell through honister work fine. The rpi starts booting, I am able to see the boot screen for about 1 sec or less, and there is blackout, HDMI output stops, there is no ACT light blinks. I have been trying to use core-image-minimal and core-image-minimal-dev, my bb layers are -->

\
  /local/home/harshmav/rpi_builds/kirkstone/poky/meta \
  /local/home/harshmav/rpi_builds/kirkstone/poky/meta-poky \
  /local/home/harshmav/rpi_builds/kirkstone/poky/meta-yocto-bsp \
/local/home/harshmav/rpi_builds/kirkstone/poky/meta-raspberrypi  "

The only other change that I have done except for adding the BSP is specifying the machine and image type

FederAndInk commented 1 year ago

This seems to be linked to https://github.com/agherzan/meta-raspberrypi/issues/1079