[PATCH] gnu: Add efi_analyzer.

  • Done
  • quality assurance status badge
Details
2 participants
  • Tobias Geerinckx-Rice
  • Vincent Legoll
Owner
unassigned
Submitted by
Vincent Legoll
Severity
normal

Debbugs page

Vincent Legoll wrote 4 years ago
(address . guix-patches@gnu.org)(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
20210112193747.19460-1-vincent.legoll@gmail.com
* gnu/packages/engineering.scm (efi_analyzer): New variable.
---
gnu/packages/engineering.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 5166a4635c..1c001cbe0f 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -1580,6 +1580,33 @@ like relocation symbols. It is able to deal with malformed binaries, making
it suitable for security research and analysis.")
(license license:lgpl3)))
+(define-public efi_analyzer
+ (let ((commit "77c9e3a67cd7c2fca48a4292dad25a5429872f95")
+ (revision "0"))
+ (package
+ (name "efi_analyzer")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/xypron/efi_analyzer")
+ (commit commit)))
+ (sha256
+ (base32 "1izdkzybqyvzpzqz6kx4j7y47j6aa2dsdrychzgs65466x1a4br1"))
+ (file-name (string-append name "-" version "-checkout"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags (list "prefix=" (string-append "DESTDIR=" (assoc-ref %outputs "out")))))
+ (home-page "https://github.com/xypron/efi_analyzer")
+ (synopsis "Analyze EFI binary")
+ (description
+ "The EFI Analyzer can be used to check EFI binaries and to print out header
+and section information.")
+ (license license:bsd-2))))
+
(define-public asco
(package
(name "asco")
--
2.30.0
Tobias Geerinckx-Rice wrote 4 years ago
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
87im81olu7.fsf@nckx
Vincent,

Vincent Legoll 写道:
Toggle quote (2 lines)
> * gnu/packages/engineering.scm (efi_analyzer): New variable.

Neat!

Toggle quote (2 lines)
> gnu/packages/engineering.scm | 27 +++++++++++++++++++++++++++

I failed to see any connection to engineering and moved this to
efi.scm.

Don't forget to add or update your copyright line.

Toggle quote (10 lines)
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url
> "https://github.com/xypron/efi_analyzer")
> + (commit commit)))
> + (sha256
> + (base32
> "1izdkzybqyvzpzqz6kx4j7y47j6aa2dsdrychzgs65466x1a4br1"))

I added a newline after ‘source’ to give this 81-character line
some breathing room.

URLs, snippets, ... can grow wide and a few columns can save a
pointless string-append or newlines.

Toggle quote (3 lines)
> + (file-name (string-append name "-" version
> "-checkout"))))

This can be done with the

(file-name (git-file-name name version))

helper.

Toggle quote (5 lines)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (delete 'configure))

Not a comment on your patch, but I added a
‘support-cross-compilation’ phase here that replaces the
Makefile's hard-coded ‘gcc’ so you can inspect EFI binaries on
your cross-compiled ARM box.

Toggle quote (3 lines)
> + #:make-flags (list "prefix=" (string-append "DESTDIR="
> (assoc-ref %outputs "out")))))

The other way 'round: set $prefix (or the BSD variant $PREFIX) to
the destination, and never set DESTDIR unless you're working
around a bug in a broken build system.

DESTDIR is for distributions/builds using a temporary ‘staging’
destination directory. Guix doesn't.

Toggle quote (5 lines)
> + (description
> + "The EFI Analyzer can be used to check EFI binaries and to
> print out header
> +and section information.")

Slash empty ‘x can y’ (or ‘x allows the user to y’) filler with
gleeful prejudice.

Pushed with these changes as
373f808df229c12101301b766bd1810836b98481.

Thanks!

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX/4ccA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15MY8BAIC71P9T/PV5Sh66h+7dJJ3MCMPyRU4JFy8fQt/M
ULe4AP4kcAMe13YyRXRpTKXyYgyGJpVH5yQgLOZXMQ9HSRFnDQ==
=Qwas
-----END PGP SIGNATURE-----

Vincent Legoll wrote 4 years ago
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
CAEwRq=oy8ZfLFvdp-FtDUR86nkPw9ikYLMpXLJUdqAkitEvODw@mail.gmail.com
Hello,

On Tue, Jan 12, 2021 at 11:02 PM Tobias Geerinckx-Rice <me@tobias.gr> wrote:
Toggle quote (5 lines)
> > gnu/packages/engineering.scm | 27 +++++++++++++++++++++++++++
>
> I failed to see any connection to engineering and moved this to
> efi.scm.

I searched a bit (debug.scm, etc.) but failed to find
the *really* obvious one :facepalm: I chose engineering
because another rev-eng tool (radare2) was here.

Toggle quote (2 lines)
> Don't forget to add or update your copyright line.

I almost always forgot to do that.

Toggle quote (13 lines)
> > + (source (origin
> > + (method git-fetch)
> > + (uri (git-reference
> > + (url
> > "https://github.com/xypron/efi_analyzer")
> > + (commit commit)))
> > + (sha256
> > + (base32
> > "1izdkzybqyvzpzqz6kx4j7y47j6aa2dsdrychzgs65466x1a4br1"))
>
> I added a newline after ‘source’ to give this 81-character line
> some breathing room.

This one I swear I ran the etc/indent.el script on, was it in
my brain only ?

Toggle quote (9 lines)
> > + (file-name (string-append name "-" version
> > "-checkout"))))
>
> This can be done with the
>
> (file-name (git-file-name name version))
>
> helper.

Argh, another forgetting, you probably taught me that
a few times already.

Toggle quote (10 lines)
> > + (arguments
> > + `(#:phases
> > + (modify-phases %standard-phases
> > + (delete 'configure))
>
> Not a comment on your patch, but I added a
> ‘support-cross-compilation’ phase here that replaces the
> Makefile's hard-coded ‘gcc’ so you can inspect EFI binaries on
> your cross-compiled ARM box.

I saw that, nice !

Toggle quote (10 lines)
> > + #:make-flags (list "prefix=" (string-append "DESTDIR="
> > (assoc-ref %outputs "out")))))
>
> The other way 'round: set $prefix (or the BSD variant $PREFIX) to
> the destination, and never set DESTDIR unless you're working
> around a bug in a broken build system.
>
> DESTDIR is for distributions/builds using a temporary ‘staging’
> destination directory. Guix doesn't.

OK, I hesitated between the 2 options, and failed to choose the
right one :-))

Toggle quote (8 lines)
> > + (description
> > + "The EFI Analyzer can be used to check EFI binaries and to
> > print out header
> > +and section information.")
>
> Slash empty ‘x can y’ (or ‘x allows the user to y’) filler with
> gleeful prejudice.

Just a copy-paste from upstream (should have proof read it, though)

Thanks a lot for your patience in bearing with my half-baked
submissions.

I think I'll owe you a beer (or two).

Tchuss

--
Vincent Legoll
?
Your comment

This issue is archived.

To comment on this conversation send an email to 45825@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 45825
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help