[elbe-users] add binary files to target image

Christian Baur christian.baur at steinbeis-tzs.de
Thu May 7 14:41:33 CEST 2020


Thank you for the suggestion, but i found another way to do it which 
does involve less steps to perform:

With "elbe chg_archive" a directory of the host is attached as archive 
to the XML file and then unpacked by elbe to the target rfs.

This is outlined in the ELBE documentation:
The second diagram from the ELBE Overview chapter shows the steps 
performed inside the build VM 
(https://elbe-rfs.org/docs/sphinx/article-elbeoverview-en.html).

Question:
The step "unpack config archive" is done twice!?
Is this correct and what is the purpose of doing it a second time?


On 05.05.20 19:34, Olivier Dion wrote:
> On Tue, 05 May 2020, Christian Baur <christian.baur at steinbeis-tzs.de> wrote:
>> Hi elbe-users,
>>
>> what is the best way to get files from the host pc into the final image?
>>
>> Long version:
>> I need to integrate several binary files, configs etc. into my x86-64
>> image build by elbe.
>> The files are already in a directory with the layout of the final rfs.
>> Can i mount a directory from my host pc inside the initvm and 'cp -r'
>> everything to the target image?
> 
> 
> You can share your filesystem with the guest using plan 9 network
> filesystem.
> 
> Here are the steps:
> 
> 1. Stop your initvm
> 
> 2. virsh --connect qemu:///system
> 
> 3. virsh # edit initvm
> 
> 4. Add the following in the <devices> node.
> ----------------------------------------------------------------------
>   <filesystem type='mount' accessmode='passthrough'>
>      <driver type='path' wrpolicy='immediate'/>
>      <source dir='/home/olivier/linutronix/elbe'/>
>      <target dir='mydata'/>
>      <readonly/>
> </filesystem>
> ----------------------------------------------------------------------
> Here source directory point to my clone of Elbe.  It should point to
> your directory.  The target directory is _not_ a directory.  It's just a
> label that we're going to reuse later.  Name it however you like.
> 
> 5. Start your initvm and attach to it (or ssh)
> 
> 6. Make sure that you have the following kernel modules loaded:
> ----------------------------------------------------------------------
> loop
> virtio
> 9p
> 9pnet
> 9pnet_virtio
> ----------------------------------------------------------------------
> 
> 7. # mount -t 9p mydata /mnt
> 
> In step 7, we reuse the label 'mydata' from step 4.
> 
> 
> Hope that helped.
> 



More information about the elbe-users mailing list