Hi Benoit,
On 03.08.23 18:44, Benoit SANSONI wrote:
> well, I would like to have your advice.
>
> I use the systemctl switch-root before mounting an .ext4 rootfs to
> /tmp/mnt for example in loop device.*
> the .swu image is include in the .ext4 file.
>
You should first check what you want to achieve. Of course, neither
openWRT nor current distro are replacing the block device how you were
attempting before. And yes, SWUpdate can do it: SWUpdate is a framework,
you should understand and write your own concept. SWUpdate will simply
do what you ask it, even destroy the complete system (as you already
experienced).
> I seems that it can be a solution :
>
> root@board:~# mount ./core-image-minimal.ext4 /tmp/rootfs/
> [15062.142021] loop1: detected capacity change from 0 to 1429504
> [15062.145195] EXT4-fs (loop1): mounted filesystem with ordered data
> mode. Opts: (null). Quota mode: disabled.
This could be you have a rootfs on tmpfs that disappear after a reboot.
It does not work when rootfs increase and becomes beigger than available
RAM.
> root@board:~# cp core-image-minimal.swu /tmp/rootfs/home/root
> root@board:~# systemctl --no-block --force switch-root /tmp/rootfs
> ...
> root@board:~# mount |grep root
> /home/root/core-image-minimal.ext4 on / type ext4 (rw,relatime) <= I
> am in my rootfs.
>
> Now I run swupdate in this environment that allow me to flash my
> /dev/sda without having a second rootfs.
You *have* a seconf rootfs, like openWRT *has* a second rootfs.
Best regards,
Stefano Babic
>
https://groups.google.com/g/swupdate/c/khIZyYPIa68/m/8ZQCPunyAQAJ <
https://groups.google.com/g/swupdate/c/khIZyYPIa68/m/8ZQCPunyAQAJ>
>
> Best regards,
> Stefano Babic
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/swupdate/4c87747b-4921-4f12-8987-aea52f3e667en%40googlegroups.com <
https://groups.google.com/d/msgid/swupdate/4c87747b-4921-4f12-8987-aea52f3e667en%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================