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 | |
parent | 1bf6955369fe47a0cc171b69466e5b6d5b96151c (diff) | |
download | consfigurator-dd578c43c852ffbc2196359be441139f7c2c12c2.tar.gz |
initial ideas for structure of chroot-bootstrapping properties
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | consfigurator.asd | 1 | ||||
-rw-r--r-- | indentation.el | 1 | ||||
-rw-r--r-- | src/package.lisp | 8 | ||||
-rw-r--r-- | src/property/chroot.lisp | 36 |
4 files changed, 44 insertions, 2 deletions
diff --git a/consfigurator.asd b/consfigurator.asd index 34dda3f..c65a47f 100644 --- a/consfigurator.asd +++ b/consfigurator.asd @@ -26,5 +26,6 @@ (:file "src/connection/chroot/fork") (:file "src/property/cmd") (:file "src/property/file") + (:file "src/property/chroot") (:file "src/data/asdf") (:file "src/data/pgp"))) diff --git a/indentation.el b/indentation.el index 333719c..6b7d1dc 100644 --- a/indentation.el +++ b/indentation.el @@ -3,3 +3,4 @@ (put 'deploys. 'common-lisp-indent-function '(4 4 2)) (put 'deploys-these. 'common-lisp-indent-function '(4 4 2)) +(put 'chroot:os-bootstrapped. 'common-lisp-indent-function '(4 4 2)) diff --git a/src/package.lisp b/src/package.lisp index b062664..f74ee1e 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -103,10 +103,10 @@ #:defdeploy-these #:deploy #:deploy* - #:deploys + #:deploys #:deploys. #:deploy-these #:deploy-these* - #:deploys-these + #:deploys-these #:deploys-these. #:continue-deploy* ;; data.lisp @@ -166,6 +166,10 @@ #:consfigurator #:consfigurator.connection.shell-wrap)) +(defpackage :consfigurator.property.chroot + (:use #:cl #:consfigurator) + (:export #:os-bootstrapped #:os-bootstrapped.)) + (defpackage :consfigurator.property.cmd (:use #:cl #:consfigurator) (:export #:single)) 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))) |