Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rminnich authored Sep 16, 2024
2 parents 03cdb31 + b3968fa commit a7025cb
Show file tree
Hide file tree
Showing 21 changed files with 185 additions and 422 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- run:
name: Install ineffassign
command: |
go get -u github.com/gordonklaus/ineffassign
go install github.com/gordonklaus/ineffassign@latest
ineffassign ./...
- run:
name: Check dependencies
Expand Down
32 changes: 17 additions & 15 deletions cmds/fmap/fmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
// Fmap parses flash maps.
//
// Synopsis:
// fmap checksum [md5|sha1|sha256] FILE
// fmap extract [index|name] FILE
// fmap jget JSONFILE FILE
// fmap jput JSONFILE FILE
// fmap summary FILE
// fmap usage FILE
// fmap verify FILE
//
// fmap checksum [md5|sha1|sha256] FILE
// fmap extract [index|name] FILE
// fmap jget JSONFILE FILE
// fmap jput JSONFILE FILE
// fmap summary FILE
// fmap usage FILE
// fmap verify FILE
//
// Description:
// checksum: Print a checksum using the given hash function.
// extract: Print the i-th area or area name from the flash.
// jget: Write json representation of the fmap to JSONFILE.
// jput: Replace current fmap with json representation in JSONFILE.
// summary: Print a human readable summary.
// usage: Print human readable usage stats.
// verify: Return 1 if the flash map is invalid.
//
// This implementation is based off of https://github.com/dhendrix/flashmap.
// checksum: Print a checksum using the given hash function.
// extract: Print the i-th area or area name from the flash.
// jget: Write json representation of the fmap to JSONFILE.
// jput: Replace current fmap with json representation in JSONFILE.
// summary: Print a human readable summary.
// usage: Print human readable usage stats.
// verify: Return 1 if the flash map is invalid.
//
// This implementation is based off of https://github.com/dhendrix/flashmap.
package main

import (
Expand Down
12 changes: 7 additions & 5 deletions cmds/glzma/glzma.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
// glzma compresses and decompresses in the same manner as EDK2's LzmaCompress.
//
// Synopsis:
// glzma -o OUTPUT_FILE (-d|-e) [-f86] INPUT_FILE
//
// glzma -o OUTPUT_FILE (-d|-e) [-f86] INPUT_FILE
//
// Options:
// -d: decode
// -e: encode
// -f86: Use the x86 branch/call/jump filter. See `man xz` for more information.
// -o OUTPUT_FILE: output file
//
// -d: decode
// -e: encode
// -f86: Use the x86 branch/call/jump filter. See `man xz` for more information.
// -o OUTPUT_FILE: output file
package main

import (
Expand Down
21 changes: 12 additions & 9 deletions cmds/guid2english/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
// guid2english replace GUIDs with their English representation.
//
// Synopsis:
// guid2english [-t TEMPLATE] [FILE]
//
// guid2english [-t TEMPLATE] [FILE]
//
// Options:
// -t TEMPLATE:
// A template used to replace GUIDS. The template can refer to the
// following variables:
// * {{.Guid}}: The GUID being mapped
// * {{.Name}}: The English name of the GUID or "UNKNOWN"
// * {{.IsKnown}}: Set to true when the English name is not known
// The default template is "{{.GUID}} ({{.Name}})".
//
// -t TEMPLATE:
// A template used to replace GUIDS. The template can refer to the
// following variables:
// * {{.Guid}}: The GUID being mapped
// * {{.Name}}: The English name of the GUID or "UNKNOWN"
// * {{.IsKnown}}: Set to true when the English name is not known
// The default template is "{{.GUID}} ({{.Name}})".
//
// Description:
// If FILE is not specified, stdin is used.
//
// If FILE is not specified, stdin is used.
package main

import (
Expand Down
77 changes: 40 additions & 37 deletions cmds/utk/utk.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,55 @@
// The utk command performs operations on a UEFI firmware image.
//
// Synopsis:
// utk BIOS OPERATIONS...
//
// utk BIOS OPERATIONS...
//
// Examples:
// # Dump everything to JSON:
// utk winterfell.rom json
//
// # Dump a single file to JSON (using regex):
// utk winterfell.rom find Shell
// # Dump everything to JSON:
// utk winterfell.rom json
//
// # Dump a single file to JSON (using regex):
// utk winterfell.rom find Shell
//
// # Dump GUIDs and sizes to a compact table:
// utk winterfell.rom table
// # Dump GUIDs and sizes to a compact table:
// utk winterfell.rom table
//
// # Extract everything into a directory:
// utk winterfell.rom extract winterfell/
// # Extract everything into a directory:
// utk winterfell.rom extract winterfell/
//
// # Re-assemble the directory into an image:
// utk winterfell/ save winterfell2.rom
// # Re-assemble the directory into an image:
// utk winterfell/ save winterfell2.rom
//
// # Remove two files by their GUID and replace shell with Linux:
// utk winterfell.rom \
// remove 12345678-9abc-def0-1234-567890abcdef \
// remove 23830293-3029-3823-0922-328328330939 \
// replace_pe32 Shell linux.efi \
// save winterfell2.rom
// # Remove two files by their GUID and replace shell with Linux:
// utk winterfell.rom \
// remove 12345678-9abc-def0-1234-567890abcdef \
// remove 23830293-3029-3823-0922-328328330939 \
// replace_pe32 Shell linux.efi \
// save winterfell2.rom
//
// Operations:
// `json`: Dump the entire parsed image (excluding binary data) as JSON to
// stdout.
// `table`: Dump GUIDs and sizes to a compact table. This is only for human
// consumption and the format may change without notice.
// `find (GUID|NAME)`: Dump the JSON of one or more files. The file is
// found by a regex match to its GUID or name in the UI
// section.
// `remove (GUID|NAME)`: Remove the first file which matches the given GUID
// or NAME. The same matching rules and exit status
// are used as `find`.
// `replace (GUID|NAME) FILE`: Replace the first file which matches the
// given GUID or NAME with the contents of
// FILE. The same matching rules and exit
// status are used as `find`.
// `save FILE`: Save the current state of the image to the give file.
// Remember that operations are applied left-to-right, so only
// the operations to the left are included in the new image.
// `extract DIR`: Extract the BIOS to the given directory. Remember that
// operations are applied left-to-right, so only the
// operations to the left are included in the new image.
//
// `json`: Dump the entire parsed image (excluding binary data) as JSON to
// stdout.
// `table`: Dump GUIDs and sizes to a compact table. This is only for human
// consumption and the format may change without notice.
// `find (GUID|NAME)`: Dump the JSON of one or more files. The file is
// found by a regex match to its GUID or name in the UI
// section.
// `remove (GUID|NAME)`: Remove the first file which matches the given GUID
// or NAME. The same matching rules and exit status
// are used as `find`.
// `replace (GUID|NAME) FILE`: Replace the first file which matches the
// given GUID or NAME with the contents of
// FILE. The same matching rules and exit
// status are used as `find`.
// `save FILE`: Save the current state of the image to the give file.
// Remember that operations are applied left-to-right, so only
// the operations to the left are included in the new image.
// `extract DIR`: Extract the BIOS to the given directory. Remember that
// operations are applied left-to-right, so only the
// operations to the left are included in the new image.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/linuxboot/fiano

go 1.17
go 1.21

require (
github.com/dustin/go-humanize v1.0.0
Expand Down
Loading

0 comments on commit a7025cb

Please sign in to comment.