Add a rudimentary config file - this (finally) removes the need to ever build in a dirty checkout, which makes the build strings and debuging clearer

pull/140/head
Hamish Coleman 5 years ago
parent a52037dc8b
commit 7f9800d203

@ -112,46 +112,41 @@ install.radare.projects:
mkdir -p ~/.config/radare2/projects/x260.R02HT29W.d/
cp -fs $(PWD)/radare/x260.R02HT29W ~/.config/radare2/projects
.config:
cp defconfig .config
include .config
PATCHES-$(CONFIG_KEYBOARD) += \
001_keysym.patch 002_dead_keys.patch 003_keysym_replacements.patch \
004_fn_keys.patch 005_fn_key_swap.patch
PATCHES-$(CONFIG_BATTERY) += \
006_battery_validate.patch
# To enable other misc patches:
# - add a new CONFIG_something value to the defconfig and .config
# - add a new PATCHES-$(CONFIG_something) line referencing the patch
# - optionally, add a patch_enable/patch_disable stanza
# - however, that will get messy quickly, so perhaps a real config target
#
# 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
# applied.
# TODO - actually edit the .config, dont just keep appending new stuff to it
patch_enable_battery:
$(call patch_enable,006_battery_validate.patch)
echo "CONFIG_BATTERY = y" >>.config
patch_disable_battery:
$(call patch_disable,006_battery_validate.patch)
echo "CONFIG_BATTERY = n" >>.config
patch_enable_keyboard:
for j in $(PATCHES_KEYBOARD); do \
$(call patch_enable,$$j); \
done
echo "CONFIG_KEYBOARD = y" >>.config
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 \
if [ -e $$i/$1 ]; then mv $$i/$1 $$i/$2; fi; \
done
endef
echo "CONFIG_KEYBOARD = n" >>.config
# $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
# TODO - the scripts/describe output depends on Descriptions.txt -
# could parse that file and create some deps
@ -188,7 +183,7 @@ endef
# Generate a working file with any known patches applied
%.img: %.img.orig
@cp --reflink=auto $< $@
./scripts/hexpatch.pl --rm_on_fail --report $@.report $@ $@.d/*.patch
./scripts/hexpatch.pl --rm_on_fail --report $@.report $@ $(addprefix $@.d/,$(PATCHES-y))
# using both __DIR and __FL2 is a hack to get around needing to quote the
# DOS path separator. It feels like there should be a better way if I put

@ -0,0 +1,4 @@
# Configuration for which patches to apply
CONFIG_KEYBOARD = y
CONFIG_BATTERY = n

@ -226,7 +226,7 @@ sub main() {
}
my $binaryfile = shift @ARGV;
if (!defined($binaryfile) or !defined($ARGV[0])) {
if (!defined($binaryfile)) {
usage();
}

@ -5,6 +5,9 @@ Also, swapping your capslock and ctrl keys is something that your Operating
System can do, so patching the EC firmware is quite an overkill for this
task.
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- t430.G1HT35WW.img.prepatched.hex 2019-01-15 03:40:49.758801095 +0000
+++ t430.G1HT35WW.img.swapctrlcaps.hex 2019-01-15 03:41:10.240081095 +0000
@@ -8505,7 +8505,7 @@

@ -5,6 +5,9 @@ Also, swapping your capslock and ctrl keys is something that your Operating
System can do, so patching the EC firmware is quite an overkill for this
task.
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230.G2HT35WW.img.dvorak.hex 2017-09-20 19:57:42.206883067 +0300
+++ x230.G2HT35WW.img.prepatched.hex 2017-09-20 19:58:00.471897920 +0300
@@ -8515,7 +8515,7 @@

@ -1,5 +1,8 @@
This swaps capslock and escape.
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
@@ capslock_esc_swap @@
000218b0 9e 9e 00 9f 9f 00 4a 4a 00 00 00 00 b2 00 00 00 |......JJ........|
000218c0 b4 16 02 00 40 00 00 00 58 18 02 00 18 18 02 00 |....@...X.......|

@ -1,3 +1,6 @@
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230.G2HT35WW.img.hex 2017-09-20 21:12:02.011604376 +0300
+++ x230.G2HT35WW.img.dvorak.hex 2017-09-20 22:04:57.510398990 +0300
@@ -8514,14 +8514,14 @@

@ -1,3 +1,6 @@
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230.G2HT35WW.img.hex 2017-09-20 21:12:02.011604376 +0300
+++ x230.G2HT35WW.img.dvorak.hex 2017-09-20 22:02:06.947252472 +0300
@@ -8514,14 +8514,14 @@

@ -1,3 +1,6 @@
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230t.GCHT25WW.img.prepatched.hex 2017-08-27 00:07:20.937481818 +0300
+++ x230t.GCHT25WW.img.hex 2017-08-27 00:07:05.234482494 +0300
@@ -8658,7 +8658,7 @@

@ -1,3 +1,6 @@
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230t.GCHT25WW.img.orig.hex 2017-07-12 12:51:57.975502349 -0400
+++ x230t.GCHT25WW.img.hex 2017-07-12 12:52:03.703479675 -0400
@@ -8657,8 +8657,8 @@

@ -1,3 +1,6 @@
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230t.GCHT25WW.img.prepatched.hex 2017-08-27 19:56:22.362861225 +0300
+++ x230t.GCHT25WW.img.dvorak.hex 2017-08-27 20:50:41.571755322 +0300
@@ -8657,14 +8657,14 @@

@ -1,3 +1,6 @@
To enable this patch, you will need to edit the PATCHES-* variable inside
the Makefile
--- x230t.GCHT25WW.img.prepatched.hex 2017-08-27 19:56:22.362861225 +0300
+++ x230t.GCHT25WW.img.dvorak.hex 2017-08-27 21:00:04.865220520 +0300
@@ -8657,14 +8657,14 @@
Loading…
Cancel
Save