From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: File systems Date: Sat, 10 May 2014 23:39:10 +0200 Message-ID: <87eh01titd.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 ([2001:4830:134:3::10]:35813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjEzK-0000ow-Uw for guix-devel@gnu.org; Sat, 10 May 2014 17:39:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjEzB-0004o9-SU for guix-devel@gnu.org; Sat, 10 May 2014 17:39:22 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:43132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjEzB-0004o5-LO for guix-devel@gnu.org; Sat, 10 May 2014 17:39:13 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 74D97285C for ; Sat, 10 May 2014 23:39:11 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q2CGVGQFKjnt for ; Sat, 10 May 2014 23:39:11 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 24E1B53F for ; Sat, 10 May 2014 23:39:11 +0200 (CEST) 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Hello, It=E2=80=99s now possible to declare file systems to be mounted in =E2=80=98operating-system=E2=80=99 declarations, like this: (operating-system (file-systems (list (file-system (device "/dev/sda1") (mount-point "/") (type "ext3") (needed-for-boot? #t)) (file-system (device "/dev/sda2") (mount-point "/home") (type "ext4") (needed-for-boot? #f))) ;; ... ) File systems marked as =E2=80=9Cneeded for boot=E2=80=9D are checked and mo= unted by the initrd. This is always the case for /. The initrd is meant to be provisioned with the necessary kernel modules and fsck programs (see the misnamed =E2=80=98qemu-initrd=E2=80=99 in (guix system linux-initrd).) For each file system not =E2=80=9Cneeded for boot=E2=80=9D, a dmd service i= s created so that it is mounted at a later point during the boot process. To support clean unmounting of file systems upon shutdown, special dmd services are added to the graph (see (gnu services base)): =E2=80=A2 =E2=80=98root-file-system=E2=80=99, whose stop action is to rem= ount / read-only; this is the last service that is stopped when shutting down. =E2=80=A2 For each file system not needed for boot, there=E2=80=99s a =E2=80=98file-system-XYZ=E2=80=99 service depending only on =E2=80=98ro= ot-file-system=E2=80=99, with a stop action to unmount XYZ. =E2=80=A2 =E2=80=98user-processes=E2=80=99, which depends on all the =E2= =80=98file-system-XYZ=E2=80=99 and on =E2=80=98root-file-system=E2=80=99. Its stop action is to kill all the= processes still running. All the services that spawn processes must depend on it. The goal is to make sure the file systems can actually be unmounted. That seems to work well and is rather pleasant to work with. Currently the best way to test it is to build a freestanding VM image: ./pre-inst-env guix system vm-image --image-size=3D1.5GiB \ build-aux/hydra/demo-os.scm demo-os.scm doesn=E2=80=99t specify any file system, but that gets automati= cally added by =E2=80=98system-qemu-image=E2=80=99 in (gnu system vm). Next will come handling of swap devices and the device mapper (for LUKS.) Comments welcome! Ludo=E2=80=99.