Greenzie / emuccan-b202

A Debian package and systemctl scripts for the EMUC-B202 SocketCAN
GNU General Public License v3.0
4 stars 6 forks source link

Aditional files to the debian package #12

Open orensbruli opened 3 weeks ago

orensbruli commented 3 weeks ago

https://app.shortcut.com/greenzie/story/41781/fix-emuccan-installation-to-include-services-rules-etc

The main reason for these modifications is to add to the generated debian dkms package the files that were previously distributed with the package and that were lost when moving to the dkms version.

@edavies64 noticed that with the installation of the new package the emuccan.service file was missing. Reviewing the process, not only that file was missing, but also the udev rules and the default for bash.

This PR is created to try to solve that problem. After searching for hours, with no luck, how to add extra files to a Debian package generated with dkms, we have proceeded with a different approach. The deb file is created with dkms, decompressed, the extra files are added, and then compressed again. It is not the most orthodox, but it seems to work and it avoids the other possible solution which is to create a new Debian package only with the extra packages that are not the module code.

In this PR we have also taken the opportunity to change the old CI and create a shell script that can be used both locally and in the CI, making this process clearer for any developer.

Changes

Testing

It needs to be tested on a real mower, and everything that is required must be installed now.

mfsurvilo commented 3 weeks ago

Can you add some descriptions about the practical impact of this? What will the impact be on the CANBus drivers we occasionally have hiccups with?

orensbruli commented 3 weeks ago

Can you add some descriptions about the practical impact of this?

Yeah, sorry as it's a fix for something reported by Evan I missed adding more context (I thought you were also in the loop). I added some descriptions and comments in the code itself to facilitate the review.

What will the impact be on the CANBus drivers we occasionally have hiccups with? I don't think it will impact any hiccups you have seen recently as it's only related to the installation of some extra files that I think will not have any other impact on the functionality of the driver itself.

I'm also wondering if we have been using the dkms version of the module during the last few months. I think we have not as this is the first time that we realized that the service is not installed with the new deb package.

edavies64 commented 3 weeks ago

Can you add some descriptions about the practical impact of this?

Yeah, sorry as it's a fix for something reported by Evan I missed adding more context (I thought you were also in the loop). I added some descriptions and comments in the code itself to facilitate the review.

What will the impact be on the CANBus drivers we occasionally have hiccups with? I don't think it will impact any hiccups you have seen recently as it's only related to the installation of some extra files that I think will not have any other impact on the functionality of the driver itself.

I'm also wondering if we have been using the dkms version of the module during the last few months. I think we have not as this is the first time that we realized that the service is not installed with the new deb package.

  1. Correct. This is resolving a bug where we were correctly installing the kernel modules, but not installing the systemd service to configure the devices.
  2. Functionally, there is no impact to CANBus performance. The main impact is in ensuing proper install of the driver on a brand new hard drive.
  3. @orensbruli I can confirm that the dkms version of the module was getting installed. The version of this package (prior to switching to dkms) resulted in the service getting installed, but NOT the kernel module. Whereas, the dkms version resulted in the the kernel module installed but not the service. When we were debugging the most recent computer, I was able to confirm i) emuccan-dkms was installed, ii) the kernel module was installed and active, iii) the service was not installed.
orensbruli commented 2 weeks ago

Ok. We have a problem:

$ sudo apt install ./emuccan-dkms_2.6.1_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'emuccan-dkms' instead of './emuccan-dkms_2.6.1_amd64.deb'
The following packages will be DOWNGRADED:
  emuccan-dkms
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 30 not upgraded.
Need to get 0 B/17.2 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 /usr/home/chomper/emuccan-dkms_2.6.1_amd64.deb emuccan-dkms amd64 2.6.1 [17.2 kB]
(Reading database ... 185173 files and directories currently installed.)
Preparing to unpack .../emuccan-dkms_2.6.1_amd64.deb ...

-------- Uninstall Beginning --------
Module:  emuccan
Version: 2.6.1
Kernel:  5.4.0-96-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

emuc2socketcan.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-96-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

Running the post_remove script:
depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 2.6.1
completely from the DKMS tree.
------------------------------
Done.
Unpacking emuccan-dkms (2.6.1) over (2.6.1) ...
dpkg: error processing archive /usr/home/chomper/emuccan-dkms_2.6.1_amd64.deb (--unpack):
 trying to overwrite '/etc/default/emuccan', which is also in package emuccan-b202-5.4.0-96-generic 2.7.2-greenzie-3
Errors were encountered while processing:
 /usr/home/chomper/emuccan-dkms_2.6.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)