diff --git a/devenv.lock b/devenv.lock index 5a6df73..49b8446 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,10 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1685521914, - "narHash": "sha256-0fdFP5IASLwJ0PSXrErW8PZon9TVYmi8VRF8OtjGkV4=", + "lastModified": 1764115645, "owner": "cachix", "repo": "devenv", - "rev": "e206d8f2e3e8d6aa943656052f15bdfea8146b8d", + "rev": "9f75ca2f931ab24b92d1733bd1a4f0d441d68591", "type": "github" }, "original": { @@ -20,11 +19,10 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1761588595, "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", "type": "github" }, "original": { @@ -33,34 +31,39 @@ "type": "github" } }, - "flake-utils": { + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "lastModified": 1763988335, + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, "gitignore": { "inputs": { "nixpkgs": [ - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1762808025, "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "cb5e3fdca1de58ccbc3ef53de65bd372b48f567c", "type": "github" }, "original": { @@ -71,11 +74,10 @@ }, "nixpkgs": { "locked": { - "lastModified": 1685399834, - "narHash": "sha256-Lt7//5snriXSdJo5hlVcDkpERL1piiih0UXIz1RUcC4=", + "lastModified": 1763934636, "owner": "NixOS", "repo": "nixpkgs", - "rev": "58c85835512b0db938600b6fe13cc3e3dc4b364e", + "rev": "ee09932cedcef15aaf476f9343d1dea2cb77e261", "type": "github" }, "original": { @@ -85,51 +87,14 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1678872516, - "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1685361114, - "narHash": "sha256-4RjrlSb+OO+e1nzTExKW58o3WRwVGpXwj97iCta8aj4=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "ca2fdbf3edda2a38140184da6381d49f8206eaf4", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "devenv": "devenv", + "git-hooks": "git-hooks", "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" + "pre-commit-hooks": [ + "git-hooks" + ] } } }, diff --git a/devenv.nix b/devenv.nix index f18e646..f7cf0e0 100644 --- a/devenv.nix +++ b/devenv.nix @@ -5,7 +5,7 @@ with pkgs; packages = [ coreboot-utils uefitool - lzma + xz stdenv.cc.cc.lib glib ]; diff --git a/openness_score/coreboot.py b/openness_score/coreboot.py index a25d9a6..d61733d 100644 --- a/openness_score/coreboot.py +++ b/openness_score/coreboot.py @@ -1299,7 +1299,7 @@ def _check_for_lanrom(self): subprocess.run(cmd, text=True, capture_output=True) lan_rom_file = '/tmp/lan_rom_' + self.region_name + '/body_1.bin' - cmd = ['UEFIExtract', '/tmp/payload_' + self.region_name, + cmd = ['uefiextract', '/tmp/payload_' + self.region_name, self.DASHARO_LAN_ROM_GUID, '-o', '/tmp/lan_rom_' + self.region_name, '-m', 'body'] diff --git a/openness_score/openness_score.py b/openness_score/openness_score.py index dd97293..8923564 100755 --- a/openness_score/openness_score.py +++ b/openness_score/openness_score.py @@ -76,7 +76,7 @@ def check_file(file): sys.exit('ERROR: cbfstool not found, please install it first.') try: - subprocess.run(['UEFIExtract'], + subprocess.run(['uefiextract'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) except FileNotFoundError: @@ -93,7 +93,7 @@ def check_file(file): text=True, capture_output=True) fw_is_cbfs = cbfs_error_string not in cbfstool_check.stderr - uefiextract_check = subprocess.run(['UEFIExtract', file, 'report'], + uefiextract_check = subprocess.run(['uefiextract', file, 'report'], text=True, capture_output=True) fw_is_uefi = uefiextract_error_string not in uefiextract_check.stdout diff --git a/openness_score/uefi.py b/openness_score/uefi.py index 5060324..ea00e28 100644 --- a/openness_score/uefi.py +++ b/openness_score/uefi.py @@ -183,11 +183,11 @@ def _parse_uefi_image(self): If self.debug is True, all UEFI entries and regions with their attributes are printed on the console at the end. """ - cmd = ['UEFIExtract', self.image_path, 'report'] + cmd = ['uefiextract', self.image_path, 'report'] uefi_extract = subprocess.run(cmd, text=True, capture_output=True) if uefi_extract.returncode != 0: - sys.exit('ERROR: UEFIExtarct returned an error') + sys.exit('ERROR: UEFIExtract returned an error') file = open(''.join([self.image_path, '.report.txt']), mode='r') uefi_report = file.read()