Commit Graph

335 Commits

Author SHA1 Message Date
Ricardo Pardini
8af14d4f8c
armbian-next: countdown: split off file for countdown functions (countdown-to-abort and countdown-to-continue)
- introduce `countdown.sh`, move `traps.sh::exit_if_countdown_not_aborted()` there, introduce `exit_if_countdown_not_aborted()`
2023-02-18 07:43:50 -03:00
Ricardo Pardini
2c9582f9ba
armbian-next: add Debian Ports keyring hostdep to strap Debian riscv64 from ports
- rpardini: actually use ports keyring for Debian Risc-V
- `risc-v`: correctly include `debian-ports-archive-keyring` in Risc-V CLI packages
  - include in debootstrap list, via `config/optional/architectures/riscv64/_config/cli/_all_distributions/main/packages`
  - can't have two `--include` in debootstrap call
- riscv64: move `debian-ports-archive-keyring` from main to debootstrap; also only for `sid`
2023-02-18 07:43:49 -03:00
Ricardo Pardini
d8016c49b6
armbian-next: fix ATF build under binutils 2.39+ via TF_LDFLAGS=--no-warn-rwx-segment 2023-02-18 07:43:48 -03:00
Ricardo Pardini
549ae08061
armbian-next: git: show "fetch completed" info, lest user thinks fetch is hanging while checking out 2023-02-18 07:43:46 -03:00
Ricardo Pardini
47bac3af92
armbian-next: fix missing BOARD_TYPE 2023-02-18 07:43:45 -03:00
Ricardo Pardini
8cedc82ec2
armbian-next: hopefully improved error logging; avoid logging errors up to 3x; subdued red stacktraces
- reorg `display_alert()` so more frequent levels are handled first
- improve some ANSI color usage, still a mess
- don't write failed commands stackstrace as warnings to screen -- just to file (yes it's redundant, except if in test)
- more useful / subdued stacktraces, to make actual error more obvious...
2023-02-18 07:43:43 -03:00
Ricardo Pardini
da1cf2b475
armbian-next: rename too-long main function to prep_conf_main_build_single()
- this commit is proof of OCD (old name didn't fit stacktrace space)
2023-02-18 07:43:42 -03:00
Ricardo Pardini
242a5dad1f
armbian-next: somewhat-better handling/logging when using Docker (don't show two logfiles to inspect)
- do not show path to Docker run-host's logfile, unless the Docker run itself didn't produce logs
- introduce `global_final_exit_code` to allow to maintain/preserve Docker's exit code without triggering an error host-side
2023-02-18 07:43:41 -03:00
Ricardo Pardini
bf3f346bee
armbian-next: still fighting tee leaking: now I think I won, again
- avoid using the "last resort, use lazy umount" by killing tee_pid _and descendants_ before hand. Works!
- introduce `get_descendants_of_pid_array()` using recursive trick to get all descendants
- do not `unset CURRENT_LOGFILE` -- during `logging_error_show_log()` (from SHOW_LOG=no days)
  - do `unset CURRENT_LOGFILE` immediately before processing logs -- although it magically survives. mysteries of traps in bash...
- `declare -g` instead of `export` for `start_logging_section()`
- don't `check_and_close_fd_13()` in `run_cleanup_handlers()`
- do run `check_and_close_fd_13()`, but only after archiving the old logs (in logging trap!)
- add a default error for unhandled TRAP's -- of which should be done
- fix reset of `global_tee_pid=0` in section-logging
2023-02-18 07:43:40 -03:00
Ricardo Pardini
c1100fa461
armbian-next: still fighting tee leaking under duress, turns out I _hadn't_ really won
- last resort, use lazy umount.
- include `lsof` in hostdeps, useful to debug these situations
2023-02-18 07:43:39 -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
be49433b41
armbian-next: use retries for downloading ORAS tooling
- `do_with_retries()`: add `IS_A_RETRY` and `RETRY_FMT_MORE_THAN_ONCE` for convenient logging in retried functions
2023-02-18 07:43:35 -03:00
Ricardo Pardini
ec7639e518
armbian-next: severe bug, there was no prefix-emoji for Windows 2023-02-18 07:43:33 -03:00
Ricardo Pardini
4dd278f07d
armbian-next: compile_firmware(): use new temp dir helpers (saves 2Gb+ in WORKDIR), fix typos 2023-02-18 07:43:32 -03:00
Ricardo Pardini
62d948b1b4
armbian-next: still fighting tee leaking under duress, and I think I won
- call `check_and_close_fd_13()` directly when `exit_with_error()` called, don't wait for trap
- store PID spawned by `do_with_logging()` under `$global_tee_pid`
- `check_and_close_fd_13()`:
  - sprinkle with `sync` to give a chance for stuff to die gracefully
  - check if `$global_tee_pid` is set and actually a running PID, if so, kill it
  - do not blindly "wait" for stuff, instead, kill it and wait for it to die -- 100% more likely to not hang ;-)
2023-02-18 07:43:31 -03:00
Ricardo Pardini
ce47db1e0a
armbian-next: add logging with size of actual built rootfs in MiB; debug tmpfs in trap & after pkgs done 2023-02-18 07:43:30 -03:00
Ricardo Pardini
164db02af5
armbian-next: small cleanups: squash typos / add function keyword / add types / mark dead code 2023-02-18 07:43:29 -03:00
Ricardo Pardini
35fbb7ed6c
armbian-next: small cleanups: squash typos / add function keyword / add types / mark dead code 2023-02-18 07:43:28 -03:00
Ricardo Pardini
0ea0fe3528
armbian-next: mktemp and tmpfs related utility functions with automatic cleanup handlers 2023-02-18 07:43:27 -03:00
Ricardo Pardini
af7ace7e57
armbian-next: don't leak .raw image if failure before move; show rootfs-tmpfs info
- add escapings and TODO's around the area...
2023-02-18 07:43:26 -03:00
Ricardo Pardini
1636a2afea
armbian-next: tune logging: unmounting, u-boot prep/source/install; traps; extensions 2023-02-18 07:43:25 -03:00
Ricardo Pardini
ff4b5069ce
armbian-next: extract move_images_to_final_destination() and optimize for fast-move when src/dst on same filesystem 2023-02-18 07:43:24 -03:00
Ricardo Pardini
92d902c883
armbian-next: drop dead/duplicated code for bootsplash and mark kernel-drivers.sh (which includes bootsplash) as dead code 2023-02-18 07:43:23 -03:00
Ricardo Pardini
4d59ad7ac4
armbian-next: try harder to get en_US.UTF-8 logging 2023-02-18 07:43:22 -03:00
Ricardo Pardini
99a7a7980b
armbian-next: docker: remove old code 2023-02-18 07:43:21 -03:00
Ricardo Pardini
a6a5152695
armbian-next: chroot_sdcard_apt_get_update() to replace and better log chroot_sdcard_apt_get update
- also add retries where it was missing
- @TODO: desktop_postinstall() is a mess, needs aggregation work
2023-02-18 07:43:19 -03:00
Ricardo Pardini
2455c55dac
armbian-next: firmware: don't build -full firmware if not on CI/noninteractive and board's not going to use it
- move `fakeroot_dpkg_deb_build()` from runners.sh to new utils-dpkgdeb.sh
  - and make it debug show the size of the source
- clean off `.git` directory earlier for full build
- @TODO: get rid of the "hardlinks" funky biz in there and not-copy `.git` to begin with
2023-02-18 07:43:18 -03:00
Ricardo Pardini
f2bd68afde
armbian-next: kernel: cleanup bundle after patching succeeded, not after build success
- for extra gigabytes of space, earlier
2023-02-18 07:43:17 -03:00
Ricardo Pardini
48c0e9acf4
armbian-next: severe bug, countdown counted up 2023-02-18 07:43:16 -03:00
Ricardo Pardini
8444e7e308
armbian-next: bring back swig hostdep -- needed for some u-boot's 2023-02-18 07:43:15 -03:00
Ricardo Pardini
9d26ee1373
armbian-next: logging: squash nasty leaking file descriptor bug due to "tee"
- check and make sure the fd is closed before processing and/or deleting logs.
- change from fd 3 to 13, for extra "this is evil". is it? is 13 an evil number? you decide.
2023-02-18 07:43:14 -03:00
Ricardo Pardini
c4ca062709
armbian-next: tmpfs-utils: last-resort debugging, to stderr, of failed tmpfs unmount 2023-02-18 07:43:13 -03:00
Ricardo Pardini
ff94b79e60
armbian-next: do basic host checks before config if interactive, or during prepare-host if not
- group basic checks at `check_basic_host()`
2023-02-18 07:43:12 -03:00
Tony
f549ddb273
armbian-next: officially support WSL2; pester user for UTF-8 terminal
- new `wsl2.sh` file with WSL2-related functions; checking/validating/pestering user; allow WSL2 (not WSL1)

Co-authored-by: Ricardo Pardini <ricardo@pardini.net>
2023-02-18 07:43:11 -03:00
Ricardo Pardini
bf891d54d9
armbian-next: split prepare_host(), fix .tmp reset trap
- `prepare_host()`: split; do checks earlier and allow them to be interactive
- introduce `exit_if_countdown_not_aborted()` for "Low Disk Space" and other critical conditions
- split `prepare_host()` into interactive & non-interactive parts
- split off `clean_deprecated_mountpoints()` from prepare into `cleaning.sh`
- introduce and use `reset_uid_owner_non_recursive()` for `.tmp` reset in trap, to avoid disasters
- add more logging sections to default-build.sh, avoid unlogged parts
2023-02-18 07:43:10 -03:00
Ricardo Pardini
2d9f9216eb
armbian-next: introduce tmpfs-utils.sh; put LOGDIR and WORKDIR under tmpfs; set CCACHE_TEMPDIR under WORKDIR
- introduce generic `prepare_tmpfs_for()`, which manages it's own cleanup/dir removal
- use it for `WORKDIR` (which is `TMPDIR`) and `LOGDIR`
  - adapt previous cleanup handlers for those, so they delete their contents but not the dir itself (which might be mounted)
- also: make `ARMBIAN_LOG_CLI_ID` readonly together with other superglobals
- set `XDG_RUNTIME_DIR` & `XDG_RUNTIME_DIR` together with `TMPDIR`
- kernel-make.sh: pass `CCACHE_TEMPDIR` down to Kernel make (thanks @the-Going)
2023-02-18 07:43:09 -03:00
Ricardo Pardini
d6200a30e6
armbian-next: make superglobals readonly (DEST/WORKDIR/LOGDIR/SDCARD/MOUNT and others) 2023-02-18 07:43:08 -03:00
Ricardo Pardini
7f21e7d5f3
armbian-next: ccache: show more in ccache debugging 2023-02-18 07:43:07 -03:00
Ricardo Pardini
231e179703
armbian-next: traps: allow for cleanup handlers with arguments; unify around run_one_cleanup_handler()
- show error if trap handler fails
2023-02-18 07:43:06 -03:00
Ricardo Pardini
029076d0a0
armbian-next: docker: use dash-lines before/after launching docker; set ARMBIAN_INSIDE_DOCKERFILE_BUILD=yes when it is so 2023-02-18 07:43:05 -03:00
Ricardo Pardini
aaf391bf19
armbian-next: mark Vagrant CLI as unimplemented 2023-02-18 07:43:04 -03:00
Ricardo Pardini
e633ff584a
armbian-next: debug note about fstab with tmpfs in chroot 2023-02-18 07:43:03 -03:00
Ricardo Pardini
1075f1b962
armbian-next: make sure temporary kernel and u-boot CLI commands always build a kernel/u-boot even if cached
- really, it's time to split off those into actual, proper CLIs
- remove a forgotten `KDEB_CHANGELOG_DIST` left there
2023-02-18 07:43:02 -03:00
Ricardo Pardini
d8254d1e6e
armbian-next: docker: fix Dockerfile output indentation & warning msgs about generation 2023-02-18 07:43:01 -03:00
Ricardo Pardini
43b4f45018
armbian-next: introduce POOR_MAN_PROFILER=yes (under ANSI_COLOR=none)
- turns out EPOCHREALTIME can be comma separated, and have multiple leading zeroes
2023-02-18 07:43:00 -03:00
Ricardo Pardini
2a68cc6e9e
armbian-next: optimize for CONFIG_DEFS_ONLY=yes, skipping stacktraces/git info 2023-02-18 07:42:59 -03:00
Ricardo Pardini
b7fa6fa8b0
armbian-next: optimize config_source_board_file(), now 600x faster by not reusing (slow) code from interactive 2023-02-18 07:42:58 -03:00
Ricardo Pardini
eb7b80983b
armbian-next: fix re-launching of CLI commands under sudo (Docker was ok) 2023-02-18 07:42:52 -03:00
Ricardo Pardini
78fd35a1e3
armbian-next: better logging for kernel_prepare_bare_repo_from_oras_gitball(); remove dead code
- remove dead code used to fetch tags, back from pre-bundle days
2023-02-18 07:42:51 -03:00
Ricardo Pardini
6cf26e4c59
armbian-next: don't warn about using extlinux 2023-02-18 07:42:49 -03:00