Hi Aditya,
On Mon, Oct 16, 2017 at 9:36 AM, Aditya Purohit
<
adityapur...@gmail.com> wrote:
> Hi Stefano,
> I am using Swupdate with Hawkbit integration. While creating the update
> bundle, in my sw-description file, I have to mention the name of the device
> name e.g /dev/mmcblk0pX while sending the update images. This is causing a
> problem as in A/B approach, I cannot tell which is the active partition on
> my device right now and which partition the update must be installed.
See the "-e" option of SWUpdate:
https://sbabic.github.io/swupdate/swupdate.html#configuring-swupdate
Another alternative option is:
1. specify a non-existent device name in the update file, like "/dev/root"
2. in the preinst script identify you current passive partition, and
create a link to it called "/dev/root". For example "ln -s
/dev/mmcblk0pX /dev/root"
3. in the postinst script remove the link
You can find an example of this technique used by Gary Bisson here:
https://boundarydevices.com/using-swupdate-upgrade-system/
https://storage.googleapis.com/boundarydevices.com/swupdate/update.sh
>
> Does / Will Swupdate provide a mechanism wherein I can simply give a tag eg
> root, application etc. and Swupdate will check for the active partition and
> automatically install the update image to the inactive partition.
>
> P.S. : This feature would be useful for group updates using hawkbit wherein
> the same update bundle can be used for all devices.
>
I too feel sometimes specifying device name is limiting, for example
when using the same image for eMMC or microSD.
Maybe using Persistent device naming:
https://wiki.archlinux.org/index.php/Persistent_block_device_naming
could give some help / provide additional options. Unfortunately it
requires udev (not to take as a given in small ramdisks). Additionally
it would not solve the problem for the files handler as the mount
command line tool support using e.g. labels, but the C call doesn't.
Bests,
Diego Rondini
Sr. Embedded Engineer
Kynetics
www.kynetics.com