From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Remounting tmpfs Date: Wed, 17 Apr 2019 22:31:22 +0200 Message-ID: <87muko8jc5.fsf@gnu.org> References: <80844c75-50c6-ff82-6693-db6af0f10551@fastmail.com> <877ec3fcnt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:50869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGrDJ-0007Yk-W5 for help-guix@gnu.org; Wed, 17 Apr 2019 16:31:26 -0400 In-Reply-To: (7e9wc56emjakcm@s.rendaw.me's message of "Wed, 10 Apr 2019 00:24:32 +0900") 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: 7e9wc56emjakcm@s.rendaw.me Cc: help-guix@gnu.org Hi, 7e9wc56emjakcm@s.rendaw.me skribis: > On 4/9/19 11:58 PM, Ludovic Court=C3=A8s 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 =E2=80=9Cactivation programs=E2=80= =9D, which are >> generated from your config. So I=E2=80=99m not sure what you describe w= ould >> 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.= =C2=A0 > Ex: modifying resolv.conf. /etc is writable because of things like =E2=80=98resolv.conf=E2=80=99. /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).=C2=A0 Can you elaborate on what you're sugges= ting > here?=C2=A0 Mounting something other than the overlayfs on /etc would hide > the system config files.=C2=A0 I might be able to use another mount to cr= eate > 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 =E2=80=98guix system vm=E2= =80=99 does: see the #:volatile-root? parameter of =E2=80=98raw-initrd=E2=80=99. Perhaps you could simply set #:volatile-root? #t in your initrd to obtain what you want? Thanks, Ludo=E2=80=99.