armbian-next: tmpfs: use size=99% for all tmpfs's; (rootfs/WORKDIR/chroot); thanks Igor for suggestion

This commit is contained in:
Ricardo Pardini
2023-02-02 03:58:55 +01:00
parent 184380f01b
commit bf53bd2988
3 changed files with 7 additions and 5 deletions

View File

@@ -8,9 +8,11 @@ mount_chroot() {
target="$(realpath "$1")" # normalize, remove last slash if dir
display_alert "mount_chroot" "$target" "debug"
mkdir -p "${target}/run/user/0"
mount -t tmpfs tmpfs "${target}/tmp"
mount -t tmpfs tmpfs "${target}/var/tmp"
mount -t tmpfs tmpfs "${target}/run/user/0"
# tmpfs size=50% is the Linux default, but we need more.
mount -t tmpfs -o "size=99%" tmpfs "${target}/tmp"
mount -t tmpfs -o "size=99%" tmpfs "${target}/var/tmp"
mount -t tmpfs -o "size=99%" tmpfs "${target}/run/user/0"
mount -t proc chproc "${target}"/proc
mount -t sysfs chsys "${target}"/sys
mount -t devtmpfs chdev "${target}"/dev || mount --bind /dev "${target}"/dev

View File

@@ -33,7 +33,7 @@ function prepare_tmpfs_for() {
else
display_alert "prepare_tmpfs_for: on Linux and root, MOUNTING TMPFS" "${tmpfs_name}" "cleanup"
# mount tmpfs on it
mount -t tmpfs tmpfs "${tmpfs_path}"
mount -t tmpfs -o "size=99%" tmpfs "${tmpfs_path}" # size=50% is the Linux default, but we need more.
cleanup_params+=("umount_tmpfs")
#cleanup_params+=("no_umount_tmpfs")

View File

@@ -41,7 +41,7 @@ function prepare_rootfs_build_params_and_trap() {
if [[ $use_tmpfs == yes ]]; then
declare -g -r ROOTFS_IS_UNDER_TMPFS=yes
mount -t tmpfs tmpfs "${SDCARD}" # do not specify size; we've calculated above that it should fit, and Linux will try its best if it doesn't.
mount -t tmpfs -o "size=99%" tmpfs "${SDCARD}" # size=50% is the Linux default, but we need more.
fi
}