mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
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)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This is called both early in compile.sh, but also after processing cmdline params in the cli entrypoint.sh
|
||||
# This is called both early in compile.sh, but also after processing cmdline params in the cli entrypoint.sh
|
||||
function logging_init() {
|
||||
# defaults.
|
||||
# if stdout is a terminal, then default SHOW_LOG to yes
|
||||
@@ -101,10 +101,10 @@ function print_current_asset_log_base_file() {
|
||||
}
|
||||
|
||||
function discard_logs_tmp_dir() {
|
||||
# Linux allows us to be more careful, but really, those are log files we're talking about.
|
||||
# Do not delete the dir itself, since it might be a tmpfs mount.
|
||||
if [[ "$(uname)" == "Linux" ]]; then
|
||||
rm -rf --one-file-system "${LOGDIR}"
|
||||
rm -rf --one-file-system "${LOGDIR:?}"/* # Note this is protected by :?
|
||||
else
|
||||
rm -rf "${LOGDIR}"
|
||||
rm -rf "${LOGDIR:?}"/* # Note this is protected by :?
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user