vrolife / modern_laptop

Redmi Book Pro 14/15 2022 锐龙版/Ryzen Linux 键盘驱动/keyboard driver
GNU Affero General Public License v3.0
242 stars 16 forks source link

Hunk #3 FAILED at 5471. #5

Closed Vliro closed 2 years ago

Vliro commented 2 years ago

patch < .bios/patch.diff patching file dsdt.dsl Reversed (or previously applied) patch detected! Assume -R? [n] y Hunk #3 FAILED at 5471. 1 out of 4 hunks FAILED -- saving rejects to file dsdt.dsl.rej make: *** [Makefile:11: dsdt.aml] Error 1

On a Redmibook 15 Pro 2022, latest version of BIOS as of 18th July 2022.

Vliro commented 2 years ago

Although it does mention previous patch, it was an issue either way.

vrolife commented 2 years ago

fixed https://github.com/vrolife/modern_laptop/commit/647fb21c7f77896186ebfdac3cf3dc5928fa5aeb

Vliro commented 2 years ago

[albert@albert-redmi modern_laptop]$ sudo make install /bin/sh dump_dsdt.sh Please keep this file 'original_dsdt.dat' for upgrading iasl -d dsdt.dat

Intel ACPI Component Architecture ASL+ Optimizing Compiler/Disassembler version 20220331 Copyright (c) 2000 - 2022 Intel Corporation

File appears to be binary: found 15920 non-ASCII characters, disassembling Binary file appears to be a valid ACPI table, disassembling Input file dsdt.dat, Length 0xC6E5 (50917) bytes ACPI: DSDT 0x0000000000000000 00C6E5 (v01 XMCC XMCC2113 00000002 ACPI 00040000) Pass 1 parse of [DSDT] Pass 2 parse of [DSDT] Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed Disassembly completed ASL Output: dsdt.dsl - 409451 bytes patch < .bios/patch.diff patching file dsdt.dsl Hunk #3 FAILED at 5471. 1 out of 4 hunks FAILED -- saving rejects to file dsdt.dsl.rej make: *** [Makefile:11: dsdt.aml] Error 1

This is running the latest commit.

vrolife commented 2 years ago

Please open file /etc/default/grub and delete GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi_override", then run update-initramfs -u. Reboot your laptop and run sudo make install again.

Vliro commented 2 years ago

Done mkinitcpio -p , Also, running a prepatched kernel for the keyboard, would that cause issues?

Vliro commented 2 years ago

The kernel is linux-zen-irq1-edge-low-shared on arch.

Furthermore, the fingerprint driver is hard to run on Arch as the libraries don't exist. Is it possible to bundle them alongside the binary?

puzzle9 commented 2 years ago

The kernel is linux-zen-irq1-edge-low-shared on arch.

Furthermore, the fingerprint driver is hard to run on Arch as the libraries don't exist. Is it possible to bundle them alongside the binary?

owner use ubuntu so

vrolife commented 2 years ago

If your patch working like this commit https://patchwork.kernel.org/project/linux-acpi/patch/20220618133712.8788-1-gch981213@gmail.com/. Your patch will make no sense, because it will be bypass.

vrolife commented 2 years ago

The fingerprint was built for Ubuntu 24.04, if you want to run it on Arch, please consider run it in podman/docker with ubuntu image, and mount the usb device to the container.

puzzle9 commented 2 years ago

[albert@albert-redmi modern_laptop]$ sudo make install /bin/sh dump_dsdt.sh Please keep this file 'original_dsdt.dat' for upgrading iasl -d dsdt.dat

Intel ACPI Component Architecture ASL+ Optimizing Compiler/Disassembler version 20220331 Copyright (c) 2000 - 2022 Intel Corporation

File appears to be binary: found 15920 non-ASCII characters, disassembling Binary file appears to be a valid ACPI table, disassembling Input file dsdt.dat, Length 0xC6E5 (50917) bytes ACPI: DSDT 0x0000000000000000 00C6E5 (v01 XMCC XMCC2113 00000002 ACPI 00040000) Pass 1 parse of [DSDT] Pass 2 parse of [DSDT] Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed Disassembly completed ASL Output: dsdt.dsl - 409451 bytes patch < .bios/patch.diff patching file dsdt.dsl Hunk #3 FAILED at 5471. 1 out of 4 hunks FAILED -- saving rejects to file dsdt.dsl.rej make: *** [Makefile:11: dsdt.aml] Error 1

This is running the latest commit.

you can maybe try https://github.com/vrolife/modern_laptop/pull/6

puzzle9 commented 2 years ago

Your user names and avatars are very similar

Vliro commented 2 years ago

Thanks, I'll try the container solution.

I'm only using this kernel temporarily to have a keyboard, it probably uses that patch. However, this kernel is temporary.

Redmibook wmi, can that be used without the acpi patch?

vrolife commented 2 years ago

Yes it can, the WMI driver do not depends on ACPI patch

vrolife commented 2 years ago

If you run fingerprint driver in container, you need to mount /var/run/dbus to container too.

Vliro commented 2 years ago

The acpi fix works now. I'll let you know regarding fingerprint driver.

Vliro commented 2 years ago

I got the driver working in a container. However, it needs sudo access, probably as I don't mount the exposed driver outside the container. What is the device exposed by fingerpp? As I get Using device /net/reactivated/Device/0 failed to claim device: GDBus.Error:net.reactivated.Fprint.Error.Internal: get peer uid failed

when I run fprintd-enroll without sudo. With sudo it works fine so it is a matter of permissions, not actually setting it up. I do run the container as root as I couldn't get it working otherwise.

Vliro commented 2 years ago

`FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Stockholm RUN apt update && apt-get install -y libssl3 \ libopencv-dev \ libusb-1.0-0 \ fprintd \ libevent-core-2.1-7 \ libdbus-1-3 WORKDIR /app COPY fingerpp /usr/bin/fingerpp

ENTRYPOINT ["/usr/bin/fingerpp", "--bus=system"] `

sudo podman run -v /var/run/dbus:/var/run/dbus --device /dev/bus/usb/001/002 <container-id>

vrolife commented 2 years ago

If you enroll fingerprint for a user who does not exists in container, it will report GDBus.Error:net.reactivated.Fprint.Error.Internal: get peer uid failed. So you should create same user(with same uid useradd -u UID name) in container.

Vliro commented 2 years ago

That fixed it. However fingerprints are not persistent. I assume they are stored in the container and therefore lost upon restart

That just needed to mount /var/lib/fprint as well. Now it works!

vrolife commented 2 years ago

To persist your fingerprint data, you should mount folder /var/lib/fprint/ to container.

Vliro commented 2 years ago

Yeah I figured that out. Added a systemd service and fingerprint auth works as expected.

georgetian3 commented 2 years ago

Still receiving the following error using the latest commit bb3e2fe:

george@RBPL:~/modern_laptop$ sudo make install
/bin/sh dump_dsdt.sh
Please keep this file 'original_dsdt.dat' for upgrading
iasl -d dsdt.dat

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20200925
Copyright (c) 2000 - 2020 Intel Corporation

File appears to be binary: found 15924 non-ASCII characters, disassembling
Binary file appears to be a valid ACPI table, disassembling
Input file dsdt.dat, Length 0xC6E5 (50917) bytes
ACPI: DSDT 0x0000000000000000 00C6E5 (v01 XMCC   XMCC2113 00000002 ACPI 00040000)
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
Disassembly completed
ASL Output:    dsdt.dsl - 409476 bytes
patch < .bios/patch.diff
patching file dsdt.dsl
Hunk #3 FAILED at 5471.
1 out of 4 hunks FAILED -- saving rejects to file dsdt.dsl.rej
make: *** [Makefile:11: dsdt.aml] Error 1

I have removed GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi_override" from /etc/default/grub, ran update-initramfs -u and rebooted, but still receiving the same error.

Linux version: 5.15.0-41-generic

vrolife commented 2 years ago

try this commit 208f34a679af2c02230d73d67d325f8219bcc729

Vliro commented 2 years ago

Also, regarding the PSR issue. I looked into the kernel source (it crashes on line 3319 in dc_link.c) and that was an assert(false). The comment says that this should never happen but it did so perhaps a firmware issue.

vrolife commented 2 years ago

Mainline Linux does not support 6800H PSR yet. https://lore.kernel.org/all/20220510204508.506089-15-dingchen.zhang@amd.com/T/

Vliro commented 2 years ago

What is needed to get the mic working? I have arch but out of the box the mic does not work but the speakers do work.

georgetian3 commented 2 years ago

try this commit 208f34a

It appears that upgrading to linux-image-oem-22.04 and using that commit solved the issue.

Vliro commented 2 years ago

haven't been able to fix the microphone on redmibook 15. Is this a issue with 6000 family?

vrolife commented 2 years ago

https://github.com/vrolife/modern_laptop/commit/f0345df52470047008037b7d7add72c07702bec6

Vliro commented 2 years ago

f0345df

Thank you, worked great.

siva-sub commented 2 years ago

Hi is there any detailed installation guide on installing the fingerprint driver in arch linux. i am redirected by the installer to this thread . but i have no idea on on how to go about setting up the fingerprint driver in arch linux. please help. Thanks

vrolife commented 2 years ago

Hi is there any detailed installation guide on installing the fingerprint driver in arch linux. i am redirected by the installer to this thread . but i have no idea on on how to go about setting up the fingerprint driver in arch linux. please help. Thanks

ArchLinux support added in a separate branch archlinux_fingerprint, but untested. Please install this branch, and post the result.

git clone -b archlinux_fingerprint https://github.com/vrolife/modern_laptop.git
cd modern_laptop
sudo /bin/sh install.sh fingerprint
siva-sub commented 2 years ago

Thanks man it worked.

siva-sub commented 2 years ago

Hi sorry again tried to install it again after installing kde fresh again on arch but it says archlinux_fingerprint branch not available. Any help thanks

git clone -b archlinux_fingerprint https://github.com/vrolife/modern_laptop.git

vrolife commented 2 years ago

Please install main branch. Branch archlinux_fingerprint has been merged into the main branch.

git clone https://github.com/vrolife/modern_laptop.git