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

Partition sizes are not multiple of 4096 byte for Rauc block-hash-index #63

Open
OlavHerbst opened this issue Mar 21, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@OlavHerbst
Copy link

OlavHerbst commented Mar 21, 2023

Describe the bug
Partition sizes must be aligned to 4K. Rauc needs for faster installation of bundles with block-hash-indexes partition sizes that are multiples of 4096 bytes.
Bitbake has variable IMAGE_ROOTFS_ALIGNMENT = "4" for this, which must be set for minimal, full and rescue images.
But images sizes can differ and are not always dividable by 4096.

To Reproduce
Steps to reproduce the behaviour:

  1. Build distro for one of the machines, e.g. Qemu-arm64
  2. Run Qemu out of eclipse-leda-qemu-arm64.tar.xz.zip (Image-qemuarm64.bin, sdv-image-all-qemuarm64.wic.qcow2)
  3. In Qemu install with Rauc the rescue image out of same file, which should succeed (same content and size as in wic, e.g.
rauc install .../sdv-rauc-bundle-rescue-qemuarm64.raucb
  1. journal shows a warning log message of Rauc that the size is not a multiple of 4K:
journalctl -u rauc
...
Updating /dev/vda3 with /run/rauc/bundle/sdv-image-rescue-qemuarm64.ext4
Continuing after adaptive mode error: failed to open target slot hash index for rescue.0: data file size (**167528448**) is not a multiple of 4096 bytes
...

Installation takes longer than expected.
5. Compare image size out of manifest

rauc info  .../sdv-rauc-bundle-rescue-qemuarm64.raucb
... 163258368   / 4096 = 39858.0

with partition size

fdisk -l
...
/dev/vda3   323584  650787  327204 159.8M Linux filesystem   (650787-323584+1)*512=**167528448**, /4096=40900**.5**
/dev/vda4   655360 1728575 1073216   524M Linux filesystem   partition for full image  ... =134152.0
/dev/vda5  1736704 2678527  941824 459.9M Linux filesystem   partition for minimal image  ... = 117728.0

In the wic file sdv-image-all-qemuarm64.wic.qcow2 you can directly check the partition sizes (7-Zip):

"2.rescue.img"    **167528448**       / 4096 =   40900**.5**  size not ok
"3.root_a.img"    549486592       / 4096 = 134152.0  partition size for full image ok
"4.root_b.img"    482213888      / 4096 = 117728.0   partition size for minimal image ok

The full-image and minimal-image sizes are in the bundle manifests ok, but also differ from partition sizes:

rauc info sdv-rauc-bundle-full.raucb
   size: 494252032 / 4096 = 120667.0  ok
rauc info sdv-rauc-bundle-minimal.raucb 
  size: 426606592 / 4096 = 104152.0  ok

In eclipse-leda-raspberrypi.tar.xz.zip in sdv-image-all-raspberrypi4-64.wic the partitions for full and minimal image violate the 4K-rule:

"2.rescue.img"    201457664      / 4096  = 49184.0
"3.root_a.img"    533480448       / 4096 = 130244.25 !!!
"4.root_b.img"    466212864       / 4096 = 113821.5   !!!

Expected behaviour
The size of partitions for rescue.img, root_a.img and root_b.img must be multiple of 4096 to guarantee fast block-hash-index Rauc bundle installations.

Screenshots / Logfiles

Leda Version (please complete the following information):

  • Version: Commit 62e53c5
  • Machine: qemuarm64, raspberrypi4-64
  • Connectivity: -
@OlavHerbst OlavHerbst added the bug Something isn't working label Mar 21, 2023
@stlachev stlachev assigned stlachev and unassigned stlachev Jun 16, 2023
@stlachev stlachev moved this to ✅ Done in Leda Roadmap Jun 16, 2023
@stlachev stlachev removed the status in Leda Roadmap Jun 16, 2023
@stlachev stlachev removed their assignment Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants