nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

Refactor flashprog

Open funkeleinhorn opened this issue 1 year ago • 9 comments

Description of changes

Flashprog is a fork of flashrom. It would be nice for users to be able to choose which of them they would like to use. Also flashprog has some features flashrom does not have (yet) like support for multiple SPI chip selects.

based on pkgs/tools/misc/flashrom/default.nix can also be used with the nixos option

programs.flashrom = {
  enable = true;
  package = pkgs.flashprog;
};

Things done

  • Built on platform(s)
    • [X] x86_64-linux
    • [ ] aarch64-linux
    • [X] x86_64-darwin
    • [ ] aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • [X] sandbox = relaxed
    • [X] sandbox = true
  • [ ] Tested, as applicable:
  • [ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • [X] Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • [ ] (Package updates) Added a release notes entry if the change is major or breaking
    • [ ] (Module updates) Added a release notes entry if the change is significant
    • [ ] (Module addition) Added a release notes entry if adding a new NixOS module
  • [X] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

funkeleinhorn avatar Feb 27 '24 18:02 funkeleinhorn

With the force-push things seem to have broken with some now missing dependencies. Somehow managed to build the code before the force-push. Will review again once that's fixed

hcsch avatar Feb 27 '24 19:02 hcsch

Could this package be backported once its added?

funkeleinhorn avatar Feb 28 '24 01:02 funkeleinhorn

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1483

nixos-discourse avatar Feb 28 '24 12:02 nixos-discourse

Could this package be backported once its added?

Yes. Let's set the backport Github flag.

AndersonTorres avatar Feb 28 '24 22:02 AndersonTorres

I added the suggested changes. Please check if everything is okay now.

funkeleinhorn avatar Feb 29 '24 01:02 funkeleinhorn

Build was failing now as libgpiod is not available on darwin. Added check stdenv.isLinux to fix that.

funkeleinhorn avatar Feb 29 '24 01:02 funkeleinhorn

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1493

nixos-discourse avatar Mar 02 '24 23:03 nixos-discourse

As someone else opened a pull request to add flashprog (https://github.com/NixOS/nixpkgs/pull/292592) while this one was already open which got merged earlier I rebased my changes on the current master and added the improvments of this pull request like configurable support for jlink and gpio to the now existing package.

funkeleinhorn avatar Mar 03 '24 13:03 funkeleinhorn

I applied your suggested changes. Hopefully the changelog looks a bit cleaner now. Please have a look if everything is fine now :)

funkeleinhorn avatar Mar 03 '24 18:03 funkeleinhorn

Added the suggested changes. Please have a look if everything is fine now.

funkeleinhorn avatar Mar 07 '24 12:03 funkeleinhorn

Could someone restart the failed job as it seems to be an problem with ofborg instead of my package.

funkeleinhorn avatar Mar 12 '24 01:03 funkeleinhorn

@ofborg build flashprog

AndersonTorres avatar Mar 13 '24 22:03 AndersonTorres

Could someone restart the failed job as it seems to be an problem with ofborg instead of my package.

You can trick ofborg by rebasing with master and force-pushing.

AndersonTorres avatar Mar 13 '24 22:03 AndersonTorres

P.S.: fixup meta.license

AndersonTorres avatar Mar 13 '24 22:03 AndersonTorres

P.S.: fixup meta.license

what should be fixed? the current license was requested by @felixsinger and I think it is correct:

flashprog is mainly GPLv2 licensed. So change it back to what it was before.

funkeleinhorn avatar Mar 16 '24 22:03 funkeleinhorn

"GPL2" is ambiguous, it can refer to GPL2-Only or GPL2-Plus. Then it makes few to no sense to make a list containing the ambiguous GPL2 and the inambiguous GPL2Plus.

https://www.gnu.org/licenses/identify-licenses-clearly.html.en

Either the gpl2 should be removed or it should be changed to gpl2Only.

But I will not pursue this minor issue now.

AndersonTorres avatar Mar 17 '24 01:03 AndersonTorres

Clarified license in #298706. Let's try to fix the Ofborg issues and then let's get this in.

felixsinger avatar Mar 24 '24 18:03 felixsinger

I rebased on current master and changed the license to gpl2Plus as flashprog is licensed with gpl2Plus. From flashprogs COPYING:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

funkeleinhorn avatar Mar 24 '24 19:03 funkeleinhorn

Ofborg was failing because it was using an outdated nix version. Lets see if the rebase to the current master fixed it or if further action is required.

funkeleinhorn avatar Mar 24 '24 19:03 funkeleinhorn

OfBorg complains on ARM64-Linux:

The following features are unavailable on your machine: CONFIG_INTERNAL_X86=yes CONFIG_INTERNAL_X86=yes CONFIG_RAYER_SPI=yes

AndersonTorres avatar Mar 24 '24 20:03 AndersonTorres

Fingers crossing that it passes the CI now! :crossed_fingers:

felixsinger avatar Mar 24 '24 23:03 felixsinger

Yo, all checks green! Let's get this in! 🥳

I just can't merge...

felixsinger avatar Mar 25 '24 09:03 felixsinger

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1551

nixos-discourse avatar Mar 25 '24 14:03 nixos-discourse

Backport failed for release-23.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-23.11
git worktree add -d .worktree/backport-291897-to-release-23.11 origin/release-23.11
cd .worktree/backport-291897-to-release-23.11
git switch --create backport-291897-to-release-23.11
git cherry-pick -x 5ba311a026ad3e6f3ad210e82428d222fdb4eca8 306fe56f63d8b14e7e50a5abc4a527032f2538b2

github-actions[bot] avatar Mar 27 '24 13:03 github-actions[bot]