Does swupdate support updating a root file system with archive?

1,463 views
Skip to first unread message

Kwan Ben

unread,
Jun 23, 2016, 5:09:50 AM6/23/16
to swupdate
Hi,
According to my current understanding, swupdate support update a root file system with file system image, e.g. flash rootfs.ext3 to /dev/mmcblk1p1.

Does it support a archive also?
E.g. I have my root file system in root.tar.gz, than I want to extract it to / of /dev/mmcblk1p1.

I make a demo swupdate image for test, it seems that the path could not be a directory, right?

And I also found: install a new file to a inexistent path will fail, it seems that swupdate won't create the parent path like "mkdir -p".

Thanks in advance.

Stefano Babic

unread,
Jun 23, 2016, 5:42:54 AM6/23/16
to Kwan Ben, swupdate
Hi Ben,

On 23/06/2016 11:09, Kwan Ben wrote:
> Hi,
> According to my current understanding, swupdate support update a root
> file system with file system image, e.g. flash rootfs.ext3 to
> /dev/mmcblk1p1.
>
> Does it support a archive also?
> E.g. I have my root file system in root.tar.gz, than I want to extract
> it to / of /dev/mmcblk1p1.

This does not make sense - if you have a *tarball*, you have to install
it into a valid path, that means you have to provide a valid filesystem
for it.

If you want to install a tarball into a path, you have to use *file* and
not *image*. Of course, /dev/mmcblk1p1 must contain a valid filesystem
(even empty), else swupdate cannot mount it.

If the device does not contain a valid filesystem, you can add a pre-
install script to do it.

>
> I make a demo swupdate image for test, it seems that the path could not
> be a directory, right?
>

????


> And I also found: install a new file to a inexistent path will fail, it
> seems that swupdate won't create the parent path like "mkdir -p".

?????


If /dev/mmcblk1p1 contains a valid filesystem, you can use "/" as path.
Anyway, mkdir -p does not create "parent" path (or no idea what you mean
here).

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
=====================================================================

Anatolij Gustschin

unread,
Jun 23, 2016, 5:57:03 AM6/23/16
to Kwan Ben, swupdate
Hi,

On Thu, 23 Jun 2016 02:09:50 -0700 (PDT)
Kwan Ben free...@gmail.com wrote:

>Hi,
>According to my current understanding, swupdate support update a root file
>system with file system image, e.g. flash rootfs.ext3 to /dev/mmcblk1p1.
>
>Does it support a archive also?

yes, please try with something like this in sw-description:

files: (
{
filename = "root.tar.gz";
device = "/dev/mmcblk1p1";
type = "archive";
filesystem = "ext3";
path = "/";
sha256 = "@root.tar.gz";
}
);

>E.g. I have my root file system in root.tar.gz, than I want to extract it
>to / of /dev/mmcblk1p1.
>
>I make a demo swupdate image for test, it seems that the path could not be
>a directory, right?

yes, path = "/"; worked for me. The partition should already be formatted
however. You can use a pre-install script to format the partition first.

HTH,

Anatolij

Kwan Ben

unread,
Jun 23, 2016, 11:21:33 PM6/23/16
to swupdate, free...@gmail.com
Hi Gustschin,

Thank you for your reply.

I should add for detail about my prototype before.

My case is:
I have a ext3 partition which mount /dev/mmcblk1p1 in /run/media/mmcblk1p1. It is a empty valid ext3 partition.
I use the swupdate from latest master branch.

 My sw-description file:

software =
{
    files: (
        {
            filename = "rootfs.tar.gz";
            path = "/";
            device = "/dev/mmcblk1p1";
            filesystem = "ext3";
            compressed = true;
        },
        {
            filename = "zImage";
            path = "/boot/zImage";
            device = "/dev/mmcblk1p1";
            filesystem = "ext3";
            type = "rawfile";
        },
        {
            filename = "dummydt.dtb";
            path = "/boot/dummydt.dtb";
            device = "/dev/mmcblk1p1";
            filesystem = "ext3";
            type = "rawfile";
        },
        {
            filename = "uEnv.txt";
            path = "/boot/uEnv.txt";
            device = "/dev/mmcblk1p1";
            filesystem = "ext3";
            type = "rawfile";
        },
    );
}
 
Because there is no boot directory under the root of /run/media/mmcblk1p1, I got this error when I executed "swupdate -i my-prototype_1.0.swu":

ERROR core/util.c : openfileoutput : 111 : I cannot open /tmp/datadst//boot/uEnv.txt 2

[NOTIFY] : SWUPDATE failed [0] ERROR core/util.c : openfileoutput : 111 : I cannot open /tmp/datadst//boot/uEnv.txt 2

ERROR core/cpio_utils.c : copy_write : 104 : cannot write 28 bytes
[NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c : copy_write : 104 : cannot write 28 bytes
ERROR handlers/raw_handler.c : install_raw_file : 96 : Error copying extracted file

[NOTIFY] : SWUPDATE failed [0] ERROR handlers/raw_handler.c : install_raw_file : 96 : Error copying extracted file

[NOTIFY] : SWUPDATE running :  [install_single_image] : Installer for rawfile not successful !
Software updated failed


If create the boot folder manually before update, the zImage, dummydt.dtb adn uEnv.txt could be copied successfully.

But after that I got a error in handling the archive:

The archive works after I replace compressed = true; with type="archive";

在 2016年6月23日星期四 UTC+8下午5:57:03,Anatolij Gustschin写道:
Reply all
Reply to author
Forward
0 new messages