Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: incorrect package build for sunxi #7456

Closed
1 of 2 tasks
The-going opened this issue Nov 11, 2024 · 18 comments · Fixed by #7474
Closed
1 of 2 tasks

[Bug]: incorrect package build for sunxi #7456

The-going opened this issue Nov 11, 2024 · 18 comments · Fixed by #7474
Labels
Bug Something isn't working as it should

Comments

@The-going
Copy link
Contributor

The-going commented Nov 11, 2024

What happened?

The overlays folder is missing:
/boot/dtb-*-sunxi/overlays/
files (*.dtb and *.dtbo) are in the same folder.
Other files are missing.

The error has been detected and published: 243
breake-dtb-overlay

How to reproduce?

Build kernel for any sunxi board.

Branch

main (main development branch)

On which host OS are you running the build script and observing this problem?

Ubuntu 24.04

Are you building on Windows WSL2?

  • Yes, my Ubuntu/Debian/OtherOS is running on WSL2

Relevant log URL

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@The-going The-going added the Bug Something isn't working as it should label Nov 11, 2024
Copy link

github-actions bot commented Nov 11, 2024

Jira ticket: AR-2529

@The-going
Copy link
Contributor Author

The-going commented Nov 11, 2024

test (1): build for sunxi64 current v6.6.60 - successfully; all files and folders are present!

@The-going
Copy link
Contributor Author

test (2): build for sunxi current v6.6.60 - successfully; all files and folders are present!

@The-going
Copy link
Contributor Author

test (3): build for sunxi edge v6.11.6 - broken

@igorpecovnik
Copy link
Member

Strange. @stephengraf reported:

"Testing oranpione debian current for Nov release.
v24.11 rolling for Orange Pi One running Armbian Linux 6.6.54-current-sunxi"

@The-going
Copy link
Contributor Author

For CURRENT dtb pkg all files and folders are present!
It is local building.

For EDGE scripts/Makefile.dtbinst work incorrect

@igorpecovnik
Copy link
Member

It is local building.

Nightly builds should also be o.k., verifying asap.

@The-going
Copy link
Contributor Author

Check:
It should look like this:

[🌱] Packaging linux-dtb [ sunxi linux-sunxi-edge ]
[🔨]   [5.0M]  /home/leo/armbian/.tmp/work-b358f2c1-c646-4c4f-8e06-c94271acf8e4/kernel_dest_install_dir-n4Tnt/dtbs
[🔨]   └── [5.0M]  allwinner
[🔨]       ├── [ 95K]  overlay
[🔨]       │   ├── [5.3K]  README.sun4i-a10-overlays
[🔨]       │   ├── [3.2K]  README.sun5i-a13-overlays
[🔨]       │   ├── [6.7K]  README.sun7i-a20-overlays
[🔨]       │   ├── [4.8K]  README.sun8i-h3-overlays
[🔨]       │   ├── [ 267]  sun4i-a10-analog-codec.dtbo
[🔨]       │   ├── [ 387]  sun4i-a10-can.dtbo
[🔨]       │   ├── [4.7K]  sun4i-a10-fixup.scr
[🔨]       │   ├── [ 500]  sun4i-a10-i2c1.dtbo
[🔨]       │   ├── [ 500]  sun4i-a10-i2c2.dtbo
....
[🔨]       │   ├── [ 505]  sun8i-r40-uart5.dtbo
[🔨]       │   └── [ 505]  sun8i-r40-uart7.dtbo
[🔨]       ├── [ 33K]  sun4i-a10-a1000.dtb
[🔨]       ├── [ 30K]  sun4i-a10-ba10-tvbox.dtb
[🔨]       ├── [ 30K]  sun4i-a10-chuwi-v7-cw0825.dtb
[🔨]       ├── [ 33K]  sun4i-a10-cubieboard.dtb
[🔨]       ├── [ 33K]  sun4i-a10-dserve-dsrv9703c.dtb
[🔨]       ├── [ 32K]  sun4i-a10-gemei-g9.dtb
[🔨]       ├── [ 30K]  sun4i-a10-hackberry.dtb
...
[🔨]       ├── [ 35K]  sun8i-h3-orangepi-pc-plus.dtb
[🔨]       ├── [ 35K]  sun8i-h3-orangepi-pc-sapomat.dtb
[🔨]       ├── [ 35K]  sun8i-h3-orangepi-plus2e.dtb
[🔨]       ├── [ 36K]  sun8i-h3-orangepi-plus.dtb
[🔨]       ├── [ 33K]  sun8i-h3-orangepi-zero-plus2.dtb
[🔨]       ├── [ 33K]  sun8i-h3-rervision-dvk.dtb
[🔨]       ├── [ 34K]  sun8i-h3-zeropi.dtb
[🔨]       ├── [ 31K]  sun8i-r16-bananapi-m2m.dtb
[🔨]       ├── [ 26K]  sun8i-r16-nintendo-nes-classic.dtb
[🔨]       ├── [ 26K]  sun8i-r16-nintendo-super-nes-classic.dtb
[🔨]       ├── [ 31K]  sun8i-r16-parrot.dtb
[🔨]       ├── [ 38K]  sun8i-r40-bananapi-m2-ultra.dtb

@igorpecovnik
Copy link
Member

igorpecovnik commented Nov 12, 2024

It should look like this:

Its broken.

uname -a
Linux zeropi 6.6.54-current-sunxi

Overlays are in:
/boot/dtb/overlay

I made an image for my test H3 device:
./compile.sh build BOARD=zeropi BRANCH=current BUILD_MINIMAL=yes EXPERT=yes KERNEL_CONFIGURE=no PREFER_DOCKER=no RELEASE=noble

@The-going
Copy link
Contributor Author

It should look like this:

Its broken.

I've already figured that out.

@The-going
Copy link
Contributor Author

Good. I fixed it for EDGE.
The DEB package is assembled and installed correctly.
What should I check in armbian-config?

@igorpecovnik
Copy link
Member

What should I check in armbian-config?

System, last option:
image

@The-going
Copy link
Contributor Author

I have assembled the image, mounted it, I see:

armbi_root> cat boot/armbianEnv.txt 
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-a83t
rootdev=UUID=c9a9fb1e-301f-4ab1-b054-a7e730e8b60f
rootfstype=ext4

The loader script contains:

armbi_root> cat boot/boot.cmd 
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv load_addr "0x45000000"
setenv overlay_error "false"
# default values
setenv verbosity "1"
setenv console "both"
setenv disp_mem_reserves "off"
setenv disp_mode "1920x1080p60"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv bootlogo "false"
setenv devnum "0"
setenv rootdev "/dev/mmcblk${devnum}p1"
setenv earlycon "off"
....
load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}zImage

if test -e ${devtype} ${devnum} "${prefix}.next"; then
        echo "Found mainline kernel configuration"
        load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
        fdt addr ${fdt_addr_r}
        fdt resize 65536
        for overlay_file in ${overlays}; do
                if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
                        echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
                        fdt apply ${load_addr} || setenv overlay_error "true"
                fi
        done
....

As far as I understand this code, the loader will look for DTB in the path:
/boot/dtb/board-name.dtb
And the overlay file will try to load from:
/boot/dtb/overlay/name-overlayfile.dtbo

Which is what is now implemented for the CURRENT kernel.
For the EDGE core, I didn't pay attention to the changes in the Makefile template rule when migrating to a new version.
Which led to the fact that all the files ".dtb,.dtbo" ended up in the same folder.
But the image during the boot test on the board did not reveal any malfunctions.

Conclusions:
If I do the installation of the files in the path:
/boot/dtb-6.11.6-edge-sunxi/allwinner/overlay
and the kernel packager will make a symbolic link:
/boot/dtb -> dtb-6.11.6-edge-sunxi
then in order for the board to start loading, I will have to initialize the fdtfile variable as:
fdtfile=allwinner/board-name.dtb in the armbianEnv.txt file.
But the script will not be able to load overlays.

What should I change?

Please formulate the rules for the logic of the loading order.
I'm implementing them.

@The-going
Copy link
Contributor Author

@igorpecovnik In the old script, this line contained allwinner in the path
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then

@igorpecovnik
Copy link
Member

igorpecovnik commented Nov 13, 2024

I'm implementing them.

Lets do this after the release. I don't want to change bootscritps mechanisms this late.

I reverted armbian-config to old ways - which should work the same (wrong with exceptions) as before. It looks like we need to establish consistency across all kernels, otherwise this makes no sense.

@The-going
Copy link
Contributor Author

I'm implementing them.

Lets do this after the release. I don't want to change bootscritps mechanisms this late.

I reverted armbian-config to old ways - which should work the same (wrong with exceptions) as before. It looks like we need to establish consistency across all kernels, otherwise this makes no sense.

But I have to fix the EDGE core before the release.
I have two options ready.
Let's just pick one. And tomorrow is the pull request.

@igorpecovnik
Copy link
Member

igorpecovnik commented Nov 13, 2024

But I have to fix the EDGE core before the release.

Let it work the same way as current so this
armbian/configng#256
covers it. I am done for today ... morning.

@The-going
Copy link
Contributor Author

Lets do this after the release. I don't want to change bootscritps mechanisms this late.

Info:

armbian/build> grep -nr '${prefix}dtb/' config/bootscripts/*
regex='allwinner|rockchip|amlogic'
grep -E "dtb/${regex}" config/bootscripts/*.cmd | awk -F':' '{print $1}' | sort | uniq

Contain ${prefix}dtb/${fdtfile} ${prefix}dtb/vendor/overlay/${overlay_prefix}-${overlay_file}.dtbo

config/bootscripts/boot-jethub.cmd
config/bootscripts/boot-meson64.cmd
config/bootscripts/boot-meson-gx.cmd
config/bootscripts/boot-meson-s4t7.cmd
config/bootscripts/boot-rk3576.cmd
config/bootscripts/boot-rk35xx.cmd
config/bootscripts/boot-rockchip64.cmd
config/bootscripts/boot-rockchip64-ttyS0.cmd
config/bootscripts/boot-sun50i-next.cmd

other:

config/bootscripts/boot-cubox.cmd:35:load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile}

config/bootscripts/boot-marvell.cmd:32:load ${boot_interface} 0:1 ${fdt_addr} ${prefix}dtb/${fdtfile}

config/bootscripts/boot-mvebu.cmd:27:load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
config/bootscripts/boot-mvebu.cmd:34:   if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then

config/bootscripts/boot-rk322x.cmd:50:load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
config/bootscripts/boot-rk322x.cmd:54:  if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then

config/bootscripts/boot-rockchip.cmd:50:load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
config/bootscripts/boot-rockchip.cmd:54:        if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then

config/bootscripts/boot-sunxi.cmd:61:   load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
config/bootscripts/boot-sunxi.cmd:65:           if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then

config/bootscripts/boot-zynq.cmd:33:load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as it should
Development

Successfully merging a pull request may close this issue.

2 participants