lib.sh: more unified config handling

replace it with logic that simply uses "." to load
files directly. for this, "vcfg" is added as a variable
in coreboot target.cfg files, referring to a directory
in config/vendor/ containing a file named pkg.cfg, and
this file then contains the same variables as the
erstwhile config/vendor/sources

config/git files are now directories, also containing
pkg.cfg files each with the same variables as before,
such as repository link and commit hash

this change results in a noticeable reduction in code
complexity within the build system.

unified reading of config files: new function setcfg()
added to lib.sh

setcfg checks if a config exists. if a 2nd argument is
passed, it is used as a return value for eval, otherwise
a string calling err is passed. setcfg output is passed
through eval, to set strings based on config; eval must
be used, so that the variables are set within the same
scope, otherwise they'd be set within setcfg which could
lead to some whacky results.

there's still a bit more more to do, but this single change
results in a substantial reduction in code complexity.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2024-06-22 02:35:25 +01:00
parent ad1602569e
commit fc7ae3e590
83 changed files with 190 additions and 306 deletions
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="xhci"
vcfg="haswell"
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="xhci"
vcfg="haswell"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="e6400"
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="e6400"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp2170p"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp2560p"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp2570p"
+1
View File
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="nvme"
vcfg="hp8200sff"
+1
View File
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="nvme"
vcfg="hp8200sff"
+1
View File
@@ -6,3 +6,4 @@ payload_memtest="y"
release="n"
grub_scan_disk="nvme ahci"
grubtree="xhci"
vcfg="hp820g2"
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="nvme"
vcfg="ivybridge"
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp8460pintel"
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp8470pintel"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp8560w"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="hp9470m"
+1
View File
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="nvme"
vcfg="t1650"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="xhci"
vcfg="haswell"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -5,3 +5,4 @@ payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="nvme ahci"
grubtree="xhci"
vcfg="haswell"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="sandybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"
+1
View File
@@ -4,3 +4,4 @@ payload_seabios="y"
payload_seabios_withgrub="y"
payload_memtest="y"
grub_scan_disk="ahci"
vcfg="ivybridge"