-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add beagleplay support take 4 #679
Add beagleplay support take 4 #679
Conversation
Can one of the admins verify this patch? |
97ccbba
to
0af3109
Compare
The Pull Request has been cleaned up and is now ready for review. Code is successfully building a |
@floion - any updates on this ? |
0af3109
to
6d01bfd
Compare
@@ -1,2 +1,7 @@ | |||
inherit kernel-balena | |||
|
|||
# BRANCH:aarch64 = "v5.10.168-ti-arm64-r111" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have them removed from here. PR 682 is just for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments have been removed on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not resolved
layers/meta-balena-beaglebone/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,2 @@ | |||
CONFIG_CMD_BOOTEFI= | |||
CONFIG_EFI_LOADER= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not using u-boot-ti-staging, then these can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in the latest version of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These still seem to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed now... Please confirm and resolve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not resolved
layers/meta-balena-beaglebone/recipes-bsp/u-boot/u-boot-bb.org_%.bbappend
Show resolved
Hide resolved
@@ -1,7 +1,3 @@ | |||
inherit kernel-balena | |||
|
|||
# BRANCH:aarch64 = "v5.10.168-ti-arm64-r111" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes from here should be removed from here and also the comments should not be added at all in the previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
FILESEXTRAPATHS:append:beaglebone-ai64 := "${THISDIR}/${PN}-beaglebone-ai64" | ||
FILESEXTRAPATHS:append:beagleplay := "${THISDIR}/${PN}-beagleplay" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added? It does not seem you are using any script for flashing the beagleplay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Will remove and retest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see this added here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed now. Please confirm and resolve as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not resolved
layers/meta-balena-beaglebone/recipes-core/images/balena-image.inc
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-core/images/balena-image.inc
Outdated
Show resolved
Hide resolved
IMAGE_FSTYPES:append:beagleplay = " balenaos-img" | ||
IMAGE_FSTYPES:append:beagleplay-k3r5 = " balenaos-img" | ||
|
||
BALENA_BOOT_SIZE:beagleplay="327680" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use such a large partition? What is the actual size of the files in the boot partition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The u-boot-bb.org
partition is reproduced below from my build machine. Looks like the total size of the files here is 672K, so we should be ok using the default. Will change and retest.
ubuntu@ip-172-31-16-228:~/balena-beaglebone/build/tmp/work/beagleplay_k3r5-poky-eabi/u-boot-bb.org/1_2024.04+gitAUTOINC+881379e9e2-r0/deploy-u-boot-bb.org$ ls -ltrh
total 668K
-rw-r--r-- 2 ubuntu ubuntu 127K May 17 15:56 u-boot-r5spl-beagleplay-2024.04+gitAUTOINC+881379e9e2-r0.bin
lrwxrwxrwx 2 ubuntu ubuntu 60 May 17 15:56 u-boot-r5spl.bin -> u-boot-r5spl-beagleplay-2024.04+gitAUTOINC+881379e9e2-r0.bin
lrwxrwxrwx 2 ubuntu ubuntu 60 May 17 15:56 u-boot-r5spl-beagleplay.bin -> u-boot-r5spl-beagleplay-2024.04+gitAUTOINC+881379e9e2-r0.bin
-rw-r--r-- 2 ubuntu ubuntu 260K May 17 15:56 tiboot3-am62x-gp-evm-beagleplay-k3r5-2024.04+gitAUTOINC+881379e9e2-r0.bin
lrwxrwxrwx 2 ubuntu ubuntu 73 May 17 15:56 tiboot3.bin -> tiboot3-am62x-gp-evm-beagleplay-k3r5-2024.04+gitAUTOINC+881379e9e2-r0.bin
lrwxrwxrwx 2 ubuntu ubuntu 73 May 17 15:56 tiboot3-am62x-gp-evm -> tiboot3-am62x-gp-evm-beagleplay-k3r5-2024.04+gitAUTOINC+881379e9e2-r0.bin
-rw-r--r-- 2 ubuntu ubuntu 194 May 17 15:56 extlinux.conf-beagleplay-k3r5-r0
lrwxrwxrwx 2 ubuntu ubuntu 32 May 17 15:56 extlinux.conf-beagleplay-k3r5 -> extlinux.conf-beagleplay-k3r5-r0
-rw-r--r-- 2 ubuntu ubuntu 260K May 17 15:56 tiboot3-am62x-gp-evm.bin
lrwxrwxrwx 1 ubuntu ubuntu 32 May 17 15:56 extlinux.conf -> extlinux.conf-beagleplay-k3r5-r0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@floion - I was unable to remove this line. The do_resin_boot_dirgen_and_deploy
task was failing (see snippet below):
ERROR: balena-image-flasher-1.0-r0 do_resin_boot_dirgen_and_deploy: resin-boot: Not enough space for atomic copy operations.
ERROR: balena-image-flasher-1.0-r0 do_resin_boot_dirgen_and_deploy: ExecutionError('/home/ubuntu/balena-beaglebone/build/tmp/work/beagleplay-poky-linux/balena-image-flasher/1.0-r0/temp/run.do_resin_boot_dirgen_and_deploy.2753352', 1, None, None)
ERROR: Logfile of failure stored in: /home/ubuntu/balena-beaglebone/build/tmp/work/beagleplay-poky-linux/balena-image-flasher/1.0-r0/temp/log.do_resin_boot_dirgen_and_deploy.2753352
ERROR: Task (/home/ubuntu/balena-beaglebone/build/../layers/meta-balena/meta-balena-common/recipes-core/images/balena-image-flasher.bb:do_resin_boot_dirgen_and_deploy) failed with exit code '1'
Keeping it in the recipe (for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to check the size of the resin-boot partition. You can see what files get added in there by looking at something like tmp/work/<board>-poky-linux/balena-image/1.0-r0/resin-boot
in your build directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @floion : Here is the output of my ls -ltrh
command from my latest build directory:
ubuntu@ip-172-31-16-228:~/balena-beaglebone/build/tmp/work/beagleplay-poky-linux/balena-image/1.0-r0/resin-boot$ ls -ltrh
total 62M
-rw-r--r-- 1 ubuntu ubuntu 1.3M Jun 4 22:17 tispl.bin
-rw-r--r-- 1 ubuntu ubuntu 746K Jun 4 22:17 u-boot.img
-rw-r--r-- 1 ubuntu ubuntu 260K Jun 4 22:17 tiboot3.bin
-rw-r--r-- 1 ubuntu ubuntu 61M Jun 4 22:17 Image
-rw-r--r-- 1 ubuntu ubuntu 63K Jun 4 22:17 k3-am625-beagleplay.dtb
drwxr-xr-x 2 ubuntu ubuntu 4.0K Jun 4 22:17 extlinux
drwxr-xr-x 2 ubuntu ubuntu 4.0K Jun 4 22:17 splash
-rw-r--r-- 1 ubuntu ubuntu 187 Jun 4 22:17 os-release
drwxr-xr-x 3 ubuntu ubuntu 4.0K Jun 4 22:17 EFI
-rw-r--r-- 1 ubuntu ubuntu 2.8K Jun 4 22:17 device-type.json
drwxr-xr-x 2 ubuntu ubuntu 4.0K Jun 4 22:17 system-connections
drwxr-xr-x 2 ubuntu ubuntu 4.0K Jun 4 22:17 system-proxy
-rw-r--r-- 1 ubuntu ubuntu 0 Jun 4 22:17 extra_uEnv.txt
-rw-r--r-- 1 ubuntu ubuntu 39 Jun 4 22:17 image-version-info
-rw-r--r-- 1 ubuntu ubuntu 24 Jun 4 22:17 balena-image
-rw-r--r-- 1 ubuntu ubuntu 69 Jun 4 22:17 config.json
-rw-r--r-- 1 ubuntu ubuntu 919 Jun 4 22:17 balenaos.fingerprint
Looks like my build is storing the actual kernel image inside the resin_boot directory. Am assuming this is wrong ? How do I fix this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one way to do this may be use a compressed version of the kernel image. Can you suggest how this may be done ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you also have the kernel in the rootfs in the /boot directory. You should instruct u-boot to load the kernel from there instead and doing so you can remove the kernel from the boot partition.
Also, is there a need for k3-am625-beagleplay.dtb
in the boot partition? I think you can delete this one also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested by @floion , I changed the extlinux configuration to pick up the image and DTB files from the /boot partition. This reduced the size of the resin-boot
partition to about 2.3 M (which enabled the removal of the extra BALENA_BOOT_SIZE
line from this file).
Please review and resolve as needed.
layers/meta-balena-beaglebone/recipes-core/images/balena-image.bbappend
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-core/images/balena-image.bbappend
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-core/images/balena-image.bbappend
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-core/images/balena-image.bbappend
Outdated
Show resolved
Hide resolved
IMAGE_ROOTFS_MAXSIZE:beagleplay = "1966080" | ||
IMAGE_ROOTFS_MAXSIZE:beagleplay-k3r5 = "1966080" | ||
|
||
IMAGE_ROOTFS_SIZE:beagleplay = "1966080" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use so much space? What is the actual size of the generated rootfs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall that I needed to increase the rootfs_size to get the yocto build to run to completion. I recall that I increased the rootfs in two or three steps (doubling and then tripling it) before things worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like for above, to check how big the rootfs is you can look at tmp/work/<board>-poky-linux/balena-image/1.0-r0/rootfs
in your build directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@floion - here's the output from the du -h
command:
ubuntu@ip-172-31-16-228:~/balena-beaglebone/build/tmp/work/beagleplay-poky-linux/balena-image/1.0-r0/rootfs$ du -h --max-depth=1
4.0K ./proc
72M ./boot
4.0K ./sys
62M ./resin-boot
16K ./home
2.8M ./sbin
4.0K ./media
1.2G ./lib
4.0K ./tmp
149M ./usr
4.0K ./srv
4.0K ./run
4.0K ./dev
12K ./quirks
4.0K ./resin-data
72K ./var
2.6M ./etc
28K ./mnt
6.0M ./bin
1.4G .
Looks like the bulk of the usage is in the lib
subfolder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which in turn has a (very) large firmware
folder:
ubuntu@ip-172-31-16-228:~/balena-beaglebone/build/tmp/work/beagleplay-poky-linux/balena-image/1.0-r0/rootfs/lib$ du -h --max-depth=1
7.3M ./systemd
1.1G ./firmware
12K ./resolvconf
38M ./modules
12K ./modprobe.d
12K ./depmod.d
576K ./udev
1.2G .
layers/meta-balena-beaglebone/recipes-core/images/balena-image-flasher.bbappend
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-bsp/u-boot/u-boot-bb.org_%.bbappend
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-support/resin-init/resin-init-flasher.bbappend
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-support/resin-init/resin-init-flasher.bbappend
Outdated
Show resolved
Hide resolved
layers/meta-balena-beaglebone/recipes-support/resin-init/resin-init-flasher.bbappend
Outdated
Show resolved
Hide resolved
@delhiryder please see the comments I left above. Also, the |
@resin-jenkins test this please |
95544c2
to
971b42c
Compare
Updated the PR. @floion please review and let me know if this looks ok. |
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete the extra line added
# SRCREV:aarch64 = "ac0ddc64cced3bdaa8ba5aa56a9a3cdc01825744" | ||
# PV:aarch64 = "5.10.168+git${SRCPV}" | ||
|
||
SRC_URI:remove:aarch64 = " file://0001-defconfig-switch-default-kernel-compression-to-LZMA.patch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, aside from removing these comments, is it also mandatory to remove the patch also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove this line and retest.
Added a new 'beagleplay' device type coffee script. Also updated the "#Supported Machines" sections of the local.conf.sample to make the 'beagleplay' machine target available for building via bitbake.
971b42c
to
7b962bf
Compare
@floion - rebased and updated the PR. Please take a look. |
7b962bf
to
51cd3e1
Compare
Head branch was pushed to by a user without write access
51cd3e1
to
6751010
Compare
6751010
to
7df302a
Compare
tiboot3.bin: \ | ||
${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin:/${KERNEL_IMAGETYPE} \ | ||
k3-am625-beagleplay.dtb: \ | ||
extlinux.conf:/extlinux/extlinux.conf \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only the flasher is using extlinux.conf then this needs to be moved out of here and instead added to balena-image-flasher.bbappend If you add it to the balena-image.inc, it will also be included in the non-flasher image and I believe that one is not supposed to use extlinux.conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made this change.
# the name of the bootloader config file to be written to internal media | ||
INTERNAL_DEVICE_BOOTLOADER_CONFIG:beaglebone = "uEnv.txt_internal" | ||
INTERNAL_DEVICE_BOOTLOADER_CONFIG:beagleplay = "uEnv.txt_internal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we use this so it can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made this change.
|
||
# the pathname (relative to /boot/) where the internal bootloader config file should reside in | ||
# (currently assuming this is on partition 1 of the internal media) | ||
INTERNAL_DEVICE_BOOTLOADER_CONFIG_PATH:beaglebone = "/uEnv.txt" | ||
INTERNAL_DEVICE_BOOTLOADER_CONFIG_PATH:beagleplay = "/uEnv.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we use this so it can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made this change.
SRC_URI:append:beagleplay-k3r5 = " \ | ||
file://balenaos_bootcommand_beagleplay_emmc.cfg \ | ||
file://0001-Added-device-tree-fix-as-suggested-by-Nishanth-Menon.patch \ | ||
" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This append here can be removed since we do not really care about the beagleplay-k3r5
machine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed , as requested.
@@ -2,23 +2,66 @@ FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" | |||
|
|||
inherit resin-u-boot | |||
|
|||
SRC_URI += " \ | |||
SRC_URI:append:beaglebone-ai64-k3r5 = " \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be SRC_URI:append:beaglebone-ai64
instead of SRC_URI:append:beaglebone-ai64-k3r5
since we do not care about that machine and also keeps this code clearer for the future when somebody looks into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made this change.
For the beagleplay MC targets, change this to "u-boot-bb.org" (this is maintained by the bb/ti team). Explicity set the UBOOT_GIT_URI to the one from git.beagleboard.org. Also specified the release version and SRCREV. Added an extlinux.conf file, to ensure that the OS boots up properly. Added patches suggested by the beagleboard discord community - these were needed to get the wlcore startup errors being encountered during initial bootup.
Add kernel wlan_en regulator patch as suggested by Nishanth Menon (of TI). Also, disabled the hardware watchdog (due an ongoing open issue, whose fix is currently being tested). Add the "test_watchdog" package to the kernel package (for easiy verification of the patch, when it become available).
Added appropriate variables and append/remove packages and packagegroups to the balena-image* recipes. Had to increase the IMAGE_ROOTFS_SIZE to 1966080 to enable the recipe to run to completion.
Updated the balena-image-flasher and associated dependent recipes to support building a balena-image-flasher image for the beagleplay device. Changelog-entry: Add beagleplay support Signed-off-by: Sidd Gupta <[email protected]>
Make sure to get the wl18xx-conf.bin file from the `beagleboard` repo (instead of the git.ti.com one). This is needed (in conjunction with the 6.1.80 kernel) to make sure the wifi interface comes up properly.
7df302a
to
f565f1e
Compare
Superseded by #686 |
Opening a 'development' pull request, to allow the Balena team to inspect the proposed changes. Code is not (yet) building or running.