From 280a77fbb2f13fe99641f576247676d03b475c93 Mon Sep 17 00:00:00 2001 From: RAMON MARIA GOMEZ LABRADOR Date: Fri, 19 Mar 2021 13:42:08 +0100 Subject: #1033: Formatear la caché compatible con versiones 4.x y 5.x de Linux. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/engine/Cache.lib | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib index 40715946..cacba40d 100755 --- a/client/engine/Cache.lib +++ b/client/engine/Cache.lib @@ -275,7 +275,7 @@ ogDevToDisk ${PART%% *} 2>/dev/null function ogFormatCache () { # Variables locales. -local DEV MNTDIR +local DEV MNTDIR OPTIONS # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME" @@ -288,7 +288,9 @@ DEV=$(ogDiskToDev $DEV) || return $? # Formatear sistema de ficheros. ogUnmountCache 2>/dev/null -mkfs.ext4 -q -F $DEV -L "CACHE" -O extent,large_file 2>/dev/null || ogRaiseError $OG_ERR_PARTITION "CACHE" || return $? +OPTIONS="extent,large_file" +[[ $(uname -r) =~ ^5 ]] && OPTIONS+=",uninit_bg,^metadata_csum,^64bit" +mkfs.ext4 -q -F $DEV -L "CACHE" -O "$OPTIONS" 2>/dev/null || ogRaiseError $OG_ERR_PARTITION "CACHE" || return $? # Crear estructura básica. MNTDIR=$(ogMountCache) -- cgit v1.2.3-18-g5258