Add makefile helper targets for enabling and disabling patchsets, then document all this

pull/16/head
Hamish Coleman 7 years ago
parent 60829a81f7
commit 114299e6c7

@ -114,6 +114,47 @@ install.radare.projects:
mkdir -p ~/.config/radare2/projects/x260.R02HT29W.d/
cp -fs $(PWD)/radare/x260.R02HT29W ~/.config/radare2/projects
#
# These enable and disable targets change which patches are configured to be
# applied
PATCHES_KEYBOARD := 001_keysym.patch 002_dead_keys.patch \
003_keysym_replacements.patch 004_fn_keys.patch 005_fn_key_swap.patch
patch_enable_battery:
$(call patch_enable,006_battery_validate.patch)
patch_disable_battery:
$(call patch_disable,006_battery_validate.patch)
patch_enable_keyboard:
for j in $(PATCHES_KEYBOARD); do \
$(call patch_enable,$$j); \
done
patch_disable_keyboard:
for j in $(PATCHES_KEYBOARD); do \
$(call patch_disable,$$j); \
done
# $1 is the old patch name
# $2 is the new patch name
define patch_mv
for i in *.img.d; do \
mv $$i/$1 $$i/$2; \
done
endef
# $1 is the patch name
define patch_enable
$(call patch_mv,$1.OFF,$1)
endef
# $1 is the patch name
define patch_disable
$(call patch_mv,$1,$1.OFF)
endef
DEPSDIR := .d
$(shell mkdir -p $(DEPSDIR))
-include $(DEPSDIR)/slice.extract.deps

@ -67,15 +67,9 @@ Notes:
Then you can use your normal CDROM burning tools to put this image on
a blank cd and boot it up, skipping steps 8 and 9.
* To enable the battery patch, look at the "*.OFF" files in the
subdirectories and rename the right one to remove the ".OFF".
Ensure you start with a clean build ("make clean") to get the new
patch applied.
* To make an installer that reverts any EC changes, rename all the "*.patch"
files in the subdirectory for your laptop so that they have "*.OFF"
appended to them. Ensure you start with a clean build ("make clean")
Then build with the normal instructions.
* To include the battery validation patch or to make a build that
reverts any EC changes, read the docs/CONFIG.txt and follow
the configuration instructions in it.
Booting the stick and flashing the firmware:

@ -0,0 +1,27 @@
Configuring which patches are used
----------------------------------
This repository has two sets of patches - one set for the keyboard
changes and one for turning off the battery validation. The battery
patches are disabled by default, but are easy to enable.
Any combination of the two sets of patches can be enabled or disabled
(even including a version with no patches at all - to revert all changes)
There are several makefile targets that exist to help you configure which
patches are enabled. Choose one or more of the following commands to
configure as you want:
make patch_enable_battery clean
make patch_disable_battery clean
make patch_enable_keyboard clean
make patch_disable_keyboard clean
Behind the scenes
-----------------
Each hardware and EC firmware version combination needs its own set of
patches, which are stored in directories called "*.img.d" - the disable
commands are simply renaming the patch files to have a suffix of ".OFF"
(or removing that suffix to enable)
Loading…
Cancel
Save