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

bootscripts: Allwinner: Bugfix: Remove "allwinner/" from 3 boards configurations #7535

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

The-going
Copy link
Contributor

@The-going The-going commented Dec 2, 2024

Description

Fix the script for it to work correctly and the three configuration files that use this script.

Remove "allwinner/" from all board configurations that use the boot script mechanism
so that the script works correctly.
Tell the user only the actual actions.
Make the script work silently when testing path options and report only the actual file
being uploaded.
Delete the duplicate iteration.

Inform interested users:
@pyavitz @JohnTheCoolingFan @amazingfate @DGxInfinitY

How Has This Been Tested?

  • Test build image
  • Make an emulation of variants of an incorrectly assembled DTB package.
    Where the vendor folder does not exist or the DTB file name is incorrect.

Set the expected default path to /boot/dtb/allwinner and
start analyzing if the DTB file is not found in this path.

The folder with the vendor's name is now part of the path,
not part of the file name. This greatly facilitates the analysis
of various possible options in a simple u-boot shell.
Inform the user about the actual file that will be uploaded
on the first iteration. Inform the user that it cannot be
downloaded only once if the first iteration was unsuccessful.
In the second iteration, we check the path that does not
contain the vendor folder. But this will also be done if
the real path contains the vendor's folder and the vendor's
name is contained in the DTB file name as
    fdtfile=allwinner/sun50i-*-bananapi-*.dtb.
However, overlays will not be available.
Remove "allwinner/" from all board configurations that
use the boot script mechanism so that the script works
correctly.

Signed-off-by: The-going <[email protected]>
Use the DTB name from the u-boot default for the third
iteration if the provided DTB name was not found. Also
delete the duplicate of the previous iteration.
Make the script work silently when testing path options
and report only the actual file being uploaded.
Delete the duplicate iteration.
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... and removed size/medium PR with more then 50 and less then 250 lines labels Dec 2, 2024
@igorpecovnik
Copy link
Member

2c

  • all others families must have the same mechanism
  • upgrade must work

@The-going
Copy link
Contributor Author

  • all others families must have the same mechanism

Yes, it is very desirable.

@The-going
Copy link
Contributor Author

The-going commented Dec 3, 2024

[🌱] artifact [ armbian-base-files :: armbian-base-files() ]
jq: error: syntax error, unexpected '/', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
/home/leo/armbian/.tmp/work-8a8eca9e-3d59-46f4-87d7-cd2a3bc6278a/tmp.QEMp5fi1QC
jq: 1 compile error
[🚸] Could not find package filename for 'base-files' in distro repo [ looking for base-files, found_package_filename is  ]
[🚸] Command failed, retrying in 15s [ apt_find_upstream_package_version_and_download_url base-files ]
jq: error: syntax error, unexpected '/', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
/home/leo/armbian/.tmp/work-8a8eca9e-3d59-46f4-87d7-cd2a3bc6278a/tmp.qLXMl97IDZ
jq: 1 compile error

What's it? How to deal with it?

=====
It was a normal network outage.
I just waited until the address started pinging and started the build again.
But the error message does not correspond to reality.

@pyavitz
Copy link
Collaborator

pyavitz commented Dec 3, 2024

[🌱] artifact [ armbian-base-files :: armbian-base-files() ]
jq: error: syntax error, unexpected '/', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
/home/leo/armbian/.tmp/work-8a8eca9e-3d59-46f4-87d7-cd2a3bc6278a/tmp.QEMp5fi1QC
jq: 1 compile error
[🚸] Could not find package filename for 'base-files' in distro repo [ looking for base-files, found_package_filename is  ]
[🚸] Command failed, retrying in 15s [ apt_find_upstream_package_version_and_download_url base-files ]
jq: error: syntax error, unexpected '/', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
/home/leo/armbian/.tmp/work-8a8eca9e-3d59-46f4-87d7-cd2a3bc6278a/tmp.qLXMl97IDZ
jq: 1 compile error

What's it? How to deal with it?

===== It was a normal network outage. I just waited until the address started pinging and started the build again. But the error message does not correspond to reality.

Happens to me as well. #7514 (comment)

@The-going
Copy link
Contributor Author

Build image and start on board:

mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
4328 bytes read in 2 ms (2.1 MiB/s)
## Executing script at 4fc00000
U-boot loaded from SD
Boot script loaded from mmc
240 bytes read in 2 ms (117.2 KiB/s)
Load fdt: /boot/dtb/allwinner/sun50i-a64-bananapi-m64.dtb
41803 bytes read in 5 ms (8 MiB/s)
Working FDT set to 4fa00000
3821 bytes read in 3 ms (1.2 MiB/s)
Applying kernel provided DT fixup script (sun50i-a64-fixup.scr)
## Executing script at 45000000
11007902 bytes read in 513 ms (20.5 MiB/s)
24301576 bytes read in 1129 ms (20.5 MiB/s)

OK!

Test 2:
If fdtfile=allwinner/sun50i-a64-bananapi-m64.dtb

U-boot loaded from SD
Boot script loaded from mmc
250 bytes read in 1 ms (244.1 KiB/s)
The file allwinner/sun50i-a64-bananapi-m64.dtb was not found in the path /boot/dtb/allwinner
Load fdt: /boot/dtb/allwinner/sun50i-a64-bananapi-m64.dtb
41803 bytes read in 4 ms (10 MiB/s)
Working FDT set to 4fa00000
Failed to load '/boot/dtb/overlay/sun50i-a64-fixup.scr'
11007902 bytes read in 513 ms (20.5 MiB/s)
24301576 bytes read in 1128 ms (20.5 MiB/s)
Moving Image from 0x40080000 to 0x40200000, end=41a00000
## Loading init Ramdisk from Legacy Image at 4ff00000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    11007838 Bytes = 10.5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Ramdisk to 49580000, end 49fff75e ... OK
   Loading Device Tree to 000000004950d000, end 000000004957ffff ... OK
Working FDT set to 4950d000

Starting kernel ...

For the DTB file, the error was handled correctly, the kernel loaded,
but overlays are not available. And this is easily fixed by removing
the vendor's name from the DTB file name.

Test 3:
dtb -> dtb-6.11.9-edge-sunxi64/allwinner

ls /boot/dtb/
overlay                               sun50i-a64-sopine-baseboard.dtb         sun50i-h616-bigtreetech-pi.dtb
sun50i-a100-allwinner-perf1.dtb       sun50i-a64-teres-i.dtb                  sun50i-h616-orangepi-zero2.dtb
sun50i-a64-amarula-relic.dtb          sun50i-h313-tanix-tx1.dtb               sun50i-h616-x96-mate.dtb
sun50i-a64-bananapi-m64.dtb           sun50i-h313-x96q-lpddr3.dtb             sun50i-h618-bananapi-m4-zero.dtb
sun50i-a64-nanopi-a64.dtb             sun50i-h5-bananapi-m2-plus.dtb          sun50i-h618-longanpi-3h.dtb
.....
U-boot loaded from SD
Boot script loaded from mmc
240 bytes read in 2 ms (117.2 KiB/s)
The file sun50i-a64-bananapi-m64.dtb was not found in the path /boot/dtb/allwinner
Load fdt: /boot/dtb/sun50i-a64-bananapi-m64.dtb
41803 bytes read in 5 ms (8 MiB/s)
Working FDT set to 4fa00000
3821 bytes read in 3 ms (1.2 MiB/s)
Applying kernel provided DT fixup script (sun50i-a64-fixup.scr)
## Executing script at 45000000
11007902 bytes read in 513 ms (20.5 MiB/s)
24301576 bytes read in 1128 ms (20.5 MiB/s)

OK!

Test 4:
The nonexistent name of the DTB in the file armbianEnv.txt .

...... ERROR....

In the board/sunxi/board.c#L826 file, this is a hard-coded value.
As fdtfile=allwinner/sun50i-a64-bananapi-m64.dtb

I can fix this with a patch, but other users who will use other versions of u-boot
or other folders for patches or board configurations that do not have a record of the DTB file name....
In general, this is not an option.

@The-going The-going marked this pull request as draft December 3, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review
Development

Successfully merging this pull request may close these issues.

3 participants