From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: Mark /gnu/store as needed for boot. Date: Sat, 14 Jan 2017 22:30:43 +0100 Message-ID: <877f5xjpmk.fsf@gnu.org> References: <1484164902-10160-1-git-send-email-jmd@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 ([2001:4830:134:3::10]:37890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSVuV-0000UU-Pq for guix-devel@gnu.org; Sat, 14 Jan 2017 16:30:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSVuS-0000Rx-Ku for guix-devel@gnu.org; Sat, 14 Jan 2017 16:30:51 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSVuS-0000Rr-HI for guix-devel@gnu.org; Sat, 14 Jan 2017 16:30:48 -0500 In-Reply-To: <1484164902-10160-1-git-send-email-jmd@gnu.org> (John Darrington's message of "Wed, 11 Jan 2017 21:01:42 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: John Darrington Cc: guix-devel@gnu.org Hi! John Darrington skribis: > * gnu/system/file-systems.scm (all-subpaths): New procedure. > (file-system-needed-for-boot?): Use it to check for ancestors > of %store-directory. I guess the idea is to have =E2=80=98needed-for-boot?=E2=80=99 automaticall= y set for users who store /gnu or /gnu/store on a separate partition, right? In =E2=80=98%separate-store-os=E2=80=99 in (gnu tests install), it is set e= xplicitly: (file-systems (cons* (file-system (device "root-fs") (title 'label) (mount-point "/") (type "ext4")) (file-system (device "store-fs") (title 'label) (mount-point "/gnu") (type "ext4") (needed-for-boot? #t)) ;definitely! %base-file-systems)) Making it automatic can help though. > (define-inlinable (file-system-needed-for-boot? fs) > - "Return true if FS has the 'needed-for-boot?' flag set, or if it's the= root > -file system." > + "Return true if FS has the 'needed-for-boot?' flag set, or if it holds > +the store directory." > (or (%file-system-needed-for-boot? fs) > - (string=3D? "/" (file-system-mount-point fs)))) > + (member (file-system-mount-point fs) (all-subpaths (%store-directo= ry))))) The problem is that we need to exclude bind mounts, as done in =E2=80=98store-file-system=E2=80=99 in (gnu system). What about: (define (file-system-needed-for-boot? fs) (or (%file-system-needed-for-boot? fs) (and (string-prefix? (file-system-mount-point fs) (%store-directory= )) (not (memq 'bind-mount (file-system-flags fs)))))) ? Thanks, Ludo=E2=80=99.