mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +00:00
Meta: Improve build compatibility with non-GNU userspaces
We depend on GNU-specific du switch `--apparent-size`. Busybox has this implemented, but as `-b` instead. Another part of the build system uses `cp --preserve=timestamps`. This can be replaced by `rsync -t`, and rsync is already used through the file. Thanks to those changes, Serenity can be built on a Busybox system, without GNU coreutils.
This commit is contained in:
parent
fddbd11baa
commit
d7644d1d86
6 changed files with 23 additions and 56 deletions
|
@ -82,3 +82,20 @@ get_number_of_processing_units() {
|
|||
|
||||
($number_of_processing_units)
|
||||
}
|
||||
|
||||
# We depend on GNU coreutils du for the --apparent-size extension.
|
||||
# GNU coreutils is a build dependency.
|
||||
if command -v gdu > /dev/null 2>&1 && gdu --version | grep -q "GNU coreutils"; then
|
||||
GNUDU="gdu"
|
||||
else
|
||||
GNUDU="du"
|
||||
fi
|
||||
|
||||
disk_usage() {
|
||||
# shellcheck disable=SC2003,SC2307
|
||||
expr "$(${GNUDU} -sbm "$1" | cut -f1)"
|
||||
}
|
||||
|
||||
inode_usage() {
|
||||
find "$1" | wc -l
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue