8000 Versión definitiva para Debian 13: Soporte GCC, corrección error 404 … by victorewik · Pull Request #7 · fstanis/chuwi-minibook · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/dptf_enabler/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME[0]="dptf_enabler"
DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
AUTOINSTALL="yes"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build LLVM=1 modules"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
39 changes: 22 additions & 17 deletions modules/goodix_ts/Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
DKMS_NAME = goodix_ts
KVER ?= $(shell uname -r | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
DKMS_VERSION = $(KVER)-minibook1
# Extraemos la versión para la carpeta de DKMS
KVER_FULL ?= $(shell uname -r | cut -d+ -f1)
DKMS_VERSION = $(KVER_FULL)-minibook1
DKMS_DIR = /usr/src/$(DKMS_NAME)-$(DKMS_VERSION)
KERNEL_GIT = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain

KERNEL_GIT = https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain
TOUCHSCREEN_DIR = drivers/input/touchscreen
SOURCES = goodix.c goodix.h goodix_fwupload.c

# Ruta de compilación para Debian
KDIR ?= /lib/modules/$(shell uname -r)/build

all: .patched.stamp
make -C $(KDIR) M=$(PWD) modules

# Descarga limpia (la que te funcionó)
$(SOURCES):
curl -fsSL -o $@ "$(KERNEL_GIT)/$(TOUCHSCREEN_DIR)/$@?h=v$(KVER)"
@echo "Descargando $@ desde el repositorio de Torvalds..."
curl -fsSL -o $@ "$(KERNEL_GIT)/$(TOUCHSCREEN_DIR)/$@"

# Aplicar el parche de Chuwi (resume fix)
.patched.stamp: $(SOURCES) goodix_resume.patch
@echo "Aplicando parches de Chuwi para el táctil..."
patch -N -p1 < goodix_resume.patch || true
touch $@

# Instalación estilo Debian/DKMS
install: .patched.stamp
install -Dm644 goodix_cfg.bin /lib/firmware/goodix_9110_cfg.bin
rm -rf "$(DKMS_DIR)"
mkdir -p "$(DKMS_DIR)"
cp Kbuild dkms.conf $(SOURCES) "$(DKMS_DIR)/"
# Quitamos LLVM=1 para Debian en el dkms.conf copiado
sed -i 's/LLVM=1 //g' "$(DKMS_DIR)/dkms.conf"
sed -i 's/^PACKAGE_VERSION=.*/PACKAGE_VERSION="$(DKMS_VERSION)"/' "$(DKMS_DIR)/dkms.conf"
dkms remove -m "$(DKMS_NAME)" -v "$(DKMS_VERSION)" --all 2>/dev/null || true
dkms add -m "$(DKMS_NAME)" -v "$(DKMS_VERSION)"
dkms build -m "$(DKMS_NAME)" -v "$(DKMS_VERSION)"
dkms install --force -m "$(DKMS_NAME)" -v "$(DKMS_VERSION)"

clean:
make -C $(KDIR) M=$(PWD) clean
rm -f $(SOURCES) .patched.stamp

uninstall:
dkms remove -m "$(DKMS_NAME)" -v "$(DKMS_VERSION)" --all 2>/dev/null || true
rm -rf "$(DKMS_DIR)"
rm -f /lib/firmware/goodix_9110_cfg.bin

clean:
rm -f $(SOURCES) .patched.stamp

enable:
modprobe "$(DKMS_NAME)"
echo "$(DKMS_NAME)" > /etc/modules-load.d/$(DKMS_NAME).conf

disable:
rm -f /etc/modules-load.d/$(DKMS_NAME).conf
modprobe -r "$(DKMS_NAME)" 2>/dev/null || true

.PHONY: all install uninstall clean enable disable
.PHONY: all install uninstall clean
2 changes: 1 addition & 1 deletion modules/goodix_ts/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ PACKAGE_VERSION="minibook1"
BUILT_MODULE_NAME[0]="goodix_ts"
DEST_MODULE_LOCATION[0]="/kernel/drivers/input/touchscreen"
AUTOINSTALL="yes"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build LLVM=1 modules"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
2 changes: 1 addition & 1 deletion modules/i2c_designware_spklen/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME[0]="i2c_designware_spklen"
DEST_MODULE_LOCATION[0]="/kernel/drivers/i2c/busses"
AUTOINSTALL="yes"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build LLVM=1 modules"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
2 changes: 1 addition & 1 deletion modules/minibook_ec/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME[0]="minibook_ec"
DEST_MODULE_LOCATION[0]="/kernel/drivers/platform/x86"
AUTOINSTALL="yes"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build LLVM=1 modules"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
11 changes: 11 additions & 0 deletions tools/keyboard_sync/minibook-kbd-always-on.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Desactivar Temporizador Teclado Chuwi (Root)
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/minibook-kbd-timer-off.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions tools/keyboard_sync/minibook-kbd-sync.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Chuwi Keyboard Backlight UI Sync
After=graphical-session.target

[Service]
ExecStart=/usr/local/bin/minibook-kbd-sync.sh
Restart=always

[Install]
WantedBy=default.target
35 changes: 35 additions & 0 deletions tools/keyboard_sync/minibook-kbd-sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Sincronizador de brillo de teclado Chuwi - v12 (Con desactivación de temporizador)
FILE="/sys/class/leds/minibook::kbd_backlight/brightness"
TIMER="/sys/class/leds/minibook::kbd_backlight/auto_off_timer"

# 1. Esperar a que el driver cargue los archivos
while [ ! -f "$FILE" ]; do sleep 2; done

# 2. Desactivar el temporizador de la BIOS (0 = siempre encendido)
if [ -f "$TIMER" ]; then
echo 0 > "$TIMER" 2>/dev/null
fi

# 3. Memoria de estado inicial
LAST_VAL=$(cat "$FILE")

while true; do
if [ -f "$FILE" ]; then
CURRENT_VAL=$(cat "$FILE")

if [ "$CURRENT_VAL" != "$LAST_VAL" ]; then
# Sincronización matemática (0-255 -> 0-100)
PERCENTAGE=$(( ($CURRENT_VAL * 100) / 255 ))

# Mandamos la orden a la sesión de GNOME
gdbus call --session --dest org.gnome.SettingsDaemon.Power \
--object-path /org/gnome/SettingsDaemon/Power \
--method org.freedesktop.DBus.Properties.Set \
"org.gnome.SettingsDaemon.Power.Keyboard" "Brightness" "<int32 $PERCENTAGE>"

LAST_VAL=$CURRENT_VAL
fi
fi
sleep 0.2
done
7 changes: 7 additions & 0 deletions tools/keyboard_sync/minibook-kbd-timer-off.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# Esperar hasta que el archivo del temporizador aparezca
while [ ! -f /sys/class/leds/minibook::kbd_backlight/auto_off_timer ]; do
sleep 2
done
# Apagar el temporizador de la BIOS (0 = Siempre encendido)
echo 0 > /sys/class/leds/minibook::kbd_backlight/auto_off_timer
34 changes: 20 additions & 14 deletions vbt_patch/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
TARGET = vbt_patch
SRCS = vbt_patch.c
OBJS = $(SRCS:.c=.o)

# Evitamos el error 404 usando la ruta de Torvalds limpia
KERNEL_GIT = https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain
I915_DIR = drivers/gpu/drm/i915/display
HEADERS = intel_vbt_defs.h intel_dsi_vbt_defs.h

CC = clang
CFLAGS = -Wall -Wextra -O2

KVER ?= $(shell uname -r | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
KERNEL_GIT = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain
I915_DISPLAY = drivers/gpu/drm/i915/display
HEADERS = intel_vbt_defs.h intel_dsi_vbt_defs.h
all: $(HEADERS) $(TARGET)

vbt_patch: vbt_patch.c $(HEADERS)
$(CC) $(CFLAGS) -o $@ vbt_patch.c
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS)

$(HEADERS):
curl -fsSL -o $@ "$(KERNEL_GIT)/$(I915_DISPLAY)/$@?h=v$(KVER)"
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

all: vbt_patch
# Descarga de cabeceras sin el sufijo +deb13
$(HEADERS):
@echo "Descargando $@ para el parche de video..."
curl -fsSL -o $@ "$(KERNEL_GIT)/$(I915_DIR)/$@"

clean:
rm -f vbt_patch

distclean: clean
rm -f $(HEADERS)
rm -f $(TARGET) $(OBJS) $(HEADERS)

.PHONY: all install uninstall clean distclean
.PHONY: all clean
0