tuya-convert icon indicating copy to clipboard operation
tuya-convert copied to clipboard

Arch Linux support for install_prereq.sh

Open C0rn3j opened this issue 3 years ago • 4 comments

I edited the script to detect OS (and fallback to debian-based install should detection fail) and added a relevant function for Arch Linux (and possibly its derivatives).

I have changed installing the pip modules as current user(root), not system-wide, as that conflicts with the system package manager.

I looked where the pip dependencies are used and it looks like they're all called from sudo screen, so installing as root user should be correct.

Tested with Ubuntu 20.10 and Arch.

EDIT: Went through with the flash on Arch successfully, but had to disable NM as it was interfering with the AP script, added note to the setup while I was at it.

C0rn3j avatar Jan 04 '21 10:01 C0rn3j

The Network Manager service is also called NetworkManager on most Red Hat based distributions as well. It would be nice if there was a check for it (ie. check if network-manager or NetworkManager is a running service) to make the script was a tad more dynamic. I have no issues writing it and submitting a PR if that is something that will be accepted.

jmiahman avatar Jan 04 '21 17:01 jmiahman

Hi @C0rn3j, thanks for your contribution! I'll switch the base branch to development which is currently staging for the next release.

Regarding NetworkManager @C0rn3j and @jmiahman, this should already be handled automatically. If this is not working then that is an issue unto itself. See the relevant code here and let me know how we can improve. I will gladly take a PR for this.

The rest looks good to me, though I'm not able to test comprehensively.

kueblc avatar Jan 26 '21 22:01 kueblc

Fixed the conflict due to rfkill being added (in util-linux on Arch), hopefully correctly.

EDIT: Looks like the NM code is missing a check for NetworkManager service (currently only does network-manager), I'll look into it after this gets merged, that is if I'm not beat by @jmiahman

C0rn3j avatar Jan 26 '21 22:01 C0rn3j

@kueblc I fixed the conflict that popped up a while ago, could you please pull this? I did test it when I originally made the commit.

Tried to test it now again but unfortunately it seems that newer version of BW-SHP6 Pro and other devices now do not ship with ESP8266 anymore...

EDIT: I've actually found out why I initially had to stop NetworkManager myself - the script was relying on the ancient service binary to exist, which it does not on systemd.

Both Arch and Ubuntu have been using systemd for ages, and systemctl is used for control elsewhere, so I assume it was a mistake and switched the rest of the commands over to systemctl.

C0rn3j avatar Aug 01 '22 10:08 C0rn3j

Can this be merged?

Sabin-Gheorghiu avatar Nov 06 '23 21:11 Sabin-Gheorghiu

Thanks for your contribution! I haven't had a chance to test but LGTM so it's now on dev branch

kueblc avatar Nov 06 '23 21:11 kueblc

Side note, the latest commit can be improved to first try stopping NetworkManager and not network-manager, as network-manager is the old name, so it'd be best to try with the new name first instead to avoid needlessly spamming logs.

Thanks for pulling it!

C0rn3j avatar Nov 06 '23 21:11 C0rn3j