From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ONafLvubBV+WMAAA0tVLHw (envelope-from ) for ; Wed, 08 Jul 2020 10:12:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8BRxKvubBV8iQAAAB5/wlQ (envelope-from ) for ; Wed, 08 Jul 2020 10:12:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 494CD940390 for ; Wed, 8 Jul 2020 10:12:11 +0000 (UTC) Received: from localhost ([::1]:46952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jt73i-0006gy-0o for larch@yhetil.org; Wed, 08 Jul 2020 06:12:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jt73a-0006fD-LI for guix-patches@gnu.org; Wed, 08 Jul 2020 06:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jt73a-0002Nw-B7 for guix-patches@gnu.org; Wed, 08 Jul 2020 06:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jt73a-00031n-62 for guix-patches@gnu.org; Wed, 08 Jul 2020 06:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42261] [PATCH 3/4] gnu: Add ganeti-instance-debootstrap. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jul 2020 10:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42261 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42261@debbugs.gnu.org Received: via spool by 42261-submit@debbugs.gnu.org id=B42261.159420312111625 (code B ref 42261); Wed, 08 Jul 2020 10:12:02 +0000 Received: (at 42261) by debbugs.gnu.org; 8 Jul 2020 10:12:01 +0000 Received: from localhost ([127.0.0.1]:37460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jt73Y-00031R-P6 for submit@debbugs.gnu.org; Wed, 08 Jul 2020 06:12:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jt73X-00030x-Py for 42261@debbugs.gnu.org; Wed, 08 Jul 2020 06:12:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33615) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jt73S-0002N9-JY for 42261@debbugs.gnu.org; Wed, 08 Jul 2020 06:11:54 -0400 Received: from ti0006q161-3115.bb.online.no ([88.95.106.80]:53156 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jt73R-0001PU-Uy for 42261@debbugs.gnu.org; Wed, 08 Jul 2020 06:11:54 -0400 From: Marius Bakke Date: Wed, 8 Jul 2020 12:11:16 +0200 Message-Id: <20200708101118.3579-3-marius@gnu.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200708101118.3579-1-marius@gnu.org> References: <20200708101118.3579-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: rvn8EGyNOWXr * gnu/packages/virtualization.scm (ganeti-instance-debootstrap): New public variable. --- gnu/packages/virtualization.scm | 95 +++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 3e3e8e3505..5a32577d91 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -46,6 +46,7 @@ #:use-module (gnu packages cross-base) #:use-module (gnu packages curl) #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages debian) #:use-module (gnu packages disk) #:use-module (gnu packages dns) #:use-module (gnu packages docbook) @@ -754,6 +755,100 @@ commodity hardware.") create virtual machines using Guix and an optional configuration file.") (license license:gpl3+))) +(define-public ganeti-instance-debootstrap + (package + (name "ganeti-instance-debootstrap") + ;; We need two commits on top of the latest release for compatibility + ;; with newer sfdisk, as well as gnt-network integration. + (version "0.16-2-ge145396") + (home-page "https://github.com/ganeti/instance-debootstrap") + (source (origin + (method git-fetch) + (uri (git-reference (url home-page) (commit version))) + (sha256 + (base32 + "0f2isw9d8lawzj21rrq1q9xhq8xfa65rqbhqmrn59z201x9q1336")))) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("--sysconfdir=/etc" "--localstatedir=/var") + #:phases (modify-phases %standard-phases + (add-after 'unpack 'add-absolute-references + (lambda _ + (substitute* "common.sh.in" + (("/sbin/blkid") (which "blkid")) + (("kpartx -") + (string-append (which "kpartx") " -"))) + (substitute* "import" + (("restore -r") + (string-append (which "restore") " -r"))) + (substitute* "export" + (("dump -0") + (string-append (which "dump") " -0"))) + (substitute* "create" + (("debootstrap") (which "debootstrap")) + (("`which run-parts`") (which "run-parts")) + ;; Here we actually need to hard code /bin/passwd + ;; because it's called via chroot, which fails if + ;; "/bin" is not in PATH. + (("passwd") "/bin/passwd")) + #t)) + (add-after 'unpack 'set-dpkg-arch + (lambda* (#:key system #:allow-other-keys) + ;; The create script passes --arch to debootstrap, + ;; and defaults to `dpkg --print-architecture` when + ;; ARCH is not set in variant.conf. Hard code the + ;; build-time architecture to avoid the dpkg dependency. + (let ((dpkg-arch + (cond ((string-prefix? "x86_64" system) + "amd64") + ((string-prefix? "i686" system) + "i386") + ((string-prefix? "aarch64" system) + "arm64") + (else (car (string-split system #\-)))))) + (substitute* "create" + (("`dpkg --print-architecture`") + dpkg-arch)) + #t))) + (add-after 'configure 'adjust-Makefile + (lambda _ + ;; Do not attempt to create /etc/ganeti/instance-debootstrap + ;; and /etc/default/ganeti-instance-debootstrap during install. + ;; They are created by the Ganeti service. + (substitute* "Makefile" + (("\\$\\(variantsdir\\)") + "$(prefix)/etc/ganeti/instance-debootstrap/variants") + (("\\$\\(defaultsdir\\)") + "$(prefix)/etc/default/ganeti-instance-debootstrap")) + #t)) + (add-after 'install 'make-variants.list-symlink + (lambda* (#:key outputs #:allow-other-keys) + ;; The Ganeti OS API mandates a variants.list file that + ;; describes all supported "variants" of this OS. + ;; Guix generates this file, so make the original file + ;; a symlink to it. + (with-directory-excursion (string-append + (assoc-ref outputs "out") + "/share/ganeti/os/debootstrap") + (delete-file "variants.list") + (symlink "/etc/ganeti/instance-debootstrap/variants/variants.list" + "variants.list")) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake))) + (inputs + `(("debianutils" ,debianutils) + ("debootstrap" ,debootstrap) + ("dump" ,dump) + ("kpartx" ,multipath-tools) + ("util-linux" ,util-linux))) + (synopsis "Debian OS integration for Ganeti") + (description + "This package provides a guest OS definition for Ganeti. It installs +Debian or a derivative using @command{debootstrap}.") + (license license:gpl2+))) + (define-public libosinfo (package (name "libosinfo") -- 2.27.0