all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phodina via Guix-patches via <guix-patches@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 49577@debbugs.gnu.org, Sarah Morgensen <iskarian@mgsn.dev>
Subject: [bug#49577] [PATCH] Add python-pmbootstrap
Date: Mon, 06 Jun 2022 21:07:10 +0000	[thread overview]
Message-ID: <WUfW-YNF6KwD8sb_18og6t9o-GBvFQTqOqnxuKFHFlPqM1BK0MvOFQoL3roKbItbu4Xk3jZUaWqtRkKHBhN7nhdfmgbbMk6Gw7VzKQBjVTI=@protonmail.com> (raw)
In-Reply-To: <875ym4hrc7.fsf_-_@gmail.com>

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

Hi,

here's an updated version of the patch + 2 more tools around PMOS.

However, there is some issue with the sanity-check phase in pmbootstrap which I disabled as I didn't know how to fix it.

----
Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-Add-boot-deploy.patch --]
[-- Type: text/x-patch; name=0003-gnu-Add-boot-deploy.patch, Size: 2309 bytes --]

From 45fea1b10467dae4310064112b993037b7f827c3 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 10 Jan 2022 02:54:17 +0100
Subject: [PATCH 3/3] gnu: Add boot-deploy.

* gnu/packages/android.scm (boot-deploy): New variable.

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index aa9b0e0fe6..0342e30cef 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -46,6 +46,7 @@ (define-module (gnu packages android)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
@@ -1023,6 +1024,42 @@ (define-public abootimg
 safest way, on a file image.")
     (license license:gpl2+)))
 
+(define-public boot-deploy
+  (package
+    (name "boot-deploy")
+    (version "0.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/postmarketOS/boot-deploy")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0vh8gjprsyp4zwmpgasf4gyxclm3yyr32pf39bf218690m86fijq"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (delete 'build)
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (invoke "bash" "test_boot_deploy_functions.sh"))))
+               (replace 'install
+                 (lambda* _
+                   (install-file "boot-deploy"
+                                 (string-append #$output "/bin")))))))
+    (native-inputs (list bc))
+    (inputs (list bash-minimal))
+    (synopsis "Boot deploy for PostmarketOS devices")
+    (description
+     "This package provides tools to generate and deploy images for
+PostmarketOS devices.")
+    (home-page "https://gitlab.com/postmarketOS/boot-deploy")
+    (license license:gpl3+)))
+
 (define-public python-androguard
   (package
     (name "python-androguard")
-- 
2.35.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-gnu-Add-pmbootstrap.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-pmbootstrap.patch, Size: 3078 bytes --]

From 604e23fe8f2c624a70bdc26cd829dce539778323 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 18 Jul 2021 12:33:07 +0200
Subject: [PATCH 1/3] gnu: Add pmbootstrap.

* gnu/packages/python-xyz.scm (pmbootstrap): New variable.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6132019a53..8c33364c40 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1178,6 +1178,65 @@ (define-public python-shortuuid
 module and then similar looking characters are removed.")
     (license license:bsd-3)))
 
+(define-public pmbootstrap
+  (package
+    (name "pmbootstrap")
+    (version "1.44.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pmbootstrap" version))
+       (sha256
+        (base32
+         "0hzfgf085b4h2pmbgfkx25sxq9a27m1l77jx7in48vfv8lihmhzh"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f
+       #:phases
+       #~(modify-phases %standard-phases
+         (add-after 'unpack 'replace-programs
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "pmb/chroot/apk_static.py"
+               (("\"openssl\"") (string-append "\"" #$openssl
+                                               "/bin/openssl\"")))
+             (substitute* "pmb/config/__init__.py"
+               (("\"git\"") (string-append "\"" #$git
+                                           "/bin/git\""))
+               (("\"openssl\"") (string-append "\"" #$openssl
+                                               "/bin/openssl\""))
+               (("\"ps\"") (string-append "\"" #$procps
+                                          "/bin/ps\"")))))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+                                        ;(add-installed-pythonpath inputs outputs)
+             (when tests?
+               ;; To import pmb_test module
+               (setenv "PYTHONPATH"
+                       (string-append (assoc-ref %outputs "out") "/test/pmb_test:"
+                                      (getenv "PYTHONPATH")))
+               (invoke "pytest" "-vv"))))
+         ;; Circular dependency with pmbootstrap
+         (delete 'sanity-check))))
+    (native-inputs (list python-pytest))
+    (inputs (list git procps openssl))
+    (home-page "https://postmarketos.org")
+    (synopsis "Build and flash tool for postmarketOS")
+    (description
+     "Bootstrap program that abstracts everything in chroots and therefore
+basically runs on top of any Linux distribution.  Features:
+@enumerate
+@item chroot setup (distro-independent QEMU user emulation
+@item clean chroot shutdown (umount) and zapping
+@item build software as packages
+@item cross-compile all armhf-packages
+@item effective caching out of the box (survives chroot zaps)
+@item installation targets
+@item flasher abstractions
+@item logging
+@item security
+@end enumerate")
+    (license license:gpl3+)))
+
 (define-public python-logwrap
   (package
     (name "python-logwrap")
-- 
2.35.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0002-gnu-Add-pmos-installer.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-pmos-installer.patch, Size: 4795 bytes --]

From 8b1c26dfddf10200dbd72be13322fdd835d257aa Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 9 Jan 2022 19:22:51 +0100
Subject: [PATCH 2/3] gnu: Add pmos-installer.

* gnu/packages/android.scm (pmos-installer): New variable.

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 04dc4b6499..aa9b0e0fe6 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -11,7 +11,7 @@
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Sergey Trofimov <sarg@sarg.org.ru>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
-;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,16 +32,25 @@ (define-module (gnu packages android)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix gexp)
+  #:use-module (guix utils)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
   #:use-module (guix git-download)
   #:use-module (guix build-system android-ndk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system trivial)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cpio)
   #:use-module (gnu packages docker)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gnupg)
@@ -1268,3 +1277,64 @@ (define-public enjarify
 applications.  Enjarify can translate the Dalvik bytecode back to equivalent
 Java bytecode, which simplifies the analysis of Android applications.")
     (license license:asl2.0)))
+
+(define-public pmos-installer
+  (package
+    (name "pmos-installer")
+    (version "1.0.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/sdm845-mainline/pmos-installer")
+                    (recursive? #t)
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0lbdk2453bywdibys35zyf1j27a1m11a7q8jvmgjf99v77l9rrbx"))))
+    (build-system copy-build-system)
+    (arguments
+     `(#:install-plan '(("makeinstaller.sh" "bin/makeinstaller.sh") ("initrd"
+                                                                     "initrd"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-shellscript
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* (string-append out "/bin/makeinstaller.sh")
+                 ;; Typo in name
+                 ;; https://gitlab.com/sdm845-mainline/pmos-installer/-/issues/5
+                 (("vmlinuz-") "vmlinuz")
+                 ;; Path to initrd
+                 (("\"\\$\\(dirname \"\\$0\"\\)\"") (string-append out)))
+               (wrap-program (string-append out "/bin/makeinstaller.sh")
+                             `("PATH" ":" prefix
+                               ,(append (map (lambda (dir)
+                                               (string-append (assoc-ref
+                                                               inputs dir)
+                                                              "/bin"))
+                                             '("coreutils" "cpio"
+                                               "grep"
+                                               "zip"
+                                               "mkbootimg"
+                                               "pmbootstrap"
+                                               "sudo"
+                                               "sed"
+                                               "util-linux"
+                                               "which")))))))))))
+    (inputs (list bash-minimal
+                  coreutils
+                  pmbootstrap
+                  grep
+                  util-linux
+                  mkbootimg
+                  cpio
+                  zip
+                  sed
+                  which
+                  sudo))
+    (home-page "https://gitlab.com/sdm845-mainline/pmos-installer")
+    (synopsis "Flashable installer for postmarketOS")
+    (description "This package provides a flashable installer for
+        postmarketOS.")
+    (license license:gpl3+)))
-- 
2.35.1


  reply	other threads:[~2022-06-06 21:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 16:31 [bug#49577] [PATCH] Add python-pmbootstrap phodina via Guix-patches via
2021-07-18 10:35 ` phodina via Guix-patches via
2021-07-22  2:18   ` Sarah Morgensen
2022-05-17 19:49     ` Maxim Cournoyer
2022-06-06 21:07       ` phodina via Guix-patches via [this message]
2022-12-15 21:51         ` phodina via Guix-patches via
2022-12-16  4:52           ` Maxim Cournoyer
2023-05-25  0:16             ` Maxim Cournoyer
2023-05-29 10:31               ` phodina via Guix-patches via
2023-06-14  2:46                 ` Maxim Cournoyer
2023-06-14  3:06                 ` jgart via Guix-patches via
2023-03-13  5:21 ` [bug#49577] jgart via Guix-patches via

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='WUfW-YNF6KwD8sb_18og6t9o-GBvFQTqOqnxuKFHFlPqM1BK0MvOFQoL3roKbItbu4Xk3jZUaWqtRkKHBhN7nhdfmgbbMk6Gw7VzKQBjVTI=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=49577@debbugs.gnu.org \
    --cc=iskarian@mgsn.dev \
    --cc=maxim.cournoyer@gmail.com \
    --cc=phodina@protonmail.com \
    /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.