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

Fix wrong overlay manipulation #393

Merged
merged 1 commit into from
Jan 26, 2025
Merged

Fix wrong overlay manipulation #393

merged 1 commit into from
Jan 26, 2025

Conversation

igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Jan 25, 2025

Description

Addressing non working overlay management.

image

Issue reference: Closing #360

Testing Procedure

  • Set overlay on Odroid M1
223 bytes read in 5 ms (43 KiB/s)
Applying kernel provided DT overlay rockchip-rk3568-hk-i2c0.dtbo
254 bytes read in 4 ms (61.5 KiB/s)
Applying kernel provided DT overlay rockchip-rk3568-hk-uart1.dtbo
  • Set overay on Bpi M2 (h3)
339 bytes read in 3 ms (110.4 KiB/s)
Applying kernel provided DT overlay sun8i-h3-analog-codec.dtbo
502 bytes read in 4 ms (122.1 KiB/s)
Applying kernel provided DT overlay sun8i-h3-uart2.dtbo

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have ensured that my changes do not introduce new warnings or errors
  • No new external dependencies are included
  • Changes have been tested and verified
  • I have included necessary metadata in the code, including associative arrays

@github-actions github-actions bot added the size/small PR with less then 50 lines label Jan 25, 2025
@igorpecovnik igorpecovnik mentioned this pull request Jan 25, 2025
1 task
@The-going
Copy link

The-going commented Jan 25, 2025

84778cc
A little more is needed here.

...
	local overlayconf="/boot/armbianEnv.txt"
	local overlaydir="$(find /boot/dtb/ -name overlay -and -type d)";
	local overlay_prefix=$(awk -F"=" '/overlay_prefix/ {print $1}' $ovrlayconf)
	if ! grep -q $overlay_prefix ${overlaydir}/*.dtbo; then
		echo "Invalid overlay_prefix $overlay_prefix"; exit 1
	fi

	while true; do
		local options=()
...

@igorpecovnik igorpecovnik force-pushed the overlayfix2 branch 2 times, most recently from d132aab to cbb0362 Compare January 25, 2025 15:37
@The-going
Copy link

That's what I was thinking.
After we have set the overlay dir variable, we need to check it. If it is empty, then a message to the user.
The user can install\assemble a broken\someone else's package.
After we have received the value of the overlay prefix from the file that is being edited by the user, we also need to check it.
The overlay_prefix variable cannot be empty.
Otherwise, grep will hang.

@igorpecovnik igorpecovnik marked this pull request as ready for review January 25, 2025 17:22
@igorpecovnik igorpecovnik added 02 Milestone: First quarter release Needs review Seeking for review labels Jan 25, 2025
@igorpecovnik igorpecovnik force-pushed the overlayfix2 branch 3 times, most recently from 4ec1929 to bfc3b9d Compare January 25, 2025 17:52
@igorpecovnik igorpecovnik added Bugfix Pull request is fixing a bug Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Jan 25, 2025
@igorpecovnik igorpecovnik merged commit f66d62a into main Jan 26, 2025
16 checks passed
@igorpecovnik igorpecovnik deleted the overlayfix2 branch January 26, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Bugfix Pull request is fixing a bug Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants