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

system-image-upgrader: only flash partition images if different #38

Open
wants to merge 1 commit into
base: halium-11.0
Choose a base branch
from

Conversation

JamiKettunen
Copy link

@JamiKettunen JamiKettunen commented Apr 13, 2024

Do this by comparing checksums of the file vs partition bytes, also silence simgtest stderr spam on every non-sparse image file.

Log example including rtss timestamps to illustrate how long each step is taking on Volla Phone X23 with 20.04 OTA-2 flash to latest 20.04 devel:

$ rtss adb shell tail -f /cache/ubuntu_updater.log
  39.1ms   39.1ms | System Image Upgrader for Ubuntu Touch
  39.1ms          | Preparing command file
  39.1ms          | Starting image upgrader
  39.1ms          | Loading keyring: archive-master.tar.xz
  39.1ms          | Processing command file
  39.1ms          | Formatting: system
 174.9ms  135.8ms | system partition: /dev/block/dm-0
 211.6ms   36.7ms | umount: /mnt/system: Invalid argument
 223.1ms   11.6ms | mke2fs 1.45.4 (23-Sep-2019)
 241.3ms   18.2ms | Discarding device blocks: done                            
   1.09s    0.8ms | Creating filesystem with 2096128 4k blocks and 524288 inodes
   1.09s          | Filesystem UUID: ea2f26e9-e6a6-4589-bffb-0a3a71f80c50
   1.09s          | Superblock backups stored on blocks: 
   1.09s          |     32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
   1.09s    0.3ms | 
   1.09s          | Allocating group tables: done                            
   1.10s    0.5ms | Writing inode tables: done                            
   1.10s    0.7ms | Creating journal (16384 blocks): done
   1.35s  250.1ms | Writing superblocks and filesystem accounting information: done 
   1.35s    5.3ms | 
   1.35s    3.1ms | Loading keyring: image-master.tar.xz
   1.74s  386.6ms | Loading keyring: image-signing.tar.xz
   2.23s  493.0ms | umount: /dev/block/dm-0: Invalid argument
   2.27s   39.4ms | umount: /cache/system: Invalid argument
   2.31s   37.9ms | umount: /mnt/system: Invalid argument
   2.32s   12.1ms | e2fsck 1.45.4 (23-Sep-2019)
   2.33s    6.4ms | Pass 1: Checking inodes, blocks, and sizes
   2.33s    4.5ms | Pass 2: Checking directory structure
   2.33s    0.6ms | Pass 3: Checking directory connectivity
   2.33s          | Pass 4: Checking reference counts
   2.35s   14.3ms | Pass 5: Checking group summary information
   2.36s    7.5ms | /dev/block/dm-0: 11/524288 files (0.0% non-contiguous), 49303/2096128 blocks
   2.40s   44.1ms | Unknown command: 
   2.40s    0.4ms | Keyring doesn't exist: device-signing
   7.76s    5.36s | Applying update: rootfs-8c8e0801737dbb104b95b2cdecdce88ed3934b78eb4a6e3903dd1a7f709b15fd.tar.xz
 1m0.92s   53.16s | Keyring doesn't exist: device-signing
 1m5.19s    4.27s | Applying update: firmware-068a5cdbd0dcff2904fd4b771b457404fa8848063062c71a83c9178cc8dcac6e.tar.xz
1m39.90s   34.70s | Checking if vendor at /dev/block/dm-1 needs updating...
1m47.17s    7.27s |   Flashing (cksum 360294409 != 1669154095)...
1m51.59s    4.42s | Checking if lk at /dev/block/by-name/lk_a needs updating...
1m51.74s  155.8ms |   Flashing (cksum 613770067 != 561110813)...
1m51.89s  146.2ms | Checking if tee at /dev/block/by-name/tee_a needs updating...
1m52.04s  148.2ms |   Flashing (cksum 1273672853 != 141589887)...
1m52.19s  152.2ms | Checking if scp at /dev/block/by-name/scp_a needs updating...
1m52.32s  129.4ms |   Flashing (cksum 1386461234 != 3847453068)...
1m52.47s  146.6ms | Checking if sspm at /dev/block/by-name/sspm_a needs updating...
1m52.59s  127.7ms |   Flashing (cksum 2066248718 != 1477994443)...
1m52.73s  134.9ms | Checking if dpm at /dev/block/by-name/dpm_a needs updating...
1m52.86s  127.0ms |   Flashing (cksum 1766797289 != 2369907974)...
1m53.00s  140.2ms | Checking if mcupm at /dev/block/by-name/mcupm_a needs updating...
1m53.12s  120.6ms |   Flashing (cksum 2896372325 != 2834491457)...
1m53.25s  135.8ms | Checking if md1img at /dev/block/by-name/md1img_a needs updating...
1m53.78s  524.0ms |   Flashing (cksum 3275156379 != 1595278505)...
1m54.18s  403.9ms | Checking if gz at /dev/block/by-name/gz_a needs updating...
1m54.31s  130.8ms |   Flashing (cksum 1431430420 != 1292548420)...
1m54.46s  143.9ms | Checking if spmfw at /dev/block/by-name/spmfw_a needs updating...
1m54.58s  121.7ms |   Flashing (cksum 2191500498 != 1392676407)...
1m54.71s  134.9ms | Checking if pi_img at /dev/block/by-name/pi_img_a needs updating...
1m54.83s  121.7ms |   Already up-to-date
1m54.99s  156.1ms | Keyring doesn't exist: device-signing
1m56.73s    1.74s | Applying update: device-83980d2d35082ad4f1f911079c4db009a38271327bffe0bd57388f2a31321caf.tar.xz
2m12.20s   15.48s | Keyring doesn't exist: device-signing
2m12.80s  600.1ms | Applying update: boot-3fe41f279fd6269ceff34f629adbb5cfcfeb46fa02271a4d05118c35be3fc2ec.tar.xz
2m16.43s    3.63s | Checking if boot at /dev/block/by-name/boot_a needs updating...
2m17.05s  612.7ms |   Flashing (cksum 3787133804 != 3814758713)...
2m18.57s    1.53s | Checking if vendor_boot at /dev/block/by-name/vendor_boot_a needs updating...
2m18.75s  177.9ms |   Flashing (cksum 4216945927 != 1030756222)...
2m18.95s  201.3ms | Checking if dtbo at /dev/block/by-name/dtbo_a needs updating...
2m19.07s  118.6ms |   Flashing (cksum 2893424597 != 1756549834)...
2m19.25s  177.5ms | Keyring doesn't exist: device-signing
2m19.26s   10.1ms | Applying update: keyring-400895c98ce498ca2d89a7ff0266361b427057d52e4be69b10118fbcbf2eef34.tar.xz
2m19.50s  239.4ms | Keyring doesn't exist: device-signing
2m19.51s   14.0ms | Applying update: version-385.tar.xz
2m20.28s  771.2ms | Done upgrading...
2m20.41s  128.7ms | tune2fs 1.45.4 (23-Sep-2019)
2m20.41s          | Setting reserved blocks percentage to 5% (645119 blocks)
2m21.48s    exit status: 0

@JamiKettunen JamiKettunen force-pushed the partition-img-chksum branch 2 times, most recently from fe5ba65 to 3ac2c4b Compare April 13, 2024 10:47
Do this by comparing checksums of the file vs partition bytes, also
silence simgtest stderr spam on every non-sparse image file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant