Commit 6151a33
committed
overlay: opt-in build-time preprocessing of overlay files
Add `overlay: { preprocess: [globs] | true }` to run the existing
{{ env. }} / {{ config. }} / {{ avocado. }} interpolation over overlay file
*contents* at build time. This lets projects template a secret (such as a
claim token) into overlay files without an in-tree sed + restore dance that
risks leaving secrets in the working tree.
Overlay files are copied verbatim inside the SDK container, so a processed
copy is materialized on the host into `.avocado/overlay-staging/<label>/`
(gitignored scratch, inside the /opt/src bind mount) and the copy is pointed
there. Binary (non-UTF-8) files pass through verbatim; symlinks and mode bits
are preserved. Default off = byte-identical to today.
- interpolation: add preprocess_text (thin wrapper over interpolate_string)
- new utils/overlay_preprocess: PreprocessSpec, glob matcher, materializer,
and a deterministic post-preprocess content digest
- wire into rootfs/initramfs (rootfs/install.rs) and sysext/confext
(ext/build.rs) copy sites; local overlays only (remote-ext overlays warn+skip)
- stamps: fold the post-preprocess content digest into rootfs/initramfs/ext
input hashes when preprocess is on, so a changed template value or an edited
overlay file invalidates the build (verbatim overlays unchanged)1 parent 849458f commit 6151a33
6 files changed
Lines changed: 743 additions & 16 deletions
File tree
- src
- commands
- ext
- rootfs
- utils
- interpolation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
554 | 556 | | |
555 | 557 | | |
556 | 558 | | |
557 | | - | |
| 559 | + | |
| 560 | + | |
558 | 561 | | |
559 | 562 | | |
560 | 563 | | |
561 | 564 | | |
562 | 565 | | |
| 566 | + | |
563 | 567 | | |
564 | 568 | | |
565 | 569 | | |
| |||
574 | 578 | | |
575 | 579 | | |
576 | 580 | | |
577 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
578 | 586 | | |
579 | 587 | | |
580 | 588 | | |
581 | 589 | | |
582 | 590 | | |
| 591 | + | |
583 | 592 | | |
584 | 593 | | |
585 | 594 | | |
| |||
616 | 625 | | |
617 | 626 | | |
618 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
619 | 680 | | |
620 | 681 | | |
621 | 682 | | |
| |||
1913 | 1974 | | |
1914 | 1975 | | |
1915 | 1976 | | |
| 1977 | + | |
1916 | 1978 | | |
1917 | 1979 | | |
1918 | 1980 | | |
| |||
1955 | 2017 | | |
1956 | 2018 | | |
1957 | 2019 | | |
| 2020 | + | |
1958 | 2021 | | |
1959 | 2022 | | |
1960 | 2023 | | |
| |||
1997 | 2060 | | |
1998 | 2061 | | |
1999 | 2062 | | |
| 2063 | + | |
2000 | 2064 | | |
2001 | 2065 | | |
2002 | 2066 | | |
| |||
2040 | 2104 | | |
2041 | 2105 | | |
2042 | 2106 | | |
| 2107 | + | |
2043 | 2108 | | |
2044 | 2109 | | |
2045 | 2110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | | - | |
661 | | - | |
| 659 | + | |
| 660 | + | |
662 | 661 | | |
663 | 662 | | |
664 | 663 | | |
665 | 664 | | |
666 | 665 | | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
674 | 699 | | |
675 | 700 | | |
676 | 701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
197 | 220 | | |
198 | 221 | | |
199 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
0 commit comments