Commit ce8a18b2 authored by Natanael Copa's avatar Natanael Copa

setup-apkcache: suggest /var/cache/apk as cache dir when not tmpfs root

parent 631c3616
......@@ -74,6 +74,13 @@ is_mounted_ro() {
return 1
}
# get the fstype of the given mount point
mount_fstype() {
# we only want the last mount in case there are several
awk -v mnt="$1" '$2 == "/" {fstype = mnt} END {print fstype}' \
/proc/mounts
}
apk_cache_help() {
cat <<__EOF__
......@@ -110,6 +117,10 @@ if [ -z "$suggestion" ] && [ -L /dev/usbdisk ]; then
suggestion=/media/usb/cache
fi
if [ -z "$suggestion" ] && [ "$(mount_fstype /)" != "tmpfs" ]; then
suggestion=/var/cache/apk
fi
if [ -z "$suggestion" ]; then
suggestion=none
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment