Hi Philip, hi Bjørn,
This is documented under "Software collections" in
doc/source/swupdate.rst. I remember the dual-copy option was already
discussed in the ML and it should be somewhere. In
examples/description/multi-copy, such a case is covered. The dual-copy
option is a special case of selections, because swupdate really supports
multiple copies of the software, and each of them can have a different
description how to install. But having two identical copies is one of
the most used approach.
This is an example I recently used to test the streaming feature on a
twister board, one of the hardware I use for testing. There are two
copies of the software (kernel in two MTDs, two ubi volumes for rootfs).
In case of eMMC, you have simply two partitions:
software =
{
version = "0.1.0";
twister = {
hardware-compatibility: [ "revA"];
stable : {
copy1 : {
images: (
{
filename = "core-image-full-cmdline.ubifs";
type = "ubivol";
volume = "rootfs1"
installed-directly = true;
},
{
filename = "uImage";
type = "flash";
device = "/dev/mtd7";
}
);
scripts: (
{
filename = "test.lua";
type = "lua";
}
);
uboot: (
{
name = "rootfs";
value = "rootfs1";
}
);
};
copy2 : {
images: (
{
filename = "core-image-full-cmdline.ubifs";
type = "ubivol";
volume = "rootfs2"
installed-directly = true;
},
{
filename = "uImage";
type = "flash";
device = "/dev/mtd8";
}
);
scripts: (
{
filename = "test.lua";
type = "lua";
}
);
uboot: (
{
name = "rootfs";
value = "rootfs2";
}
);
};
};
}
}
Maybe I can push this into examples/description, naming it as dual-copy
of something like that.
The active package must be determined before calling swupdate. This
makes sense, because there could be more ways to do this, and how can
depend on the target. Let's simplify and a simple way is to check where
is mounted / - again, something more complicate can be necessary.
Then you run swupdate -e "stable,copy2" if the active package runs on
"copy1", and swupdate -e "stable,copy1" in the other case. In the
example, I use the U-Boot variable "name" to inform U-Boot to switch,
and this variable is used in U-Boot script to set the bootargs variable.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================