Skip to content

Commit

Permalink
[DDW-197] Fixes Ledger support on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaglumac committed Nov 27, 2020
1 parent b2823c4 commit eb35f45
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Changelog
=========

## vNext
## 3.0.0-FC3

### Features

- Added hardware wallet support for "Ledger Nano S" and "Ledger Nano X" on Linux ([PR 2046](https://github.com/input-output-hk/daedalus/pull/2046))

### Fixes

Expand Down
8 changes: 7 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ in
{ target ? builtins.currentSystem
, nodeImplementation ? (getDefaultBackend cluster)
, localLib ? import ./lib.nix { inherit nodeImplementation; }
, config ? {}
, cluster ? "mainnet"
, version ? "versionNotSet"
, buildNum ? null
Expand All @@ -28,6 +27,13 @@ let
x86_64-windows = lib.systems.examples.mingwW64;
};
system = systemTable.${target} or target;
config = {
packageOverrides = super: {
systemd = super.systemd.overrideAttrs ({ patches ? [], ... }: {
patches = patches ++ [ ./nix/systemd.patch ];
});
};
};
pkgs = localLib.iohkNix.getPkgsDefault { inherit system config; };
pkgsNative = localLib.iohkNix.getPkgsDefault {};
sources = localLib.sources;
Expand Down
17 changes: 17 additions & 0 deletions nix/systemd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c
index fd5900704d..f9106fdbe5 100644
--- a/src/libsystemd/sd-device/device-monitor.c
+++ b/src/libsystemd/sd-device/device-monitor.c
@@ -445,9 +445,9 @@ int device_monitor_receive_device(sd_device_monitor *m, sd_device **ret) {
"sd-device-monitor: No sender credentials received, message ignored.");

cred = (struct ucred*) CMSG_DATA(cmsg);
- if (cred->uid != 0)
- return log_debug_errno(SYNTHETIC_ERRNO(EAGAIN),
- "sd-device-monitor: Sender uid="UID_FMT", message ignored.", cred->uid);
+ //if (cred->uid != 0)
+ // return log_debug_errno(SYNTHETIC_ERRNO(EAGAIN),
+ // "sd-device-monitor: Sender uid="UID_FMT", message ignored.", cred->uid);

if (streq(buf.raw, "libudev")) {
/* udev message needs proper version magic */
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "3.0.0-FC2",
"version": "3.0.0-FC3",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions source/renderer/app/config/hardwareWalletsConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { isMainnet, isLinux } = global.environment;
const { isMainnet } = global.environment;

export const HARDENED_HEX = 0x80000000;
export const HARDENED = 2147483648;
Expand Down Expand Up @@ -56,7 +56,7 @@ export const MINIMAL_LEDGER_FIRMWARE_VERSION = '1.6.1';
export const MINIMAL_TREZOR_FIRMWARE_VERSION = '2.3.3';

export const isTrezorEnabled = true;
export const isLedgerEnabled = !isLinux;
export const isLedgerEnabled = true;

export const isHardwareWalletSupportEnabled =
isMainnet && (isTrezorEnabled || isLedgerEnabled);
Expand Down

0 comments on commit eb35f45

Please sign in to comment.