Repository navigation
Commit 8e3e911
committed
feat(updater): refuse an image whose boot partition cannot hold two slots
The factory installs one slot. The first update on the device puts a second one
beside it, on a boot partition that never grows - it is sized once in
create_image.sh, and no update can repartition the disk it is running from. So
a boot partition that is more than half full when the image is written is an
image that cannot be updated, and nothing said so until a cp failed on a
device with error 112.
check_boot_reserve runs at the end of an INSTALLIMAGE run, after everything the
factory writes to /boot, and raises 115 above 40%. Not 50: the second slot's
kernel and initrd are a future build and will not be smaller than today's.
Measured on the x86_64 build of 2026-09-10: 68.4 MiB of 252.7 MiB, 27%. The
arm boot partitions carry a firmware directory as well and are not measured -
the "disc usage (boot, after install)" line of the next rpi build says whether
40 is the right number there.
It reads df -k, not -B1: this one runs in the factory, where df is busybox's
and has no GNU block-size options. Every other df reader in the tree runs on a
device only, which is why -B1 has worked so far.
Four cases in perform_update.test.sh, boundary included. Raising the threshold
or switching to -B1 turns them red - checked. Not run in a real build.
Signed-off-by: Simon Walz <contact@simonwalz.de>1 parent d8ba49d commit 8e3e911
2 files changed
Lines changed: 66 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
103 | 129 | | |
104 | 130 | | |
105 | 131 | | |
| |||
331 | 357 | | |
332 | 358 | | |
333 | 359 | | |
| 360 | + | |
| 361 | + | |
334 | 362 | | |
335 | 363 | | |
336 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
81 | 95 | | |
82 | 96 | | |
83 | 97 | | |
| |||
178 | 192 | | |
179 | 193 | | |
180 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
181 | 207 | | |
182 | 208 | | |
183 | 209 | | |
| |||
0 commit comments