EXECUTIVE SUMMARY: (1) With a kludge, dkms properly builds and installs a device’s module on Ubuntu Server despite linux-headers being for x86-64. (2) Debian Desktop returns a “UnicodeEncodeError” and can not create the device’s module, and furthermore lacks linux-headers that match the kernel 4.4.154 (3) Where may I find proper linux-headers for Ubuntu Server? (4) More important, how can I make Debian Desktop not have the error with unicode-encode (and with make mrproper)?
(1) For Ubuntu Server, I did
uname -a
Linux linux 4.4.154-59-rockchip-g5e70f14 #4 SMP Fri Dec 14 20:55:41 CST 2018 aarch64 aarch64 aarch64 GNU/Linux
I saw that the following were installed.
linux-headers-4.15.0-51 linux-headers-4.15.0-51-generic linux-headers-generic
I purged these and installed headers that matched the kernel.
dpkg -P linux-headers-4.15.0-51 linux-headers-4.15.0-51-generic linux-headers-generic
apt-get install linux-headers-4.4.154-59-rockchip-g5e70f14
Though python3 was already installed, dkms required that I do,
apt-get install python
dkms add
worked fine
dkms build
failed.
The Ubuntu package for "all" is clearly NOT for all.
Oddly, I see x86-64
file linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/recordmcount
linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/recordmcount: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.32, BuildID[sha1]=70631fcaccffee0c875de6b7f8759b7e066718c6, not stripped
and
file linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/asn1_compiler
linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/asn1_compiler: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.32, BuildID[sha1]=fa6465002367f4b16f5dd3c44034f09ca18c08e1, not stripped
Furthermore, the next kernel-header is broken, too
apt-get install linux-headers-4.4.154-72-rockchip-g6520deb
file linux-headers-4.4.154-72-rockchip-g6520deb/scripts/asn1_compiler
linux-headers-4.4.154-72-rockchip-g6520deb/scripts/asn1_compiler: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.32, BuildID[sha1]=c44b9d49051d9a8be02fbb9c50d9f717ea97268a, not stripped
Fortunately, I had another SBC with the appropriate, aarch64 binaries:
cp -a recordmcount linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/
cp -a fixdep linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/basic/
cp -a modpost linux-headers-4.4.154-59-rockchip-g5e70f14/scripts/mod/
dkms build realtek-rtl88xxau/5.2.20.2~20180812
now ran without complaint, and after
dkms install realtek-rtl88xxau/5.2.20.2~20180812
my device was recognized.
1. This approach is a kludge.
2. How can I fetch the arm64 linux-headers for Ubuntu Server?
(2) Unlike Ubuntu Server, Debian Desktop has matching linux-headers but can not build the module!
Debian repositories - Debian repositories
"By the way, we have updated a new kernel image. Package “linux-headers-4.4.154-10-g209c242-dirty” is recommended.
uname -a
Linux wifi 4.4.154 #13 SMP Mon Nov 5 18:25:35 CST 2018 aarch64 GNU/Linux
Taking the recommendation, I had to tell dkms to ignore linux-headers-4.4.154 and use linux-headers-4.4.154-10-g209c242-dirty
dkms build --kernelsourcedir /usr/src/linux-headers-4.4.154-ge0ce80a-dirty realtek-rtl88xxau/5.2.20.2~20180812
Gave the following
Preparing kernel 4.4.154 for module build:
(This is not compiling a kernel, just preparing kernel symbols)
Storing current .config to be restored when complete
Running Generic preparation routine
make mrproper…(bad exit status: 2)
Warning: using /usr/src/linux-headers-4.4.154-ge0ce80a-dirty/.config
(I hope this is the correct config for this kernel)
make oldconfig…
make prepare-all…(bad exit status: 2)
Building module:
cleaning build area…
‘make’ -j6 KVER=4.4.154 KSRC=/lib/modules/4.4.154/build…(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.4.154 (aarch64)
Consult /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/make.log for more information.
I did/saw,
cat /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/make.log
DKMS make.log for realtek-rtl88xxau-5.2.20.2~20180812 for kernel 4.4.154 (aarch64)
Mon Jun 10 14:19:38 UTC 2019
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/4.4.154/build M=/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build modules
make[1]: *** /lib/modules/4.4.154/build: No such file or directory. Stop.
I did,
cp -a /lib/modules/4.4.154-ge0ce80a-dirty /lib/modules/4.4.154
dkms build --kernelsourcedir /usr/src/linux-headers-4.4.154-ge0ce80a-dirty realtek-rtl88xxau/5.2.20.2~20180812
which yielded
Preparing kernel 4.4.154 for module build:
(This is not compiling a kernel, just preparing kernel symbols)
Storing current .config to be restored when complete
Running Generic preparation routine
make mrproper…(bad exit status: 2)
Warning: using /usr/src/linux-headers-4.4.154-ge0ce80a-dirty/.config
(I hope this is the correct config for this kernel)
make oldconfig…
make prepare-all…(bad exit status: 2)
Building module:
cleaning build area…
‘make’ -j6 KVER=4.4.154 KSRC=/lib/modules/4.4.154/build…(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.4.154 (aarch64)
Consult /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/make.log for more information.
I did/saw,
cat /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/make.log
DKMS make.log for realtek-rtl88xxau-5.2.20.2~20180812 for kernel 4.4.154 (aarch64)
Tue Jun 11 04:27:44 UTC 2019
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/4.4.154/build M=/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.4.154-ge0ce80a-dirty’
CC [M] /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_cmd.o
CC [M] /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_security.o
CC [M] /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_debug.o
CC [M] /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_io.o
CC [M] /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_ioctl_query.o
CC [M] /var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_ioctl_set.o
Traceback (most recent call last):
File “./scripts/gcc-wrapper.py”, line 115, in
status = run_gcc()
File “./scripts/gcc-wrapper.py”, line 98, in run_gcc
print (line.decode(“utf-8”), end="")
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2018’ in position 45: ordinal not in range(128)
Traceback (most recent call last):
Traceback (most recent call last):
File “./scripts/gcc-wrapper.py”, line 115, in
File “./scripts/gcc-wrapper.py”, line 115, in
status = run_gcc()
status = run_gcc()
File “./scripts/gcc-wrapper.py”, line 98, in run_gcc
File “./scripts/gcc-wrapper.py”, line 98, in run_gcc
print (line.decode(“utf-8”), end="")
print (line.decode(“utf-8”), end="")
UnicodeEncodeErrorUnicodeEncodeError: : ‘ascii’ codec can’t encode character u’\u2018’ in position 45: ordinal not in range(128)‘ascii’ codec can’t encode character u’\u2018’ in position 45: ordinal not in range(128)
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_debug.o’ failed
make[2]: *** [/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_debug.o] Error 1
make[2]: *** Waiting for unfinished jobs…
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_security.o’ failed
make[2]: *** [/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_security.o] Error 1
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_cmd.o’ failed
make[2]: *** [/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_cmd.o] Error 1
Traceback (most recent call last):
File “./scripts/gcc-wrapper.py”, line 115, in
status = run_gcc()
File “./scripts/gcc-wrapper.py”, line 98, in run_gcc
print (line.decode(“utf-8”), end="")
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2018’ in position 45: ordinal not in range(128)
Traceback (most recent call last):
File “./scripts/gcc-wrapper.py”, line 115, in
status = run_gcc()
File “./scripts/gcc-wrapper.py”, line 98, in run_gcc
print (line.decode(“utf-8”), end="")
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2018’ in position 45: ordinal not in range(128)
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_io.o’ failed
make[2]: *** [/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_io.o] Error 1
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_ioctl_query.o’ failed
make[2]: *** [/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_ioctl_query.o] Error 1
Traceback (most recent call last):
File “./scripts/gcc-wrapper.py”, line 115, in
status = run_gcc()
File “./scripts/gcc-wrapper.py”, line 98, in run_gcc
print (line.decode(“utf-8”), end="")
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2018’ in position 45: ordinal not in range(128)
scripts/Makefile.build:277: recipe for target ‘/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_ioctl_set.o’ failed
make[2]: *** [/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build/core/rtw_ioctl_set.o] Error 1
Makefile:1474: recipe for target ‘module/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build’ failed
make[1]: *** [module/var/lib/dkms/realtek-rtl88xxau/5.2.20.2~20180812/build] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.4.154-ge0ce80a-dirty’
Makefile:1942: recipe for target ‘modules’ failed
make: *** [modules] Error 2
What gives? Ubuntu Server had no complaints. Since linux-headers for Debian Desktop match the system, something else must be awry on the system. What is it and how can I fix it?