Hello all,
I am currently working on implementing a Mender Integeration on a Tinker-Board-S.
As soon as I use the mender-uboot feature I unfortunately run into the following error!
This was followed by a huge wall of text (did not copy) into this error: I actually didn’t expect grub-efi anymore.
| cc1: all warnings being treated as errors
| make[2]: *** [Makefile:6922: grub-core/fs/libgrubmods_a-cpio.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| In file included from ../grub-2.02/grub-core/fs/cpio_be.c:51:
| ../grub-2.02/grub-core/fs/cpio_common.c: In function 'grub_cpio_find_file':
| ../grub-2.02/grub-core/fs/cpio_common.c:58:31: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 58 | data->size = read_number (hd.filesize, ARRAY_SIZE (hd.filesize));
| | ~~^~~~~~~~~
| ../grub-2.02/grub-core/fs/cpio_common.c:60:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 60 | *mtime = read_number (hd.mtime, ARRAY_SIZE (hd.mtime));
| | ~~^~~~~~
| ../grub-2.02/grub-core/fs/cpio_common.c:61:28: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 61 | modeval = read_number (hd.mode, ARRAY_SIZE (hd.mode));
| | ~~^~~~~
| ../grub-2.02/grub-core/fs/cpio_common.c:62:29: error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 62 | namesize = read_number (hd.namesize, ARRAY_SIZE (hd.namesize));
| | ~~^~~~~~~~~
| cc1: all warnings being treated as errors
| make[2]: *** [Makefile:6936: grub-core/fs/libgrubmods_a-cpio_be.o] Error 1
| make[2]: Leaving directory '/home/s/mender-rockchip/build/tmp/work/x86_64-linux/grub-efi-native/2.02-r0/build'
| make[1]: *** [Makefile:11247: all-recursive] Error 1
| make[1]: Leaving directory '/home/s/mender-rockchip/build/tmp/work/x86_64-linux/grub-efi-native/2.02-r0/build'
| make: *** [Makefile:3467: all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/s/mender-rockchip/build/tmp/work/x86_64-linux/grub-efi-native/2.02-r0/temp/log.do_compile.773806)
ERROR: Task (virtual:native:/home/s/mender-rockchip/build/../sources/poky/meta/recipes-bsp/grub/grub-efi_2.02.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2417 tasks of which 0 didn't need to be rerun and 1 failed.
@SebSauer ok I’ll try to build locally and get back to you if I spot something. So you’re using dunfell now or other branch (as from board integration topic?). Thanks.
@SebSauer made some progress but seems stock 2020.01 for this board cannot be compiled and it error with: Error: SPL image is too large (size 0x11000 than 0x8000) I’m checking what can be removed in order to fit SPL to this size ;). So if you can use thud release temporarily until this is resolved …
@ruben did you try to build image using only meta-rockchip on dunfell release? I tried and u-boot build fine. Issue only happens when meta-mender-community patches are added to u-boot then it overflow SPL size (didn’t find cause yet though). So to debug this issue I would try
build image using meta-rockchip without mender and verify if it boots (I don’t have board so cannot try it )
be aware that mender integration for rochchip on dunfell branch is obsolete and not up to date so I tried to update it with following patch:
With those changes there is overflow issue I wasn’t able to resolve it and also asked on meta-rockchip but no reply. So those are things I did so I think it can be good start for someone who have platform to try. Thanks.
thanks for your response. I already tried a build without mender integration. This build boots and works so far. But I tested not too much.
I am a little bit confused about partitioning. In Yocto build without mender the partitioning is based on wic-file in meta-rockchip layer:
tinkerboard.wks
# Disk layout
# Note that the reference documentation refers to 512 byte disk sectors, but
# wic uses 1KB blocks
#
# Partition Start Sector Number of Sectors
# loader1 64 8000
# reserved1 8064 128
# reserved2 8192 8192
# loader2 16384 8192
# atf 24576 8192
# boot 32768 229376
# root 262144 -
#
part loader1 --align 32 --size 4000K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=idbloader.img"
part reserved1 --align 4032 --size 64K --ondisk ${RK_BOOT_DEVICE}
part reserved2 --align 4096 --size 4096K --ondisk ${RK_BOOT_DEVICE}
part loader2 --align 8192 --size 4096K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=u-boot.bin"
part atf --align 12288 --size 4096K --ondisk ${RK_BOOT_DEVICE}
part /boot --align 16384 --size=114688K --active --ondisk ${RK_BOOT_DEVICE} --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
This also matches with the documentation in rockchip wiki and u-boot sources from my last post.
When I do the mender integration I get only 4 partitions:
bootloader
a
b
data
What do you think belongs to which partition? My idea would be
bootloader partition contains loader1 and loader2 (spl and u-boot)
bootloader needs to be patched to load kernel from rootfs (not sure if possible or already done). And bootloader partition must be designed to have loader1 (spl) at sector 64 and u-boot at sector 16384. @mirzak Perhaps you can help here as you did the initial setup for the tinkerboard?
Hi @ruben yes this could be definitely problem if image is not partitioned properly. I think mender wks is missing rk3288-boot.wks include IMO. But yes @mirzak probably knows more.