From mboxrd@z Thu Jan 1 00:00:00 1970 From: rendaw <7e9wc56emjakcm@s.rendaw.me> Subject: Re: Remounting tmpfs Date: Thu, 18 Apr 2019 05:50:17 +0900 Message-ID: <6f19ef09-22fb-2843-37bb-b16ecfe8fa96@s.rendaw.me> References: <80844c75-50c6-ff82-6693-db6af0f10551@fastmail.com> <877ec3fcnt.fsf@gnu.org> <87muko8jc5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:54133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <7e9wc56emjakcm@s.rendaw.me>) id 1hGrVn-0002eJ-Dh for help-guix@gnu.org; Wed, 17 Apr 2019 16:50:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <7e9wc56emjakcm@s.rendaw.me>) id 1hGrVl-0003CL-Gr for help-guix@gnu.org; Wed, 17 Apr 2019 16:50:31 -0400 In-Reply-To: <87muko8jc5.fsf@gnu.org> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= Cc: help-guix@gnu.org On 4/18/19 5:31 AM, Ludovic Courtès wrote: > Hi, > > 7e9wc56emjakcm@s.rendaw.me skribis: > >> On 4/9/19 11:58 PM, Ludovic Courtès wrote: >>> Hello, >>> >>> 7e9wc56emjakcm@s.rendaw.me skribis: >>> >>>> On a system I'm porting to guix I have 2GB tmpfs with subdirectories >>>> like /tmpfs/etc that I remount to /etc with an overlay filesystem. >>>> >>>> The current way I do this in systemd is making a service dependency >>>> between the /tmpfs and /etc mounts that mkdirs /tmpfs/etc and >>>> /tmpfs/etc_work, but AFAICT filesystem definitions in guix can only have >>>> filesystem dependencies. >>>> >>>> Are there any other ways I can do this without copying/pasting/modifying >>>> gobs of core guix code into my system definition? Like somehow >>>> appending (mkdir /tmpfs/etc) onto the tmpfs filesystem service start >>>> procedure or something. >>> In Guix /etc is mostly populated by “activation programs”, which are >>> generated from your config. So I’m not sure what you describe would >>> make much sense. >> So if /etc can be read-only and boot I'm probably fine... my experience >> with other distros was that some other processes needed to write to it.  >> Ex: modifying resolv.conf. > /etc is writable because of things like ‘resolv.conf’. > > /etc consists mostly of immutable files derived directly from your OS > config (/etc/passwd, /etc/hosts, /etc/polkit-1, /etc/pam.d, etc.), along > with files that contains bits of state (/etc/shadow, /etc/resolv.conf.) > > The former are directly managed by Guix, while the latter are either > left as is or touched with care by Guix (/etc/shadow in particular.) > >>> Now, you could try to add a file system declaration that mounts /etc, >>> with (needed-for-boot? #t). >> My goal is to have a read-only / mount with the ability for programs to >> make temporary modifications for operational purposes when necessary, in >> limited scopes (like /etc).  Can you elaborate on what you're suggesting >> here?  Mounting something other than the overlayfs on /etc would hide >> the system config files.  I might be able to use another mount to create >> a pseudo- /tmpfs/etc_work subdirectory but it sounds kind of wormy and >> overlayfs requires the upper dir and workdir to be the same filesystem >> which I think precludes doing any mounting for those subdirectories. > The overlay makes a lot of sense. This is what ‘guix system vm’ does: > see the #:volatile-root? parameter of ‘raw-initrd’. > > Perhaps you could simply set #:volatile-root? #t in your initrd to > obtain what you want? > > Thanks, > Ludo’. Thanks, yeah, that sounds exactly like what I want!  TBH I think something's going on strange with my threads, perhaps because I messed up the replies -- after much source reading I found volatile-root and asked about it in my disk-image thread.  TBH I'm not clear how that would be set in the config to use with disk-image to get a whole system.