diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-04 15:39:45 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-04 15:48:02 -0700 |
commit | dd578c43c852ffbc2196359be441139f7c2c12c2 (patch) | |
tree | 056112bca922cc1367c3310c31c8c3a682edf117 /src/property/chroot.lisp | |
parent | 1bf6955369fe47a0cc171b69466e5b6d5b96151c (diff) | |
download | consfigurator-dd578c43c852ffbc2196359be441139f7c2c12c2.tar.gz |
initial ideas for structure of chroot-bootstrapping properties
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/chroot.lisp')
-rw-r--r-- | src/property/chroot.lisp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/property/chroot.lisp b/src/property/chroot.lisp new file mode 100644 index 0000000..41de6a8 --- /dev/null +++ b/src/property/chroot.lisp @@ -0,0 +1,36 @@ +;;; Consfigurator -- Lisp declarative configuration management system + +;;; Copyright (C) 2021 Sean Whitton <spwhitton@spwhitton.name> + +;;; This file is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3, or (at your option) +;;; any later version. + +;;; This file is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. + +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +(in-package :consfigurator.property.chroot) +(named-readtables:in-readtable :interpol-syntax) + +(defgeneric os-bootstrap (host root &key) + (:documentation + "Bootstrap HOST's OS into ROOT, e.g. with debootstrap(1).")) + +(defproplist os-bootstrapped :posix + (options root properties &aux (host (make-host :props properties))) + (:desc #?"Built chroot ${root}") + (%os-bootstrapped options root host) + (deploys `((:chroot :into ,root)) host)) + +(defprop %os-bootstrapped :posix (options root host) + (:check + (declare (ignore options host)) + (test "-d" root)) + (:apply + (apply #'os-bootstrap host root options))) |