[SWUpdate]: Disk partitioner

19 views
Skip to first unread message

Pratik Manvar

unread,
Nov 25, 2025, 7:47:20 AM (8 days ago) Nov 25
to swupdate
Hi Stefano,
I am using the disk partitioner with my swu file.
But with SWUpdate v2024.12 onwards (With the commit https://github.com/sbabic/swupdate/commit/b0935d27bf73f625e23533e921308f007ca952a9), I am facing the issue that it always skip the partitioning stuff.

The reason is my hook function is returning true and that makes below condition always true. Could you please help me to understand this change? Thank you!

```
if (skip || partition->skip != SKIP_NONE) {
free_image(partition);
continue;
}
```

Regards,
Pratik Manvar

Stefano Babic

unread,
Nov 25, 2025, 9:41:32 AM (8 days ago) Nov 25
to Pratik Manvar, swupdate
Hi Pratik,

On 11/25/25 13:47, Pratik Manvar wrote:
> Hi Stefano,
> I am using the disk partitioner with my swu file.
> But with SWUpdate v2024.12 onwards (With the commit https://github.com/
> sbabic/swupdate/commit/b0935d27bf73f625e23533e921308f007ca952a9), I am
> facing the issue that it always skip the partitioning stuff.
>
> The reason is my hook function is returning true and that makes below
> condition always true. Could you please help me to understand this
> change? Thank you!

The change align partition to all hooks. A hook must always return two
values, and it seems you are returning just one. First is the result,
second one is the table with attribute.

A hook should be:

function(image)

......

-- then one of

return true,image

return false,image

return true, none

The last one is interpreted as "skip this" and as feeling this is what
you are doing. Try with "return true, image".

Note that the partition handler already works by compari8ng old and new
partition layout, and if nothing has changed, the handler doesm't try to
write the partition table.

>
> ```
> if (skip || partition->skip != SKIP_NONE) {
> free_image(partition);
> continue;
> }
> ```


Best regards,
Stefano Babic

Pratik Manvar

unread,
Nov 26, 2025, 4:00:15 AM (7 days ago) Nov 26
to swupdate
Hi Stefano,

Oh, yes. I missed that point.
Thank you for pointing that out and for your quick support.

Thanks & Regards,
Pratik Manvar

Reply all
Reply to author
Forward
0 new messages