Skip to content

Commit

Permalink
Add forcereloadmodule_disableplatformprofile make
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfan committed Aug 20, 2023
1 parent 5db9e19 commit 48b25ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions kernel_module/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ obj-m += legion-laptop.o

all:
$(MAKE) -C $(KSRC) M=$(shell pwd) modules
bash -c "./issue-warning.sh"

moduleInContainer:
docker run -it --rm -v "$(shell pwd)":/kernel_module -w /kernel_module -v /usr/src/:/usr/src/ -v /lib/modules/:/lib/modules gcc:12.2.0 bash
Expand All @@ -33,6 +34,7 @@ uninstall:
@rm -f $(INSTALLDIR)/legion-laptop.ko
@depmod --all
@printf "%s\n" "Uninstall finished."
bash -c "./issue-warning.sh"

install_forcereload:
make install
Expand All @@ -55,13 +57,20 @@ forcereloadmodulereadonly:
rmmod legion-laptop.ko || true
insmod legion-laptop.ko force=1 ec_readonly=1
dmesg --ctime
bash -c "./issue-warning.sh"

reloadmodule_disableplatformprofile:
rmmod legion-laptop.ko || true
insmod legion-laptop.ko enable_platformprofile=0
dmesg --ctime
bash -c "./issue-warning.sh"

forcereloadmodule_disableplatformprofile:
rmmod legion-laptop.ko || true
insmod legion-laptop.ko force=1 enable_platformprofile=0
dmesg --ctime
bash -c "./issue-warning.sh"

dkms: all
if [ -d $(DKMSDIR) ]; then\
rm --recursive $(DKMSDIR)/*;\
Expand Down
6 changes: 4 additions & 2 deletions kernel_module/issue-warning.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash

RED='\033[0;31m'
GREEN='\033[0;32m'
BOLD=$(tput bold)
nocol='\033[0m'

echo -e "${RED} ${BOLD} If you have a 2022 or 2023 model, please help testing the new features '\e]8;;https://github.com/johnfanv2/LenovoLegionLinux/issues/46\ahere\e]8;;\a'"
echo -e "${RED} ${BOLD} If you have a light in the lid (Y-logo) or at the IO-ports (all Legion 7), please help testing controlling it '\e]8;;https://github.com/johnfanv2/LenovoLegionLinux/issues/54\ahere\e]8;;\a' ${nocol}"
echo -e "${RED} ${BOLD} If you have a 2022 or 2023 model, please help testing the new features '\e]8;;https://github.com/johnfanv2/LenovoLegionLinux/issues/46\ahere\e]8;;\a' ${nocol}"
echo -e "${RED} ${BOLD} If you have a light in the lid (Y-logo) or at the IO-ports (all Legion 7), please help testing controlling it '\e]8;;https://github.com/johnfanv2/LenovoLegionLinux/issues/54\ahere\e]8;;\a' ${nocol}"
echo -e "${GREEN} ${BOLD} Please give a star on github to support my goal is to merge the driver into the main Linux kernel, so no recompilation is required after a Linux update: '\e]8;;https://github.com/johnfanv2/LenovoLegionLinux\ahere\e]8;;\a' ${nocol}"

0 comments on commit 48b25ea

Please sign in to comment.