[elbe-users] removing file in finetuning will upset archive validation

Olivier Dion dion at linutronix.de
Mon Mar 23 17:14:53 CET 2020


On Mon, 23 Mar 2020, ew.foe at nassur.net wrote:
> Dear developers,
>
> being banned to the home office I have had time to play with elbe
> (v12.3).
>
> So one of the things I'm doing in practically all my builds at work,
> is this: via a build script
>
> - I collect the content of a given directory (./local-changes/) into
>    an archive added to a temporary .xml file
>    : cp mybuild.xml tmp.mybuild.xml
>    : elbe chg_archive tmp.mybuild.xml ./local-changes
>
> - then I start elbe initvm and submit this build
>
> - during the finetuning stage one of the files in the archive is
>    called and deleted afterwards:
>    : cat mybuild.xml
>    :     <finetuning>
>    :         <!-- run the separate script from archive -->
>    :         <command>chmod 0750 /root/f.finetuning.sh</command>
>    :         <command>/root/f.finetuning.sh</command>
>    :         <!-- remove the script afterwards -->
>    :         <rm>/root/f.finetuning.sh</rm>
>    :     </finetuning>
>
> - this fails
>
>    : [INFO] Archive validation
>    : [INFO] ------------------
>    : [INFO]
>    : [ERROR] Archive file /root/f.finetuning.sh deleted in finetuning
>    : [CMD] mkdir -p  
> /var/cache/elbe/edeaff54-cd39-4457-b429-b9e1d5c652e9/filesystems
>
> - this and has been reported before:
>    http://lists.linutronix.de/pipermail/elbe-users/2019-November/000095.html
>    http://lists.linutronix.de/pipermail/elbe-users/2020-February/000108.html
>
>
>  From the log files I understand that the commands are executed fine.
> However, the archive validation step does not know, that the file was
> removed intentionally.
>
> So what is the correct way to do this?

For your current situation, a sub-tag could be added to the tag archive.

Something along the lines:
----------------------------------------------------------------------
<archive>
...
<expect-deleted>/root/f.finetuning.sh</expect-deleted>
<expect-modified>/root/f.finetuning.sh</expect-modified>
...
</archive
----------------------------------------------------------------------

However I see another possibility.  You could 'curl/wget/scp' your
script, execute it then delete it.  Since the script is not part of the
archive, it should not raise an error.

Or write the entire script in a <raw_cmd> tag ..

>
> One can argue that this should not be available, because rebuilding
> the image will be impossible later, if the script is not available.

-- 
Olivier Dion
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen



More information about the elbe-users mailing list