Closed ali-soomro closed 1 year ago
Hi there, yes the script does not stop at errors (something I am going to change). Most likely the actual build process of the kernel module failed. If you have a log of the make process, could you provide it to me? Presumably it can be found under /var/lib/dkms/snd-hda-codec-realtek/0.1/build/make.log
Hi, yes the build process failed, I could not quite troubleshoot why, I have attached the log below: /var/lib/dkms/snd-hda-codec-realtek/0.1/build/make.log https://pastebin.com/1iSQBcVG
Thanks, to me it seems the problem lies in the version of the gcc compiler. Ubuntu 22.04 still uses a version 11 compiler whereas the newer kernel was built with version 12. You can fix this by uncommenting the gcc12 lines in the script. But instead of explaining everything here, I will amend the README.md.
I understand what you're saying, but isn't there a way to make Ubuntu 22.04 use the correct version?
Running apt list --installed | grep gcc-12
returns:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gcc-12-base/jammy-updates,jammy-security,now 12.1.0-2ubuntu1~22.04 amd64 [installed,automatic]
gcc-12/jammy-updates,jammy-security,now 12.1.0-2ubuntu1~22.04 amd64 [installed]
libgcc-12-dev/jammy-updates,jammy-security,now 12.1.0-2ubuntu1~22.04 amd64 [installed,automatic]
Obviously, you have installed gcc-12 which is good. The thing is, Ubuntu won't choose gcc-12 automatically. I am currently working on a quick fix of the scripts.
You might want to try the new version of the scripts. I added detection and selection of gcc-12 if it's not the system default.
Worth noting, previously make was using gcc-12, but it wasn't 12.2, it was 12.1.
That said, both the new scripts give the following error:
mv: cannot move '/usr/src/linux-headers-6.2.12-060212-generic/vmlinux' to '/usr/src/linux-headers-6.2.12-060212-generic-generic/vmlinux.orig': No such file or directory
Yes, this was to avoid readelf error messages. If they appear, you can ignore them in my experience. Please try the new version. I split up the script in to several sub scripts, but it is still sufficient to start the two setup_* scripts. They should be more idempotent by now.
Still having an error with make, posting the whole log: https://pastebin.com/fi5y31bi
I think the error might originate in the gcc version and/or dwarves version. The log indicates a difference in the minor version of the gcc that built the kernel (12.2) and the installed gcc version (12.1). That might cause the error. So if you manage to install a gcc version of 12.2 on Ubuntu 22.04 you should make a step forward. (But I do not know how, as I am on Ubuntu 23.04). The BTF error messages could be related to the dwarves util package. Mine is 1.24 which obviously works. Did you consider upgrading to Ubuntu 23.04 which directly ships with a 6.2 kernel and associated build tools?
So, I decided to test this out on the same machine, this time using a new install of Ubuntu 23.04. gcc-12 does indeed now point to 12.2 as required. I cannot believe it actually works.
You are an absolute genius, thank you so much!
2 things to fix in the readme:
Firstly:
sudo chown u+x setup_snd-hda-scodec-cs35l41.sh
should be chmod instead of chown and name correction.
Secondly:
sudo chown u+x snd-hda-codec-realtek.sh
./snd-hda-codec-realtek.sh
should be corrected to
sudo chmod +x setup_snd-hda-codec-realtek.sh
./setup_snd-hda-codec-realtek.sh
Hi, I have a very basic understanding of systems and own a HP Envy 15-ew0xxx running Ubunutu 22.04 and also have the speaker issue.
I tried running your scripts on Ubuntu 22.04.2 with kernel 6.2.12-060212-generic and both times, the system rebooted, which means it successfully reached the end of the script.
However, it is not clear what I am supposed to do once I have successfully run both scripts. Any help would be highly appreciated!
Also, thank you so much for making this!
EDIT: When running setup_snd-hda-codec-realtek.sh I get the error "binary package not found" when running:
sudo dkms build -m snd-hda-codec-realtek -v 0.1 --force
before the system reboots