From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqjOQ-0000Ym-DX for guix-patches@gnu.org; Sat, 09 Sep 2017 13:18:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqjON-0007KQ-9I for guix-patches@gnu.org; Sat, 09 Sep 2017 13:18:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqjON-0007KE-0D for guix-patches@gnu.org; Sat, 09 Sep 2017 13:18:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dqjOM-0002P9-JH for guix-patches@gnu.org; Sat, 09 Sep 2017 13:18:02 -0400 Subject: [bug#28281] [PATCH] gnu: Add os-prober. References: In-Reply-To: Resent-Message-ID: Message-Id: <3627911f.AEEAQGfVIqcAAAAAAAAAAAPmNSgAAAACwQwAAAAAAAW9WABZtCIK@mailjet.com> From: Arun Isaac Date: Sat, 9 Sep 2017 22:46:35 +0530 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28281@debbugs.gnu.org * gnu/packages/bootloaders.scm (os-prober): New variable. --- gnu/packages/bootloaders.scm | 69 ++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 69 insertions(+) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index f66d0bb3f..613537a5d 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -395,3 +395,72 @@ also initializes the boards (RAM etc).") =20 (define-public u-boot-odroid-c2 (make-u-boot-package "odroid-c2" "aarch64-linux-gnu")) + +(define-public os-prober + (package + (name "os-prober") + (version "1.76") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://debian/pool/main/o/os-prober/os-probe= r_" + version ".tar.xz")) + (sha256 + (base32 + "1vb45i76bqivlghrq7m3n07qfmmq4wxrkplqx8gywj011rhq19fk")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (ice-9 regex) ; for string-match + (srfi srfi-26)) ; for cut + #:make-flags (list "CC=3Dgcc") + #:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (find-files ".") + (("/usr") (assoc-ref outputs "out"))) + (substitute* (find-files "." "50mounted-tests$") + (("mkdir") "mkdir -p")) + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (define (find-files-non-recursive directory) + (find-files directory + (lambda (file stat) + (string-match (string-append "^" directory "/= [^/]*$") + file)) + #:directories? #t)) + + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (share (string-append out "/share"))) + (for-each (cut install-file <> bin) + (list "linux-boot-prober" "os-prober")) + (install-file "newns" (string-append lib "/os-prober")) + (install-file "common.sh" (string-append share "/os-prober"= )) + (install-file "os-probes/mounted/powerpc/20macosx" + (string-append lib "/os-probes/mounted")) + (for-each + (lambda (directory) + (for-each + (lambda (file) + (let ((destination (string-append lib "/" directory + "/" (basename file)= ))) + (mkdir-p (dirname destination)) + (copy-recursively file destination))) + (append (find-files-non-recursive (string-append direct= ory "/common")) + (find-files-non-recursive (string-append direct= ory "/x86"))))) + (list "os-probes" "os-probes/mounted" "os-probes/init" + "linux-boot-probes" "linux-boot-probes/mounted")) + #t)))))) + (home-page "https://joeyh.name/code/os-prober") + (synopsis "Detect other operating systems") + (description "os-prober probes disks on the system for other operating +systems so that they can be added to the bootloader. It also works out ho= w to +boot existing GNU/Linux systems and detects what distribution is installed= in +order to add a suitable bootloader menu entry.") + (license license:gpl2+))) --=20 2.14.1 =