Commit Graph

54 Commits

Author SHA1 Message Date
Ricardo Pardini 5396ffb602 patching: emit warnings when files in `dt` folder overwrite pre-existing files (DTs that landed upstream)
- it's more and more common that the (bare) DT files in our `dt` folders have landed upstream
- this adds warnings and marks the patching table red when some bare-dt file overwrites what's already in git
- without this it's very easy to forget them there during bumps
2024-09-18 16:31:34 +02:00
amazingfate 24be131989 dt_makefile_patcher: fix dtbs with dot in filename 2024-09-10 10:48:53 +08:00
ColorfulRhino 308eba5d31 cli: dt_makefile_patcher: Allow numbers in `configopt` regex
This fixes detection of the config option for SpacemiT K1 which is `CONFIG_SOC_SPACEMIT_K1X`.
Otherwise it would not find it because it includes a '1'.
2024-07-01 19:15:00 +02:00
Ricardo Pardini 282fb964e5 patching: rewrite: fully stabilize patch `index` stanzas as well as From lines
- `git format-patch --zero-commit` doesn't affect `index xxx...yyy` lines, only `From: `
  - so use the _classy_ "use a regex with a callback" solution as git format-patch doesn't offer one
- this will make _all_ patches change when rewritten, but hopefully _for the last time_ !
- we need to preserve `index 000000000000..xxx` as zeros, which indicate new file creation, thus:
  - new file creations are rewritten as `index 000000000000..111111111111`
  - non-creations are rewritten as `index 111111111111..222222222222`
- this is the final version of #6455
2024-06-09 10:42:26 +02:00
Darsey Litzenberger ce33bddb58 Make the colorized build output readable on a light background
This fixes the readability of colorized output of compile.sh when
running on a terminal with a light background.  It uses the COLORFGBG
environment variable similarly to how the ip(8) command does.

Signed-off-by: Darsey Litzenberger <dlitz@dlitz.net>
2024-02-09 19:38:03 +01:00
Ricardo Pardini 86cfcf304a patching: support 'incremental' Makefile auto-patching, for vendor kernels
- without incremental: true:
  - we replace the DT Makefile based on *.dts at the DT directory after all patching/copying is done
  - overlay target is added if overlays present
- with incremental: true:
  - we parse the Makefile, parse the DTs being built, and only add .dts's we have added from 'dt' directory
  - overlays target are not added; we assume smth else already added them
2024-02-04 11:24:31 +01:00
amazingfate afc30e64eb patching: set commit index length to 12 when rewriting patches 2023-12-30 13:33:56 +01:00
Ricardo Pardini 6186a41c2b patching: if 0 files left to commit after config-filtering, don't commit nor rewrite the patches
- this is mostly useful for Makefile's and DT patches which should end be bare instead of null-patched
2023-10-26 14:48:49 +00:00
Ricardo Pardini 568ed3ae39 pipeline: don't bomb when logging int value's length (GHA outputs) 2023-10-13 21:05:33 +02:00
Ricardo Pardini ed39cb04fb pipeline: add hard 17*30 limit to number of total matrix jobs
- show size of each GHA output in logs
2023-10-13 20:13:10 +02:00
Ricardo Pardini ef01d98347 patching: show auto-patch'ed in summary table (in blue); remove spurious warnings 2023-10-03 14:10:46 +02:00
Ricardo Pardini a547d3b101 patching: show the patch number for multi-patch mbox files in summary table 2023-10-03 14:10:46 +02:00
Ricardo Pardini 50895a24ee patching: enhance the DT Makefile Autopatcher to work with armhf's new 6.5 subdir Makefiles as well as arm64
- arm64: one-rule-per-dtb
- arm32: single-rule, multi-dtb
2023-10-03 14:10:46 +02:00
Ricardo Pardini 800d92045d tools: patching: don't rewrite auto-generated patches (eg, drivers) 2023-09-29 08:48:01 +02:00
Ricardo Pardini d402092682 pipeline: use ncores * 4 for info gathering 2023-08-23 21:35:02 +02:00
Ricardo Pardini 274d394ab2 pipeline: handle `exit_with_target_not_supported_error()` (retcode 44) as warning and not error
- split errors and warnings into multiple lines, so a bit easier to see in the logs what the real error was
- also turn down a few spurious warnings to debugs
2023-08-23 21:35:02 +02:00
Ricardo Pardini 688e415832 pipeline: add userspace inventory capabilities
- digs into config/distributions and config/desktops for info
- this produces `output/info/all_userspace_inventory.json`
  - this is now passed down to the `targets-compositor` in `cli-jsoninfo`
- `targets-compositor` now accepts `userspace:` as `items-from-inventory`
- extra: add `targets-composed` CLI command, to stop after targets-compositor
2023-08-23 21:35:02 +02:00
Ricardo Pardini b92575381a pipeline: inventory all board vars; add `not-eos-with-video`; introduce `TARGETS_FILTER_INCLUDE`
> How to use:
>
> `./compile.sh inventory` - does just the board inventory; look for output in `output/info`
>
> `./compile.sh targets-dashboard` - does inventory, targets compositing, and images info; look for output in `output/info`, read the instructions output by the command if you want to load the OpenSearch dashboards.
>
> `./compile.sh targets` - does the full targets compositing and artifacts, look for output in `output/info`
>
> If you don't have a `userpatches/targets.yaml`, _one will be provided for you_ defaulting to Jammy minimal CLI
> and Jammy xfce desktop, for all boards in all branches. You can pass filters via `TARGETS_FILTER_INCLUDE=...` to narrow.
>

- board JSON inventory:
  - more generic regex parsing of variables from board files:
    - all top-level (non-indented) variables are parsed and included in the JSON board inventory
    - this allows us to add new variables to the board files without having to update the parser
    - variables can be bare, `export` or `declare -g`, but **_must_ be quoted** (single or double) and UPPER_CASE
  - some special treatment for certain variables:
    - `KERNEL_TARGET` is parsed as a _comma-separated_ list of valid BRANCH'es
    - `BOARD_MAINTAINER` is parsed as _space-separated_ list of valid maintainer GH usernames as `BOARD_MAINTAINERS: [...]` in the JSON
      - script complains if `BOARD_MAINTAINER` is not set in core boards. Empty is still allowed.
    - `HAS_VIDEO_OUTPUT="no"` causes `BOARD_HAS_VIDEO: false` in the JSON (for desktop-only inventorying, see below)
- introduce `not-eos-with-video` in `items-from-inventory` at the targets compositor
  - the same as `not-eos`, but with added `BOARD_HAS_VIDEO: true` filter, see above
- introduce `TARGETS_FILTER_INCLUDE` for targets compositor
  - this filters the targets _after_ compositing (but before getting image info), based on the board inventory data
  - it's a comma-separated list of `key:value` pairs, which are OR-ed together
  - new virtual info `BOARD_SLASH_BRANCH` post-compositing inventory for filtering of a specific BOARD/BRANCH combo (e.g. `odroidhc4/edge`)
  - some interesting possible filters:
    - `TARGETS_FILTER_INCLUDE="BOARD:odroidhc4"`: _only_ build a single board, all branches. JIRA [AR-1806]
    - `TARGETS_FILTER_INCLUDE="BOARD_SLASH_BRANCH:odroidhc4/current"`: _only_ build a single board/branch combo
    - `TARGETS_FILTER_INCLUDE="BOARD:odroidhc4,BOARD:odroidn2"`: _only_ build _two_ boards, all branches.
    - `TARGETS_FILTER_INCLUDE="BOARD_MAINTAINERS:rpardini"`: build all boards and branches where rpardini is a maintainer
    - `TARGETS_FILTER_INCLUDE="BOARDFAMILY:rockchip64"`: build all boards and branches in the rockchip64 family
  - image-info-only variables like `LINUXFAMILY` is **not** available for filtering at this stage
- rename `config/templates` `targets-all-cli.yaml` to `targets-default.yaml`
    - this is used when no `userpatches/targets.yaml` is found
    - new default includes all boards vs branches for non-EOS boards
        - also desktop for all boards that _don't_ have `HAS_VIDEO_OUTPUT='no``
- introduce simplified `targets-dashboard` CLI:
  - does only inventory, compositing, and image info, but not artifact reducing, etc.
  - ignore desktop builds in the OpenSearch indexer
  - update the OpenSearch Dashboards, including new information now available
- invert the logic used for `CLEAN_INFO` and `CLEAN_MATRIX`
    - defaults to `yes` now, so new users/CI don't get hit by stale caches by default
    - repo pipeline CLI stuff is usually run on saved/restored artifacts for `output/info`, so don't clean by default via the CLI
2023-07-26 15:15:02 +02:00
Igor Pecovnik d56b56edbb Revert "`armbian-desktop`/`aggregation`: introduce `DESKTOP_COMMON` aggregation variant, where arch/config/appgroups are ignored; see #5439"
This reverts commit f952ae89fb.
2023-07-19 01:02:23 +02:00
Ricardo Pardini f952ae89fb `armbian-desktop`/`aggregation`: introduce `DESKTOP_COMMON` aggregation variant, where arch/config/appgroups are ignored; see #5439 2023-07-18 14:20:44 +02:00
Ricardo Pardini fe36951c9f patching: auto patchers: bare dts, bare overlays, DT Makefile 2023-06-13 12:29:52 +02:00
Ricardo Pardini 70a64a0415 patching: Patching Summary and Patching Failures tables using Python's Rich
- even Rich'er patch output by colorizing certain strings green/yellow/red
- BASE_GIT_TAG now very sneakily also accepts a branch name
- IMPORTANT: this includes: BREAKING CHANGE: patches failing to apply now break the build. fixes #4958
  - also break on legacy `process_patch_file()` failure, remove `EXIT_PATCHING_ERROR`
2023-06-13 12:29:52 +02:00
Ricardo Pardini eff56a7909 pipeline: `debs-to-repo` (v7, working with reprepro)
- pipeline: artifacts: use better description for artifacts (artifact_name+artifact_version instead of artifact_final_file_basename)
2023-05-16 20:09:47 +02:00
Ricardo Pardini b7c659c0a9 pipeline: gha: fix `IMAGES_ONLY_OUTDATED_ARTIFACTS` and `SKIP_IMAGES` by exporting them so Python can see; tune logging 2023-05-09 10:04:57 +02:00
Ricardo Pardini de8bbcec11 pipeline: correctly quote params passed over pure strings (eg in the GHA JSON matrixes) so values with spaces are not mangled 2023-05-04 16:08:11 +02:00
Ricardo Pardini 1b36bb63d7 bash_declare_parser: parse space-separated single-quoted array values correctly ('THIS=has space' is a single token, not two) 2023-05-04 16:08:11 +02:00
Ricardo Pardini 875960ddb7 aggregation: `armbian_utils.parse_env_for_tokens()` now actually does what it said on the box "split by whitespace, line breaks, commas, and semicolons"; add appgroups summary 2023-05-04 16:08:11 +02:00
Ricardo Pardini f8ddf7f9e2 🔥 JSON info pipeline: v18
- pipeline: add `pipeline` context object to targets; use it to filter artifacts and images to build; warn about oci-name with multiple oci-tags
- pipeline: better error messages when info's fail; show some (out-of-order) progress messages during parallel info gathering
- pipeline: targets-compositor: add `not-eos` inventory
- TARGETS_FILENAME, log all OCI lookups
- SKIP_IMAGES
- IMAGES_ONLY_OUTDATED_ARTIFACTS
- no dash in chunk id in JSON
- pipeline: very initial chunking, using the same outputs
- pipeline: template targets, `items-from-inventory:` inventory expansion, CHECK_OCI=yes, CLEAN_MATRIX=yes, CLEAN_INFO=yes, many fixes
- cli: `inventory` / `targets` / `matrix` / `workflow`
- pipeline: workflow beginnings
- pipeline: general log cleanup + OCI stats / better miss handling
- pipeline: fixes/reorg
- pipeline: catch & log JSON parsing errors
- pipeline: gha matrix: use IMAGE_FILE_ID as job description
- pipeline (delusion): gha workflow output, based on old matrix code
- pipeline: better parsing and reporting of stderr log lines (under `ANSI_COLOR=none`)
- pipeline: mapper-oci-uptodate: use separate positive/negative cache dirs (GHA will only cache positives); cache negs for 5 minutes locally
- pipeline: output-gha-matrix artifacts + images
  - pipeline: output-gha-matrix artifacts + images: "really" and fake 1-item matrix if empty
- pipeline: move files into subdir; update copyright & cleanup
- pipeline: refactor bash jsoninfo driver a bit
- pipeline: outdated-artifact-image-reducer
- pipeline: introduce `target_id` at the compositor, aggregate it at the reducer, carry it over in the artifact info mapper
- pipeline: mapper-oci-uptodate
- pipeline: info-gatherer-artifact, with PRE_PREPARED_HOST
- pipeline: refactor/rename info-gatherer-image.py
- pipeline: beginnings
2023-05-01 22:46:25 +02:00
Ricardo Pardini f75b9c110f aggregation: fix: don't eat value if empty during `bash_string_multiline()`; write end-of-file comment; show aggregation bash results if debugging 2023-03-31 09:12:44 +02:00
Ricardo Pardini 7d90b10f79 configdump: better logging; insert (still unsupported) array/dict raw value and 2do markers into produced dump JSON 2023-03-31 09:12:44 +02:00
Ricardo Pardini 42fc56697b `configdump`/`json-info-boards`: revamp, all-JSON now; use_board=yes skip_kernel=no for config; refactor & use new Python bash-declare-to-JSON utility
- use new capture'd vars scheme
- so `./compile.sh BOARD=xxx BRANCH=yyyy config-dump-json | jq .` now works and is consistent/newline tolerant
- introduce internal `skip_host_config=yes` for `prep_conf_main_minimal_ni()` to skip calling `check_basic_host()`
2023-03-31 09:12:44 +02:00
Igor Pečovnik d59fa58875
Add (c) also to python scripts (#4926) 2023-03-09 20:52:06 +01:00
Ricardo Pardini 5d3ba1bade
armbian-next: patching: rewrite: don't gag on bad "/dev/null.c" rename patches; archeology: `--find-copies-harder`; try to get GHA to run GH pages
- try to convince GHA to actually run my kernel patching summary workflow on push
2023-02-18 07:44:51 -03:00
Ricardo Pardini 4219533054
armbian-next: aggregation: quick & dirty "potential paths" in Markdown 2023-02-18 07:44:43 -03:00
Ricardo Pardini f71e6f4865
armbian-next: patching: accept b4's magic marker `git@z Thu Jan 1 00:00:00 1970` for mbox validations 2023-02-18 07:44:15 -03:00
Ricardo Pardini 3e012306c4
armbian-next: `patching`: less horrible patching log, pt 38: downgrade utf-8 mbox to log warning, mark as problem 2023-02-18 07:43:47 -03:00
Ricardo Pardini 861b07305e
armbian-next: `patching`: less horrible patching log, pt 37
- don't show stats for patches that are bind applied blind (failed to parse/autogen)
- don't show Author, it's too long
- don't dump Python exceptions in log
- extra: expand Python imports
2023-02-18 07:43:44 -03:00
Ricardo Pardini b0bef8b1c4
armbian-next: patching.py vs decent logging: better, but not there yet
- mostly downgrading stuff to .debug()
- some stats
2023-02-18 07:43:37 -03:00
Ricardo Pardini a3d8b5891b
armbian-next: aggregation.py vs create-cache.sh: better hashing, much desktop
- aggregation.py:
  - only include non-removed pkgs in hash (do'h)
  - use a sorted unique of desktop+rootfs+debootstrap pkgs for pkg hash
  - make space for having apt sources/gpg keys in hash @TODO
  - write a hash-text variable for bash with info, for easy comparison later
  - refactor out bash_string_multiline()
- create-cache.sh:
  - don't armhf unless `ARMHF_ARCH=yes`
  - remove the uninstall stuff until we decide @TODO
  - don't show "free space of MOUNT" when there's only SDCARD
  - better logging for resolv.conf/machine-id shenanigans does in rootfs cache
  - drop dead code, squash some quoting issues
  - show the size of the zstd ball after compressing
  - don't even go to github armbian/cache nor cache.armbian.com for list of caches if SKIP_ARMBIAN_REPO=yes
  - remove mentions of BOARD or BRANCH, not relevant in rootfs cache
2023-02-18 07:43:36 -03:00
Ricardo Pardini e540e52207
armbian-next: `patching`: parse renamed source files, don't swallow them during rewrite 2023-02-18 07:42:57 -03:00
Ricardo Pardini a254643268
armbian-next: `patching`: avoid mangling valid utf-8 from mbox'es 2023-02-18 07:42:56 -03:00
Ricardo Pardini 7096cf70d3
armbian-next: `patching`: remove quotes from author name during parsing 2023-02-18 07:42:55 -03:00
Ricardo Pardini 0207d5f517
armbian-next: `patching`: don't rewrite empty desc as "None" 2023-02-18 07:42:54 -03:00
Ricardo Pardini 3c7587ef84
armbian-next: `patching`: don't complain about missing files when the patch parsed OK and file was actually deleted 2023-02-18 07:42:53 -03:00
Ricardo Pardini 4307bac073
armbian-next: patching: use `--zero-commit` instead of find/replace for rewrite 2023-02-18 07:42:02 -03:00
Ricardo Pardini 14ecc86b60
armbian-next: patching: grouping tryout, very basic by-dir: `SPLIT_PATCHES=yes` 2023-02-18 07:42:01 -03:00
Ricardo Pardini f0a0fa3000
armbian-next: patching: patches-to-git: don't eat newline between subject and message 2023-02-18 07:42:00 -03:00
Ricardo Pardini a57e128cfa
armbian-next: patching: don't gag if empty hexsha / no archeology possible 2023-02-18 07:41:59 -03:00
Ricardo Pardini 0b0fa6630b
armbian-next: patching: add sanity checks for magic markers matching mbox len & patch_contents not containing magic markers
- case in point, mvebu-edge's disappearing patch in `12-net-dsa-mv88e6xxx.patch`
2023-02-18 07:41:55 -03:00
Ricardo Pardini b7efd70f1a
armbian-next: patching: to-git: don't fail if is_autogen_dir; only change Subject if not rewriting in place 2023-02-18 07:41:54 -03:00