aja-video / libajantv2

Open-source library for AJA Video Systems desktop IO cards.
MIT License
22 stars 16 forks source link

rm: cannot remove '....../libajantv2/driver/linux/.tmp_238382': Directory not empty #39

Open jiapei100 opened 3 weeks ago

jiapei100 commented 3 weeks ago

Failed to install after successfully make libajantv2.

I work under Ubuntu 24.04.1, with gcc 13.2.0 .

➜  ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:    24.04
Codename:   noble
➜  ~ gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[ 97%] Building Linux driver
cd ....../libajantv2/driver && make -C linux
make[3]: Entering directory '....../libajantv2/driver/linux'
linux distro: ubuntu
linux distro flags: -DDISTRO_TYPE=ubuntu -DDISTRO_IS_RHEL_LIKE=0 -DDISTRO_MAJ_VERSION=24 -DDISTRO_MIN_VERSION=4 -DDISTRO_KERNEL_PKG_MAJ=48 -DDISTRO_KERNEL_PKG_MIN=0 -DDISTRO_KERNEL_PKG_PNT=0
lib: lib
make -C /lib/modules/6.8.0-48-generic/build M=....../libajantv2/driver/linux DRIVERDIR=....../libajantv2/driver/linux modules
make[4]: Entering directory '/usr/src/linux-headers-6.8.0-48-generic'
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238382': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238388': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238394': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238400': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238406': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238412': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238418': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238424': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238430': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238436': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238446': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238452': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238458': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238464': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238470': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238476': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238482': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238488': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238494': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238500': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238506': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238513': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238519': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238525': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238531': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238537': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238543': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238549': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238555': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238561': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238567': Directory not empty
rm: cannot remove '....../libajantv2/driver/linux/.tmp_238573': Directory not empty
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
make[4]: Leaving directory '/usr/src/linux-headers-6.8.0-48-generic'
cp ajantv2.ko ....../libajantv2/driver/bin
cp: cannot create regular file '....../libajantv2/driver/bin/ajantv2.ko': No such file or directory
make[3]: *** [Makefile:268: default] Error 1
make[3]: Leaving directory '....../libajantv2/driver/linux'
make[2]: *** [driver/CMakeFiles/driver_linux.dir/build.make:74: driver/CMakeFiles/driver_linux] Error 2
make[2]: Leaving directory '....../libajantv2/build'
make[1]: *** [CMakeFiles/Makefile2:1480: driver/CMakeFiles/driver_linux.dir/all] Error 2
make[1]: Leaving directory '....../libajantv2/build'
make: *** [Makefile:139: all] Error 2

****  Installation failed. Aborting package creation.

Restoring overwritten files from backup...OK

Cleaning up...OK

Bye.
loganb-aja commented 3 weeks ago

Looks like you may have some left over cruft from a previous driver install that is blocking the build process.

Check if our driver is loaded... lsmod | grep aja If the output is blank then our driver is not loaded and you can proceed. If you get an output that looks like ajantv2 1863680 3, then the driver is loaded and you can stop here.

If you still want to rebuild the driver after it has been loaded, then you will need to uninstall the driver.

Assuming the driver is not loaded, lets cd to the correct directory, clean the build area, and attempt to build the driver again... cd libajantv2/driver/linux make clean

If the make clean command fails with similar error listed above, you may need to run the command as root to get the right permissions. sudo !!

Assuming this was successful, try to make the driver again... make

To install the driver using dkms, run the following command... make dkms-install

Let me know if this works for you.