all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: 63527@debbugs.gnu.org
Subject: [bug#63527] [PATCH 1/3] DRAFT gnu: Add rumpkernel.
Date: Mon, 15 May 2023 21:36:57 +0200	[thread overview]
Message-ID: <3c1235a19285d40174f0aadb1ac5fdead22f2961.1684177770.git.janneke@gnu.org> (raw)
In-Reply-To: <cover.1684177770.git.janneke@gnu.org>

XXX We should probably not use Debian Salsa as source for the rumpkernel
checkout and patches and use the rumpkernel upstream instead copying Debian's
patches into our archive?  Using the easier route as a first attempt to git it
to build (and boot) first.

* gnu/packages/hurd.scm (rumpkernel): New variable.
---
 gnu/packages/hurd.scm | 216 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 215 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 34c7c00f2d..f834abcf43 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2018, 2020-2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2020, 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020, 2022, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Rene Saavedra <pacoon@protonmail.com>
 ;;;
@@ -662,3 +662,217 @@ (define-public netdde
       ;; Some drivers are dually licensed with the options being GPLv2 or one
       ;; of MPL/Expat/BSD-3 (dependent on the driver).
       (license gpl2))))
+
+(define-public rumpkernel
+  (let ((commit "cd34aee0ee0f7a06011b2f988ce27a8fdc7ba900")
+        (revision "0"))
+    (package
+      (name "rumpkernel")
+      (version (git-version "0-20211031" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://salsa.debian.org/hurd-team/rumpkernel.git")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0dqr6nzsv25p66yiambq4jcq4870vzf23289cns0gdpk74gamm4l"))
+                (file-name (git-file-name name commit))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:tests? #f
+        #:modules '((srfi srfi-26)
+                    (ice-9 match)
+                    (ice-9 rdelim)
+                    (guix build utils)
+                    (guix build gnu-build-system))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'apply-patches
+              (lambda* (#:key target #:allow-other-keys)
+                (let* ((patch-directory "debian/patches/")
+                       (series (string-append patch-directory "series"))
+                       (text (with-input-from-file series read-string))
+                       (lines (string-split (string-trim-right text) #\newline))
+                       (patches (filter (negate (cute string-prefix? "#" <>))
+                                        lines))
+                       (patch-files (map (cute string-append patch-directory <>)
+                                         patches)))
+                  (for-each
+                   (cute invoke "patch" "--force" "-p1" "-i" <>)
+                   patch-files)
+                  (when target
+                    (substitute* "pci-userspace/src-gnu/Makefile.inc"
+                      (("\\<mig\\>")
+                       (string-append target "-mig")))
+                    (substitute* "buildrump.sh/src/build.sh"
+                      (("if [[] \"$[{]tool[}]\" = \"CC\" []]; then" all)
+                       (string-append
+                        "if [ \"${tool}\" = \"AR\" ]; then
+		lctool=${TARGET_AR-ar}
+	elif [ \"${tool}\" = \"NM\" ]; then
+		lctool=${TARGET_NM-nm}
+el"
+                        all))))
+                  ;; Avoid #! /gnu/store/...-bash/gnu/store/...-bash/bin/sh
+                  (substitute* '("buildrump.sh/src/tools/genassym/Makefile"
+                                 "buildrump.sh/src/tools/lorder/Makefile")
+                    (("[$][{]TOOL_SED[}] -e \"s,/bin/sh")
+                     "${TOOL_SED} -e \"s,[ !]/bin/sh")))))
+            (add-before 'configure 'setenv
+              (lambda* (#:key build target #:allow-other-keys)
+                (define (noisy-setenv name value)
+                  (setenv name value)
+                  (format (current-error-port) "set ~a=~s\n" name value))
+                (noisy-setenv "HOST_CC" "gcc")
+                (let ((target (or target build)))
+                  (noisy-setenv "TARGET_AR" (string-append target "-ar"))
+                  (noisy-setenv "TARGET_CC" (string-append target "-gcc"))
+                  (noisy-setenv "TARGET_CXX" (string-append target "-g++"))
+                  (noisy-setenv "TARGET_LD" (string-append target "-ld"))
+                  (noisy-setenv "TARGET_NM" (string-append target "-nm")))
+                (setenv "PAWD" "pwd")
+                (for-each
+                 (cute noisy-setenv <> "")
+                 '("_GCC_CRTENDS"
+                   "_GCC_CRTEND"
+                   "_GCC_CRTBEGINS"
+                   "_GCC_CRTBEGIN"
+                   "_GCC_CRTI"
+                   "_GCC_CRTN"))
+                (noisy-setenv "BSDOBJDIR=" (string-append (getcwd) "/obj"))))
+            (replace 'configure
+              (lambda args
+                (let ((configure (assoc-ref %standard-phases 'configure)))
+                  (with-directory-excursion "buildrump.sh/src/lib/librumpuser"
+                    (apply configure args)))))
+            (replace 'build
+              (lambda* (#:key parallel-build? #:allow-other-keys)
+                (let* ((jobs (if parallel-build? (parallel-job-count) 1))
+                       (host-cpu (match #$(or (%current-target-system
+                                               (%current-system)))
+                                   ("i586-pc-gnu" "i386")
+                                   ("i686-linux" "i386")
+                                   ("x86_64-linux" "amd64")))
+                       (toprump (string-append
+                                 (getcwd)
+                                 "/buildrump.sh/src/sys/rump"))
+                       (rump-make (string-append
+                                   (getcwd)
+                                   "/buildrump.sh/src/obj/tooldir/bin/nbmake-"
+                                   host-cpu)))
+                  (mkdir "obj")
+                  (with-directory-excursion "buildrump.sh/src"
+                    (invoke
+                     "sh" "build.sh"
+                     "-V" "TOOLS_BUILDRUMP=yes"
+                     "-V" "MKBINUTILS=no" 
+                     "-V" "MKGDB=no" 
+                     "-V" "MKGROFF=no" 
+                     "-V" (string-append "TOPRUMP=" toprump)
+                     "-V" "BUILDRUMP_CPPFLAGS=-Wno-error=stringop-overread"
+                     "-V" "RUMPUSER_EXTERNAL_DPLIBS=pthread" 
+		     "-V" (string-append
+                           "CPPFLAGS="
+                           " -I../../obj/destdir." host-cpu "/usr/include"
+                           " -D_FILE_OFFSET_BITS=64"
+                           " -DRUMP_REGISTER_T=int"
+                           " -DRUMPUSER_CONFIG=yes"
+                           " -DNO_PCI_MSI_MSIX=yes"
+                           " -DNUSB_DMA=1")
+                     "-V" (string-append
+                           "CWARNFLAGS="
+                           " -Wno-error=maybe-uninitialized"
+                           " -Wno-error=address-of-packed-member"
+                           " -Wno-error=unused-variable"
+                           " -Wno-error=stack-protector"
+                           " -Wno-error=array-parameter"
+                           " -Wno-error=array-bounds"
+                           " -Wno-error=stringop-overflow")
+                     "-V" "LIBCRTBEGIN="
+                     "-V" "LIBCRTEND="
+                     "-V" "LIBCRT0="
+                     "-V" "LIBCRTI="
+                     "-V" "_GCC_CRTENDS="
+                     "-V" "_GCC_CRTEND="
+                     "-V" "_GCC_CRTBEGINS="
+                     "-V" "_GCC_CRTBEGIN="
+                     "-V" "_GCC_CRTI="
+                     "-V" "_GCC_CRTN="
+                     "-U"
+                     "-u"
+                     "-T" "./obj/tooldir"
+                     "-m" host-cpu
+                     "-j" (number->string jobs)
+                     "tools"
+                     "rump"))
+                  (with-directory-excursion "buildrump.sh/src/lib/librumpuser"
+                    (setenv "RUMPRUN" "true")
+                    (invoke rump-make "dependall"))
+                  (with-directory-excursion "pci-userspace/src-gnu"
+                    (invoke rump-make "dependall")))))
+            (replace 'install
+              (lambda _
+                (define (install-file file target)
+                  (let ((dest (string-append target (basename file))))
+                    (format (current-output-port) "`~a' -> `~a'~%" file dest)
+                    (mkdir-p (dirname dest))
+                    (if (file-exists? dest)
+                        (format (current-error-port)
+                                "warning: skipping: ~a\n" file)
+                        (let ((stat (lstat file)))
+                          (case (stat:type stat)
+                            ((symlink)
+                             (let ((target (readlink file)))
+                               (symlink target dest)))
+                            (else
+                             (copy-file file dest)))))))
+                (let ((header (string-append #$output "/include/rump"))
+                      (lib (string-append #$output "/lib/")))
+                  (mkdir-p header)
+                  (copy-recursively "buildrump.sh/src/sys/rump/include/rump"
+                                    header)
+                  (mkdir-p lib)
+                  (for-each
+                   (cute install-file <> lib)
+                   (append (find-files "buildrump.sh/src" "librump.*[.](a|so.*)")
+                           (find-files "obj" "librump.*[.](a|so.*)")))))))))
+      (inputs
+       (list gnumach-headers libpciaccess))
+      (native-inputs
+       (list
+        autoconf
+        automake
+        libgcrypt
+        (if (%current-target-system)
+            (let* ((cross-base (resolve-interface '(gnu packages cross-base)))
+                   (cross-mig (module-ref cross-base 'cross-mig)))
+              (cross-mig (%current-target-system)))
+            mig)
+        zlib))
+      (supported-systems %hurd-systems)
+      (home-page "https://wiki.netbsd.org/rumpkernel")
+      (synopsis "NetBSD as rumpkernel for the GNU/Hurd")
+      (description
+       "This package provides NetBSD as rumpkernel for the GNU/Hurd, so that
+the Hurd may be installed on iron.  Using this rumpkernel package, the hurd
+package's rumpdisk can be built which provides the pci.arbiter and rumpdisk
+servers.")
+      (license (list
+                asl2.0
+                boost1.0
+                bsd-2
+                bsd-3
+                bsd-4
+                cddl1.0
+                expat
+                gpl1
+                gpl2+
+                gpl3+
+                isc
+                lgpl2.0+
+                public-domain
+                (@ (guix licenses) zlib)
+                (non-copyleft "file://src/lib/libc/hash/hashhl.c"
+                              "See debian/copyright in the distribution."))))))
-- 
2.39.2





  reply	other threads:[~2023-05-15 19:38 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 19:35 [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Janneke Nieuwenhuizen
2023-05-15 19:36 ` Janneke Nieuwenhuizen [this message]
2023-05-15 19:36 ` [bug#63527] [PATCH 2/3] gnu: hurd: Add rumpkernel Janneke Nieuwenhuizen
2023-05-15 19:36 ` [bug#63527] [PATCH 3/3] DRAFT system: hurd: Boot with pci.arbiter and rumpdisk Janneke Nieuwenhuizen
2023-05-16 13:48 ` [bug#63527] [PATCH v2 0/3] Initial attempt at rumpdisk support for the Hurd Janneke Nieuwenhuizen
2023-05-16 13:48   ` [bug#63527] [PATCH v2 1/3] gnu: Add rumpkernel Janneke Nieuwenhuizen
2023-05-16 13:48   ` [bug#63527] [PATCH v2 2/3] gnu: hurd: " Janneke Nieuwenhuizen
2023-05-16 13:48   ` [bug#63527] [PATCH v2 3/3] DRAFT system: hurd: Boot with pci.arbiter and rumpdisk Janneke Nieuwenhuizen
2023-05-18  8:45 ` [bug#63527] [PATCH v3 0/7] Rumpdisk support for the Hurd Janneke Nieuwenhuizen
2023-05-18  8:45   ` [bug#63527] [PATCH v3 1/7] gnu: Add libpciaccess-0.17 Janneke Nieuwenhuizen
2023-05-18  8:46   ` [bug#63527] [PATCH v3 2/7] gnu: hurd: Update libpciaccess to 0.17 Janneke Nieuwenhuizen
2023-05-18  8:46   ` [bug#63527] [PATCH v3 3/7] gnu: Add rumpkernel Janneke Nieuwenhuizen
2023-05-18  8:46   ` [bug#63527] [PATCH v3 4/7] gnu: hurd: " Janneke Nieuwenhuizen
2023-05-18  8:46   ` [bug#63527] [PATCH v3 5/7] hurd-boot: Setup pci-arbiter and rumpdisk translators Janneke Nieuwenhuizen
2023-05-18  8:46   ` [bug#63527] [PATCH v3 6/7] services: childhurd: Bump default qemu memory to 2048MB Janneke Nieuwenhuizen
2023-05-18  8:46   ` [bug#63527] [PATCH v3 7/7] system: hurd: Boot with pci.arbiter and rumpdisk Janneke Nieuwenhuizen
2023-05-18  9:14   ` [bug#63527] [PATCH v3 0/7] Rumpdisk support for the Hurd Janneke Nieuwenhuizen
2023-05-18  9:38 ` [bug#63527] [PATCH v4 0/8] Rumpdisk support for the Hurd, really! Janneke Nieuwenhuizen
2023-05-18  9:38   ` [bug#63527] [PATCH v4 1/8] gnu: glibc: Update time patches for the Hurd Janneke Nieuwenhuizen
2023-05-18 17:10     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support " Ludovic Courtès
2023-05-19  8:21       ` Janneke Nieuwenhuizen
2023-05-18  9:38   ` [bug#63527] [PATCH v4 2/8] gnu: Add libpciaccess-0.17 Janneke Nieuwenhuizen
2023-05-18  9:38   ` [bug#63527] [PATCH v4 3/8] gnu: hurd: Update libpciaccess to 0.17 Janneke Nieuwenhuizen
2023-05-18  9:38   ` [bug#63527] [PATCH v4 4/8] gnu: Add rumpkernel Janneke Nieuwenhuizen
2023-05-18 17:17     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-19  9:21       ` Janneke Nieuwenhuizen
2023-05-18  9:39   ` [bug#63527] [PATCH v4 5/8] gnu: hurd: Add rumpkernel Janneke Nieuwenhuizen
2023-05-18  9:39   ` [bug#63527] [PATCH v4 6/8] hurd-boot: Setup pci-arbiter and rumpdisk translators Janneke Nieuwenhuizen
2023-05-18  9:39   ` [bug#63527] [PATCH v4 7/8] services: childhurd: Bump default qemu memory to 2048MB Janneke Nieuwenhuizen
2023-05-18 17:20     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-19  9:30       ` Janneke Nieuwenhuizen
2023-05-18  9:39   ` [bug#63527] [PATCH v4 8/8] system: hurd: Boot with pci.arbiter and rumpdisk Janneke Nieuwenhuizen
2023-05-18 17:18     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-23 15:47 ` [bug#63527] [PATCH v5 00/11] Rumpdisk support for the Hurd, really, *really*! Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 01/11] gnu: Add libpciaccess-0.17 Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 02/11] gnu: hurd: Update libpciaccess to 0.17 Janneke Nieuwenhuizen
2023-05-24  9:11     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-24  9:28       ` Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 03/11] gnu: Add rumpkernel Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 04/11] gnu: Add hurd-shouldbeinlibc Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 05/11] gnu: parted: Support building for the Hurd Janneke Nieuwenhuizen
2023-05-24  9:13     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support " Ludovic Courtès
2023-05-24  9:24       ` Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 06/11] gnu: hurd: Add rumpkernel Janneke Nieuwenhuizen
2023-05-23 16:01     ` Janneke Nieuwenhuizen
     [not found]       ` <cover.1684858715.git.janneke@gnu.org>
2023-05-23 16:20         ` [bug#63527] [PATCH v6 " Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 07/11] hurd-boot: Setup pci-arbiter and rumpdisk translators Janneke Nieuwenhuizen
2023-05-23 21:00     ` Janneke Nieuwenhuizen
2023-05-24  9:16     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-24  9:30       ` Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 08/11] services: childhurd: Bump default qemu memory to 2048MB Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 09/11] system: hurd: Boot with pci.arbiter and rumpdisk Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 10/11] bootloader: grub: Use rumpdisk-style root when booting with "noide" Janneke Nieuwenhuizen
2023-05-24  9:32     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-24  9:37       ` Janneke Nieuwenhuizen
2023-05-23 15:47   ` [bug#63527] [PATCH v5 11/11] gnu: gnumach: Support "noide" argument Janneke Nieuwenhuizen
2023-05-24  9:36     ` [bug#63527] [PATCH 0/3] Initial attempt at rumpdisk support for the Hurd Ludovic Courtès
2023-05-24  9:40       ` Janneke Nieuwenhuizen
2023-05-24  9:08   ` Ludovic Courtès
2023-05-24  9:15     ` Janneke Nieuwenhuizen
2023-05-24  9:37   ` Ludovic Courtès
2023-05-24  9:46     ` Janneke Nieuwenhuizen
2023-07-13 17:13       ` Josselin Poiret via Guix-patches via
2023-07-13 17:41         ` Janneke Nieuwenhuizen
2023-07-14 13:37           ` Ludovic Courtès
2023-07-14 18:59             ` Josselin Poiret via Guix-patches via
2023-07-14 23:35               ` Janneke Nieuwenhuizen

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=3c1235a19285d40174f0aadb1ac5fdead22f2961.1684177770.git.janneke@gnu.org \
    --to=janneke@gnu.org \
    --cc=63527@debbugs.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.