all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Putting a file into system image ~user/ but not on reconfigure
@ 2023-08-09 22:11 Hartmut Goebel
  2023-08-10 12:12 ` wolf
  0 siblings, 1 reply; 7+ messages in thread
From: Hartmut Goebel @ 2023-08-09 22:11 UTC (permalink / raw)
  To: help-guix

   Hi,

   sorry for the hard to understand subject.

   I need to put a file into a system image (into ~user) which will not be
   recreated or touched when running "system reconfigure" later, even if
   not existent. So this is  some kind of "one-time service", removing
   itself on first boot.

   Any ideas how to do this?

   (One could imagine some self-destructing script creating the file.
   Anyhow AFAIK this script would be recreated on next "system
   reconfigure". Als leaving some "script was run" marker is a bad option,
   as removing the marker would recreate the file, which is to be
   avoided.)

   Background:

   I aim to create Vagrant boxes (machine templates) based on guix system
   images. This works quite well so far, using image format qcow2, putting
   the image and some simple files at the right place and the
   vagrant-libvirt plugin for running the machine. Using a symlink I can
   even avoid copying the boxes disk image out of the store — vagrant will
   create a copy when creating a machine anyway.

   Now for vagrant being able to log into the machine when starting it
   (and eventually "provision" the machine = execute some commands) boxes
   are expected to include an "insecure ssh key" in
   ~vagrant/.ssh/authorized_keys. Vagrant will replace this key by another
   one when creating a machine. So this behavior is reasonable secure.

   One possible solution I found (not yet tested and tools not yet in
   guix) is to use one of the guestfstools ([1]https://libguestfs.org/) to
   copy the file into the image. Anyhow this would require copying the box
   out of the store to get a writable file.
--
Regards
Hartmut Goebel

| Hartmut Goebel          | [2]h.goebel@crazy-compilers.com               |
| [3]www.crazy-compilers.com | compilers which you thought are impossible |

References

   1. https://libguestfs.org/
   2. mailto:h.goebel@crazy-compilers.com
   3. http://www.crazy-compilers.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-24 18:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 22:11 Putting a file into system image ~user/ but not on reconfigure Hartmut Goebel
2023-08-10 12:12 ` wolf
2023-08-10 12:38   ` Hartmut Goebel
2023-08-13 14:58     ` Efraim Flashner
2023-08-17 19:30       ` Hartmut Goebel
2023-08-18 12:53         ` Efraim Flashner
2023-08-24 18:57           ` Hartmut Goebel

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.