aboutsummaryrefslogtreecommitdiff
path: root/src/property
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-04 16:29:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-04 16:29:39 -0700
commit160b76c2bef0541ebcae3363ceebb0666e227451 (patch)
treedde309dc5666138500a4bbf49d8724158b31a2af /src/property
parentcebded4616c69a59767f2f19a071dfda0357d513 (diff)
downloadconsfigurator-160b76c2bef0541ebcae3363ceebb0666e227451.tar.gz
start figuring out representation of host operating systems
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property')
-rw-r--r--src/property/chroot.lisp6
-rw-r--r--src/property/os.lisp57
2 files changed, 60 insertions, 3 deletions
diff --git a/src/property/chroot.lisp b/src/property/chroot.lisp
index 41de6a8..9d0acd1 100644
--- a/src/property/chroot.lisp
+++ b/src/property/chroot.lisp
@@ -18,9 +18,9 @@
(in-package :consfigurator.property.chroot)
(named-readtables:in-readtable :interpol-syntax)
-(defgeneric os-bootstrap (host root &key)
+(defgeneric os-bootstrap (os root &key)
(:documentation
- "Bootstrap HOST's OS into ROOT, e.g. with debootstrap(1)."))
+ "Bootstrap OS into ROOT, e.g. with debootstrap(1)."))
(defproplist os-bootstrapped :posix
(options root properties &aux (host (make-host :props properties)))
@@ -33,4 +33,4 @@
(declare (ignore options host))
(test "-d" root))
(:apply
- (apply #'os-bootstrap host root options)))
+ (apply #'os-bootstrap (car (getf (hostattrs host) :os)) root options)))
diff --git a/src/property/os.lisp b/src/property/os.lisp
new file mode 100644
index 0000000..28e88d3
--- /dev/null
+++ b/src/property/os.lisp
@@ -0,0 +1,57 @@
+;;; 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.os)
+
+(defclass unixlike () ())
+
+(defclass linux (unixlike)
+ ((architecture
+ :initarg :arch :reader linux-architecture
+ :documentation
+ "Keyword whose name is Debian's name for this architecture, e.g. :AMD64")))
+
+(defclass debian (linux)
+ ((suite :initarg :suite
+ :reader debian-suite
+ :initform (error "Must provide suite"))))
+
+(defclass debian-stable (debian) ())
+
+(defprop debian-stable :posix (suite architecture)
+ (:hostattrs
+ (push-hostattrs :os
+ (make-instance 'debian-stable
+ :architecture architecture :suite suite))))
+
+(defclass debian-testing (debian)
+ ((suite :initform "testing")))
+
+(defprop debian-testing :posix (architecture)
+ (:hostattrs
+ (push-hostattrs :os
+ (make-instance 'debian-testing
+ :architecture architecture))))
+
+(defclass debian-unstable (debian)
+ ((suite :initform "unstable")))
+
+(defprop debian-unstable :posix (architecture)
+ (:hostattrs
+ (push-hostattrs :os
+ (make-instance 'debian-unstable
+ :architecture architecture))))