Open blekinge opened 4 years ago
I found you can work around this by choosing a different value for "HDD/SSD temperature utility" that isn't "nvme-cli", then removing and reinstalling Freon.
[FREON] Unable to find nvme devices: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
dansleboby@pop-os:~$ nvme list -o json Failed to open /dev/nvme0n1: Permission denied
root@pop-os:~# nvme list -o json
{
"Devices" : [
{
"NameSpace" : 1,
"DevicePath" : "/dev/nvme0n1",
"Firmware" : "15301229",
"Index" : 0,
"ModelNumber" : "PM981a NVMe SAMSUNG 2048GB",
"ProductName" : "Unknown device",
"SerialNumber" : " S4UFNF0N508905",
"UsedBytes" : 90264449024,
"MaximumLBA" : 4000797360,
"PhysicalSize" : 2048408248320,
"SectorSize" : 512
}
]
}
But you can always create a shell wrapper for nvme-cli which actually calls it via sudo:
$ cat ./nvme
#!/bin/bash -efu
sudo /usr/sbin/nvme $*
or use shell alias instead.
I have the same issue and don't know of an easy and clean way around it. Freon needs access to that information which is only available through the nvme
utility. I used the shell wrapper that @LAKostis mentioned above and it works perfectly.
For anyone looking to replicate that:
/usr/local/bin/nvme
, make sure to set it executable
chmod +x /usr/local/bin/nvme
visudo
and give yourself access to run it without needing a password
yourUsername ALL=(root) NOPASSWD: /usr/sbin/nvme
nvme list
Now Freon should be able to read your NVMe drive status info, once you select it in the Freon settings.
NB: if you're paranoid about the security of using sudo like this, you can lock it down further to just the command-line options that Freon will need to use. Use these two sudo rules instead of the one mentioned above:
# This assumes that your devices are at /dev/nvme*, like all the ones I've used so far
yourUsername ALL=(root) NOPASSWD: /usr/sbin/nvme list -o json
yourUsername ALL=(root) NOPASSWD: /usr/sbin/nvme smart-log /dev/nvme* -o json
So I tried all of these methods by editing the sudoers
and nvmecliUtils.js
. But still to no avail. I can definitely get the SSD temperature through TLP and stuff but not able to display it on the freon along with my HDD. Can see only HDD. Can anyone help ;(
This could be ported to use the pkexec mechanisms… once this pkexec mechanism is fixed (#274), it means someone has to write a policy file to ship and write the plumbing to make the extension asks the user to install the policy file if needed.
Freon failed to run/install for me.
The log in journalctl showed
journalctl _UID=1000 -e -l
I found the relevant code in
nvmecliUtils.js
Running the same command from the command line produced
So it will obviously try to parse "Failed to open /dev/nvme0" as JSON and die and take the entire Freon app down with it.
Now, I run with passwordless sudo (which is a mistake, but well...), so I tried to run
and changed to code to
to get nvme working and Freon working. And now it works.
But perhaps include a warning or something for anyone else trying to use nvme without being root