all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: guix-devel@gnu.org
Subject: [PATCH] Allow building other kernels
Date: Sat, 04 Apr 2015 21:54:53 +0200	[thread overview]
Message-ID: <87iodb4qk2.fsf@pobox.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

To use a different kernel, for example do:

  (kernel linux-mine)

  (initrd (lambda (file-systems . rest)
              (apply base-initrd file-systems
                                 #:linux linux-mine
                                 rest)))
                                                    
in your operating-system form.  A starting point for an alternate kernel
definition:

(define-public linux-mine
  (package
    (inherit linux-libre)
    (name "linux-mine")))



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-specification-of-linux-kernel-when-making-an-i.patch --]
[-- Type: text/x-diff, Size: 3161 bytes --]

From 1dbdc673654f94868b0176876dd83fb8b5bfe68c Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Fri, 3 Apr 2015 12:25:26 +0200
Subject: [PATCH 1/3] Allow specification of #:linux kernel when making an
 initrd

* gnu/system/linux-initrd.scm (base-initrd): Add #:linux option to
  specify the linux kernel to use.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Propagate
  #:linux to base-initrd.
  (system-qemu-image, virtualized-operating-system): Delegate to the
  wrapped OS object's initrd builder, to allow the OS to specify the
  kernel.
---
 gnu/system/linux-initrd.scm | 4 ++--
 gnu/system/vm.scm           | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 9feb8f7..1914df9 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -147,6 +147,7 @@ initrd code."
                       qemu-networking?
                       virtio?
                       volatile-root?
+                      (linux linux-libre)
                       (extra-modules '()))
   "Return a monadic derivation that builds a generic initrd.  FILE-SYSTEMS is
 a list of file-systems to be mounted by the initrd, possibly in addition to
@@ -224,8 +225,7 @@ loaded at boot time in the order in which they appear."
              (open source target)))
          mapped-devices))
 
-  (mlet %store-monad ((kodir (flat-linux-module-directory linux-libre
-                                                          linux-modules)))
+  (mlet %store-monad ((kodir (flat-linux-module-directory linux linux-modules)))
     (expression->initrd
      #~(begin
          (use-modules (gnu build linux-boot)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index c93e26d..a551c89 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -149,6 +149,7 @@ made available under the /xchg CIFS share."
        (initrd       (if initrd                   ; use the default initrd?
                          (return initrd)
                          (base-initrd %linux-vm-file-systems
+                                      #:linux linux
                                       #:virtio? #t
                                       #:qemu-networking? #t))))
 
@@ -326,7 +327,7 @@ of the GNU system as described by OS."
   (let ((os (operating-system (inherit os)
               ;; Use an initrd with the whole QEMU shebang.
               (initrd (lambda (file-systems . rest)
-                        (apply base-initrd file-systems
+                        (apply (operating-system-initrd os) file-systems
                                #:virtio? #t
                                #:qemu-networking? #t
                                rest)))
@@ -409,7 +410,7 @@ environment with the store shared with the host.  MAPPINGS is a list of
 
   (operating-system (inherit os)
     (initrd (lambda (file-systems . rest)
-              (apply base-initrd file-systems
+              (apply (operating-system-initrd os) file-systems
                      #:volatile-root? #t
                      #:virtio? #t
                      #:qemu-networking? #t
-- 
2.2.1


[-- Attachment #3: Type: text/plain, Size: 26 bytes --]


-- 
http://wingolog.org/

             reply	other threads:[~2015-04-04 19:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 19:54 Andy Wingo [this message]
2015-04-05 20:31 ` [PATCH] Allow building other kernels Mark H Weaver
2015-04-05 22:28   ` Ludovic Courtès
2015-04-05 20:50 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iodb4qk2.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.