Has anyone built a ClusterCTRL image from scratch on any RedHat-ish release?

60 views
Skip to first unread message

Tony Brack

unread,
Mar 26, 2023, 12:20:51 AM3/26/23
to ClusterHAT
Greetings All,

Yes: I know this all works on Debian flavors.

Before I go down a rat hole I may not need to, has anybody successfully installed clusterctrl on any RedHat flavor of Linux, and if so, how did you acomplish it? Is it a lost cause to start with? Are there some other repositories I should know about? Just wondering if anyone has experience doing this ...

I tried briefly to do this on almalinux and got the following behavior:

[bracka@almalinux ~]$ hostnamectl
   Static hostname: almalinux
         Icon name: computer
        Machine ID: 5b54ae6140e745bbbe703795bffff63b
           Boot ID: fca16670371a407e9445aee2361554c9
  Operating System: AlmaLinux 8.7 (Stone Smilodon)
       CPE OS Name: cpe:/o:almalinux:almalinux:8::baseos
            Kernel: Linux 5.15.74-v8.1.el8
      Architecture: arm64

[bracka@almalinux ~]$ sudo ./clusterinstall-python3.sh
#!/bin/sh -v

TMPINSTALL=`pwd`/clusterhat
yum install -y git
Last metadata expiration check: 0:06:43 ago on Sun 26 Mar 2023 04:04:25 AM UTC.
Package git-2.31.1-3.el8_7.aarch64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
# When using Python2 (for example Raspberry Pi OS)
# yum install -y  libusb-1.0-0-dev python-usb python-libusb1 python-smbus
# When using Python3 (for example Ubuntu 20.10)
yum install -y libusb-1.0-0-dev python3-usb python3-libusb1 python3-smbus python-is-python3
Last metadata expiration check: 0:06:50 ago on Sun 26 Mar 2023 04:04:25 AM UTC.
No match for argument: libusb-1.0-0-dev
No match for argument: python3-usb
No match for argument: python3-libusb1
No match for argument: python3-smbus
No match for argument: python-is-python3
Error: Unable to find a match: libusb-1.0-0-dev python3-usb python3-libusb1 python3-smbus python-is-python3

git clone https://github.com/burtyb/clusterhat-image.git $TMPINSTALL
Cloning into '/home/bracka/clusterhat'...
remote: Enumerating objects: 809, done.
remote: Counting objects: 100% (39/39), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 809 (delta 20), reused 23 (delta 19), pack-reused 770
Receiving objects: 100% (809/809), 152.08 KiB | 1.77 MiB/s, done.
Resolving deltas: 100% (492/492), done.
mkdir /usr/share/clusterctrl/
mkdir: cannot create directory ‘/usr/share/clusterctrl/’: File exists
cp $TMPINSTALL/files/usr/sbin/cluster* /usr/sbin/
cp $TMPINSTALL/files/usr/share/clusterctrl/default-clusterctrl /etc/default/clusterctrl
cp $TMPINSTALL/files/etc/udev/rules.d/90-clusterctrl.rules /etc/udev/rules.d/
cp $TMPINSTALL/files/usr/lib/systemd/system/clusterctrl-init.service /usr/lib/systemd/system/
cp -r $TMPINSTALL/files/usr/share/clusterctrl/python/ /usr/share/clusterctrl/
echo 'TYPE=c' >> /etc/default/clusterctrl
udevadm control --reload-rules
systemctl enable clusterctrl-init
raspi-config nonint do_i2c 0 # Not needed on Ubuntu 20.10
./clusterinstall-python3.sh: line 20: raspi-config: command not found
rm -rf $TMPINSTALL


The python2 results are similar. I have not yet tried Fedora.

Thanks in Advance,
Tony

Chris Burton

unread,
Mar 26, 2023, 8:21:21 AM3/26/23
to ClusterHAT
Hi,
 On AlmaLinux this will get the clusterctrl command running but I haven't been able to get the udev rules working yet.

TMPINSTALL=/tmp/clusterhat
dnf config-manager --add-repo https://repo.almalinux.org/almalinux/8/devel/almalinux-devel.repo
dnf --enablerepo=devel install python3-i2c-tools
dnf install git python3-pyusb python3 usbutils i2c-tools
mkdir /usr/share/clusterctrl/

cp $TMPINSTALL/files/usr/sbin/cluster* /usr/sbin/
cp $TMPINSTALL/files/usr/share/clusterctrl/default-clusterctrl /etc/default/clusterctrl
cp $TMPINSTALL/files/etc/udev/rules.d/90-clusterctrl.rules /etc/udev/rules.d/
cp $TMPINSTALL/files/usr/lib/systemd/system/clusterctrl-init.service /usr/lib/systemd/system/
cp -r $TMPINSTALL/files/usr/share/clusterctrl/python/ /usr/share/clusterctrl/
echo 'TYPE=c' >> /etc/default/clusterctrl
systemctl enable clusterctrl-init
echo -e "\ndtparam=i2c1=on\n" >> /boot/config.txt
rm -rf $TMPINSTALL
reboot

Chris. 

Tony Brack

unread,
Mar 30, 2023, 11:42:42 PM3/30/23
to ClusterHAT
Hi Chris,

It's working well so far and I'm still figuring things out. I am going to follow up with some of the stuff you are working on, but having said this, I did encounter a very minor shortcoming. I am testing/developing with a v2.4 hat and no fan, so not a big deal.

[bracka@coruscant clusterhat]$ sudo clusterctrl status
clusterhat:1
clusterctrl:False
maxpi:4
throttled:NA
hat_version:2.4
hat_version_major:2
hat_version_minor:4
hat_size:4
hat_uuid:de91a4ce-ac7f-11e9-a2a3-2a2ae2dbcce4
hat_vendor:8086 Consultancy
hat_product_id:0x0004
hat_alert:0
hat_hub:1
hat_wp:1
hat_led:1
hat_wplink:0
hat_xra1200p:True
p1:1
p2:0
p3:0
p4:0

[bracka@coruscant clusterhat]$ sudo clusterctrl fan on
Traceback (most recent call last):
  File "/sbin/clusterctrl", line 982, in <module>
    import RPi.GPIO as GPIO


Almalinux has its own unrelated issues ...

Tony

Chris Burton

unread,
Apr 1, 2023, 6:34:27 AM4/1/23
to ClusterHAT
Hi, 
[bracka@coruscant clusterhat]$ sudo clusterctrl fan on
Traceback (most recent call last):
  File "/sbin/clusterctrl", line 982, in <module>
    import RPi.GPIO as GPIO


Almalinux has its own unrelated issues ...

You can turn off fan support by commenting out the FANGPIO line in /etc/defaults/clusterctrl

Or you can install  RPi.GPIO that it's trying to use (for fan control and v1.x ClusterHAT) with something like this.

sudo yum install gcc python36-devel
pip3 install RPi.GPIO

Chris.
Reply all
Reply to author
Forward
0 new messages