Add heimdall

  • Done
  • quality assurance status badge
Details
5 participants
  • Danny Milosavljevic
  • Jonathan Brielmaier
  • Julien Lepiller
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Submitted by
Julien Lepiller
Severity
normal
Merged with
J
J
Julien Lepiller wrote on 29 Aug 2017 23:58
(address . guix-patches@gnu.org)
20170829235829.7a4f55cd@lepiller.eu
Hi,

this patch adds heimdall, a tool I just used to flash replicant on my
smartphone :)
From 415b94e8fc61fba9353094a3eceb22bb2a6563b6 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 29 Aug 2017 23:54:16 +0200
Subject: [PATCH] gnu: Add heimdall.

* gnu/packages/android.scm (heimdall): New variable.
---
gnu/packages/android.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index be3f50add..93c3281dd 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -23,12 +23,16 @@
(define-module (gnu packages android)
#:use-module (guix packages)
#:use-module (guix git-download)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
+ #:use-module (gnu packages compression)
#:use-module (gnu packages gnupg)
+ #:use-module (gnu packages libusb)
#:use-module (gnu packages python)
+ #:use-module (gnu packages qt)
#:use-module (gnu packages ssh)
#:use-module (gnu packages version-control)
#:use-module (gnu packages tls))
@@ -399,3 +403,39 @@ parts of the development workflow. Repo is not meant to replace Git, only to
make it easier to work with Git. The repo command is an executable Python
script that you can put anywhere in your path.")
(license license:asl2.0)))
+
+(define-public heimdall
+ (package
+ (name "heimdall")
+ (version "1.4.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/Benjamin-Dobell/Heimdall"
+ "/archive/v" version ".tar.gz"))
+ (sha256
+ (base32
+ "1y7gwg3lipyp2zcysm2vid1qg5nwin9bxbvgzs28lz2rya4fz6sq"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+ (mkdir-p bin)
+ (copy-file "bin/heimdall" (string-append bin "/heimdall"))
+ (copy-file "bin/heimdall-frontend"
+ (string-append bin "/heimdall-frontend"))))))))
+ (inputs
+ `(("libusb" ,libusb)
+ ("qt" ,qt)
+ ("zlib" ,zlib)))
+ (home-page "http://glassechidna.com.au/heimdall/")
+ (synopsis "Flash firmware onto Samsung mobile devices")
+ (description "Heimdall is a tool suite used to flash firmware (aka ROMs)
+onto Samsung mobile devices. Heimdall connects to a mobile device over USB and
+interacts with low-level software running on the device, known as Loke. Loke
+and Heimdall communicate via the custom Samsung-developed protocol typically
+referred to as the 'Odin 3 protocol'.")
+ (license license:expat)))
--
2.14.1
J
J
Jonathan Brielmaier wrote on 30 Aug 2017 10:13
(address . guix-patches@gnu.org)
b50cb92d-1a99-0f5d-41de-6b67acec2055@web.de
Maybe we could do it in "flashing-tools.scm".

Am 29.08.2017 um 23:58 schrieb Julien Lepiller:
Toggle quote (5 lines)
> Hi,
>
> this patch adds heimdall, a tool I just used to flash replicant on my
> smartphone :)
>
M
M
Marius Bakke wrote on 30 Aug 2017 21:25
87d17cluww.fsf@fastmail.com
Julien Lepiller <julien@lepiller.eu> writes:

Toggle quote (5 lines)
> Hi,
>
> this patch adds heimdall, a tool I just used to flash replicant on my
> smartphone :)

Cool!

Toggle quote (2 lines)
> * gnu/packages/android.scm (heimdall): New variable.

I agree with Jonathan that 'flashing-tools.scm' is better suited.

[...]

Toggle quote (8 lines)
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
> + (mkdir-p bin)
> + (copy-file "bin/heimdall" (string-append bin "/heimdall"))
> + (copy-file "bin/heimdall-frontend"
> + (string-append bin "/heimdall-frontend"))))))))

(copy-file ...) has an unspecified return value[0], so please add a #t
at the end of this phase for determinism.

Toggle quote (4 lines)
> + (inputs
> + `(("libusb" ,libusb)
> + ("qt" ,qt)

Can you try to use the modular qt packages here (qtbase and friends),
instead of the 'qt' monolith? The latter is not well maintained and
will be removed eventually.

Toggle quote (9 lines)
> + ("zlib" ,zlib)))
> + (home-page "http://glassechidna.com.au/heimdall/")
> + (synopsis "Flash firmware onto Samsung mobile devices")
> + (description "Heimdall is a tool suite used to flash firmware (aka ROMs)
> +onto Samsung mobile devices. Heimdall connects to a mobile device over USB and
> +interacts with low-level software running on the device, known as Loke. Loke
> +and Heimdall communicate via the custom Samsung-developed protocol typically
> +referred to as the 'Odin 3 protocol'.")

`guix lint` should complain about the single quotes, no? Escaped double
quotes are okay, though.

LGTM with these cosmetic changes.

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlmnET8ACgkQoqBt8qM6
VPqQkQgAt5Rmtyc8ZpcSJZUIpUuZ3EMyd5D6vkLNd/ke88UD+Tt0Krt4SwUxhDTu
22KTVzwdBEs0HlJw30FOGdY1m42G79ee658GTYqk4R5GAaNPOJjB/bJ9YXp3Q0VA
b0IZdRq/AmKCyl1JKeVRmnrasnRHI6LiCsY3686I4boW8Yu4JHi3xl6NzjSPOe92
WuFBjR6o/BVJIk/m/u5cRoYgfRThqKxHQ9fbz/FqtIrkEUxDTSX4+GUnbB+rQ4mn
lilOoGtA20usMJq/jOZMaZRY0rJAqOn2u01wUEt8/tY6PtOiC1730Em/OssCuavO
em+chLiGc/QgYFVJr7Q/dul5WhyrZQ==
=5ebQ
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 3 Sep 2017 18:53
(address . 28285@debbugs.gnu.org)
20170903185259.4c056094@lepiller.eu
Le Wed, 30 Aug 2017 21:25:51 +0200,
Marius Bakke <mbakke@fastmail.com> a écrit :

Toggle quote (14 lines)
> Julien Lepiller <julien@lepiller.eu> writes:
>
> > Hi,
> >
> > this patch adds heimdall, a tool I just used to flash replicant on
> > my smartphone :)
>
> Cool!
>
> > * gnu/packages/android.scm (heimdall): New variable.
>
> I agree with Jonathan that 'flashing-tools.scm' is better suited.
>
> [...]
Ok.

Toggle quote (14 lines)
>
> > + (replace 'install
> > + (lambda* (#:key outputs #:allow-other-keys)
> > + (let ((bin (string-append (assoc-ref outputs "out")
> > "/bin")))
> > + (mkdir-p bin)
> > + (copy-file "bin/heimdall" (string-append bin
> > "/heimdall"))
> > + (copy-file "bin/heimdall-frontend"
> > + (string-append bin
> > "/heimdall-frontend"))))))))
>
> (copy-file ...) has an unspecified return value[0], so please add a #t
> at the end of this phase for determinism.
Done.

Toggle quote (8 lines)
>
> > + (inputs
> > + `(("libusb" ,libusb)
> > + ("qt" ,qt)
>
> Can you try to use the modular qt packages here (qtbase and friends),
> instead of the 'qt' monolith? The latter is not well maintained and
> will be removed eventually.
only qtbase is needed it seems. Done.

Toggle quote (13 lines)
>
> > + ("zlib" ,zlib)))
> > + (home-page "http://glassechidna.com.au/heimdall/")
> > + (synopsis "Flash firmware onto Samsung mobile devices")
> > + (description "Heimdall is a tool suite used to flash firmware
> > (aka ROMs) +onto Samsung mobile devices. Heimdall connects to a
> > mobile device over USB and +interacts with low-level software
> > running on the device, known as Loke. Loke +and Heimdall
> > communicate via the custom Samsung-developed protocol typically
> > +referred to as the 'Odin 3 protocol'.")
>
> `guix lint` should complain about the single quotes, no? Escaped
> double quotes are okay, though.
It doesn't. I'm not sure what you mean with escaped double quotes. \"
or \\\"?

Toggle quote (2 lines)
>
> LGTM with these cosmetic changes.
I had to change the import of licenses and license field of all
packages because heimdall depends on zlib, which is also a license
name. Should I mention that in the commit message too? Should it be in
a separate commit?

Toggle quote (2 lines)
>
> [0] https://www.gnu.org/software/guile/manual/guile.html#File-System
L
L
Ludovic Courtès wrote on 4 Sep 2017 16:22
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 28285@debbugs.gnu.org)
87wp5ezgow.fsf@gnu.org
Hello,

Julien Lepiller <julien@lepiller.eu> skribis:

Toggle quote (5 lines)
> I had to change the import of licenses and license field of all
> packages because heimdall depends on zlib, which is also a license
> name. Should I mention that in the commit message too? Should it be in
> a separate commit?

IMO it’s marginely better as a separate commit, but no big deal.

Toggle quote (7 lines)
> From 77a0831ce91b61eca537d197e9c15720b3b6cf7e Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Tue, 29 Aug 2017 23:54:16 +0200
> Subject: [PATCH] gnu: Add heimdall.
>
> * gnu/packages/flashing-tools.scm (heimdall): New variable.

[...]

Toggle quote (8 lines)
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
> + (mkdir-p bin)
> + (copy-file "bin/heimdall" (string-append bin "/heimdall"))
> + (copy-file "bin/heimdall-frontend"
> + (string-append bin "/heimdall-frontend"))

You can write these as:

(install-file "bin/heimdall" bin)

and also remove (mkdir-p bin).

OK with these changes!

Ludo’.
L
L
Ludovic Courtès wrote on 7 Sep 2017 10:06
control message for bug #28378
(address . control@debbugs.gnu.org)
87r2vjylu7.fsf@gnu.org
merge 28378 28285
D
D
Danny Milosavljevic wrote on 8 Sep 2017 14:41
Re: [bug#28285] Add heimdall
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 28285@debbugs.gnu.org)
20170908144136.5f4fbd8e@scratchpost.org
Hi Julien,

On Tue, 29 Aug 2017 23:58:29 +0200
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (3 lines)
> this patch adds heimdall, a tool I just used to flash replicant on my
> smartphone :)

There are udev rules in ./heimdall/60-heimdall.rules which we might want to install too.

And there's a libpit.a - not sure whether it makes sense to install it (whether it has public API).

Thoughts?
?