Remove the last manually maintained list from the Makefile - all lists of rules are now generated from the Descriptions.txt

pull/36/head
Hamish Coleman 7 years ago
parent c0b2178942
commit 615f87dd2b

@ -32,6 +32,9 @@
# depe - Dependancies that are only valid for "extract"
# depi - Dependancies that are only valid for the inverse "insert"
# param - Any parameters that are needed to be passed to the macro
# extract - "0" turns off the extract rule
# insert - "0" turns off the insert rule
# suffix - "0" turns off the ".orig" suffix on the extract rule
#
# The iso images downloadable from Lenovo
@ -98,3 +101,13 @@ x230.G2HT35WW.img rule:IMG,dep:x230.G2HT35WW.s01D3000.FL2 x230 EC 1.14
x230t.GCHT25WW.img rule:IMG,dep:x230t.GCHT25WW.s01DA000.FL2 x230t EC 1.14 (decrypted)
x250.N10HT17W.img.enc rule:IMGnoenc,dep:x250.N10HT17W.s01E5000.FL2 x250 EC 1.16 (encrypted)
x260.R02HT29W.img rule:IMGnoenc,dep:x260.R02HT29W.s0AR0200.FL2 x260 EC 1.11 (not encrypted)
# The end-user visible, nicely named iso images
patched.t430.iso rule:niceISO,dep:g1uj40us.iso,suffix:0,insert:0 for patching Thinkpad T430
patched.t430s.iso rule:niceISO,dep:g7uj19us.iso,suffix:0,insert:0 for patching Thinkpad T430s
patched.t530.iso rule:niceISO,dep:g4uj30us.iso,suffix:0,insert:0 for patching Thinkpad T530
patched.t530i.iso rule:niceISO,dep:g4uj30us.iso,suffix:0,insert:0 for patching Thinkpad T530i
patched.w530.iso rule:niceISO,dep:g5uj28us.iso,suffix:0,insert:0 for patching Thinkpad W530
patched.x230.iso rule:niceISO,dep:g2uj25us.iso,suffix:0,insert:0 for patching Thinkpad X230
patched.x230t.iso rule:niceISO,dep:gcuj24us.iso,suffix:0,insert:0 for patching Thinkpad X230t

@ -15,20 +15,16 @@ QEMU_OPTIONS ?= -enable-kvm
GITVERSION = $(shell git describe --dirty --abbrev=6 ) ($(shell date +%Y%m%d))
BUILDINFO = $(GITVERSION) $(MAKECMDGOALS)
LIST_PATCHED = $(basename $(shell grep ^patched Descriptions.txt |cut -d" " -f1))
list_laptops:
$(info )
$(info The following make targets are the supported usb images:)
$(info )
$(info patched.t430.img - for patching Thinkpad T430)
$(info patched.t430s.img - for patching Thinkpad T430s)
$(info patched.t530.img - for patching Thinkpad T530)
$(info patched.t530i.img - for patching Thinkpad T530i)
$(info patched.w530.img - for patching Thinkpad W530)
$(info patched.x230.img - for patching Thinkpad X230)
$(info patched.x230t.img - for patching Thinkpad X230t)
$(info )
$(info patched.t430.257.img - for patching Thinkpad T430 BIOS 2.57 - no keyboard patch)
$(info )
@for i in $(LIST_PATCHED); do \
echo "$$i.img\t- `scripts/describe $$i.iso`"; \
done
@echo
.PHONY: list_laptops
@ -49,32 +45,11 @@ clean:
really_clean: clean
rm -f *.iso.orig
# manually managed list of laptops - update this if the BIOS versions change
patched.t430.iso: g1uj40us.iso
$(call patched_iso,$<,$@)
patched.t430.257.iso: g1uj25us.iso
$(call patched_iso,$<,$@)
patched.t430s.iso: g7uj19us.iso
$(call patched_iso,$<,$@)
patched.t530.iso: g4uj30us.iso
$(call patched_iso,$<,$@)
patched.t530i.iso: g4uj30us.iso
$(call patched_iso,$<,$@)
patched.w530.iso: g5uj28us.iso
$(call patched_iso,$<,$@)
patched.x230.iso: g2uj25us.iso
$(call patched_iso,$<,$@)
patched.x230t.iso: gcuj24us.iso
$(call patched_iso,$<,$@)
# TODO - whilst this could be added to the "pretty named" list, I think
# that it is more useful to use the new generated rules framework to allow
# asking for the iso image by name - in this case "g1uj25us.iso"
#patched.t430.257.iso: g1uj25us.iso
# $(call patched_iso,$<,$@)
list_iso:
$(info )
@ -248,14 +223,6 @@ GETELTORITO := ./scripts/geteltorito
mv $@.tmp $@
$(call build_info,$<.report)
# $1 is the lenovo named iso
# $2 is the nicely named iso
define patched_iso
mv $1 $2
mv $1.report $2.report
$(call build_info,$2.report)
endef
# $1 is the bat file
define build_info
@echo
@ -367,6 +334,18 @@ define rule_IMG_insert
endef
rule_IMG_insert_DEPS = scripts/FL2_copyIMG scripts/xx30.encrypt
# Take a built ISO file with Lenovo's name and rename it to a nice name
#
# $< is the lenovo named iso
# $@ is the nicely named iso
define rule_niceISO_extract
mv $< $@
mv $<.report $@.report
$(call build_info,$@.report)
endef
rule_niceISO_extract_DEPS = # no extra dependancies
# Additional macros for any special cases:
# Extract the IMG file from an FL2 file - special case, without decryption

@ -35,6 +35,13 @@ while(<>) {
push @{$entry->{tags}{$tag}}, @values;
}
# default tags - if there is a value loaded from the tags_raw, it will
# take precedence, but otherwise this ensures we create the array and
# have the default value at [0]
push @{$entry->{tags}{extract}},1;
push @{$entry->{tags}{insert}},1;
push @{$entry->{tags}{suffix}},1;
push @entries,$entry;
}
@ -72,37 +79,47 @@ for my $entry (@entries) {
@params = @{$entry->{tags}{param}};
}
# generate the forward rule
my $rule = "rule_".$entry->{tags}{rule}[0]."_extract";
push @extracts,
sprintf("# %s:%i\n",
$entry->{generator_file},
$entry->{generator_line},
),
sprintf("%s: %s %s %s %s\n\t\$(call %s)\n\n",
$entry->{filename}.".orig",
$dep0.".orig",
join(' ',@deps,@deps_extract),
$entry->{generator_file},
'$('.$rule.'_DEPS)',
join(',',$rule,@params),
);
# generate the inverse rule
$rule = "rule_".$entry->{tags}{rule}[0]."_insert";
push @inserts,
sprintf("# %s:%i\n",
$entry->{generator_file},
$entry->{generator_line},
),
sprintf("%s: %s %s %s %s\n\t\$(call %s)\n\n",
$dep0,
$entry->{filename},
join(' ',@deps,@deps_insert),
$entry->{generator_file},
'$('.$rule.'_DEPS)',
join(',',$rule,@params),
);
if ($entry->{tags}{extract}[0]) {
# generate the forward rule
my $suffix = "";
if ($entry->{tags}{suffix}[0]) {
$suffix = ".orig";
}
my $rule = "rule_".$entry->{tags}{rule}[0]."_extract";
push @extracts,
sprintf("# %s:%i\n",
$entry->{generator_file},
$entry->{generator_line},
),
sprintf("%s: %s %s %s %s\n\t\$(call %s)\n\n",
$entry->{filename}.$suffix,
$dep0.$suffix,
join(' ',@deps,@deps_extract),
$entry->{generator_file},
'$('.$rule.'_DEPS)',
join(',',$rule,@params),
);
}
if ($entry->{tags}{insert}[0]) {
# generate the inverse rule
my $rule = "rule_".$entry->{tags}{rule}[0]."_insert";
push @inserts,
sprintf("# %s:%i\n",
$entry->{generator_file},
$entry->{generator_line},
),
sprintf("%s: %s %s %s %s\n\t\$(call %s)\n\n",
$dep0,
$entry->{filename},
join(' ',@deps,@deps_insert),
$entry->{generator_file},
'$('.$rule.'_DEPS)',
join(',',$rule,@params),
);
}
}
if (!$rules_found) {

Loading…
Cancel
Save