X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=contrib%2Flbuild%2Ffuncs.sh;h=22b115d4e62f7fd3808c79fb6672b1a690fc286d;hb=69cdcbe3cf732124b3b5be1a1f235aa1b78f6c85;hp=b06095d187eb1190108bba6d5732fd82df7ac29d;hpb=52aa92420fe9829603bfb98dcda31bf22d995e42;p=fs%2Flustre-release.git diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh index b06095d..22b115d 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh @@ -138,12 +138,18 @@ autodetect_distro() { "RedHatEnterpriseServer" | "ScientificSL" | "CentOS") name="rhel" ;; - "SUSE LINUX") - name="sles" - PATCHLEVEL=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release) - if [ "$PATCHLEVEL" -ne "0" ]; then - version="${version}.$PATCHLEVEL" - fi + "SUSE LINUX" | "SUSE") + name="sles" + case "$version" in + *.*) # $version already has patchlevel + ;; + *) # add patchlevel + PATCHLEVEL=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release) + if [ "$PATCHLEVEL" -ne "0" ]; then + version="${version}.$PATCHLEVEL" + fi + ;; + esac ;; "Fedora") name="fc" @@ -184,17 +190,18 @@ autodetect_target() { local target="" case ${distro} in - oel5*) target="2.6-oel5";; - rhel5*) target="2.6-rhel5";; - rhel6.6) target="2.6-rhel6.6";; - rhel6*) target="2.6-rhel6";; rhel7*) target="3.10-rhel7";; - sles10*) target="2.6-sles10";; + rhel8*) target="4.18-rhel8";; sles11.4) target="$(uname -r | cut -d . -f 1,2)-sles11sp4";; sles11.3) target="$(uname -r | cut -d . -f 1,2)-sles11sp3";; sles11*) target="$(uname -r | cut -d . -f 1,2)-sles11";; - sles12*) target="$(uname -r | cut -d . -f 1,2)-sles12";; - fc15) target="2.6-fc15";; + sles12.5) target="$(uname -r | cut -d . -f 1,2)-sles12sp5";; + sles12.4) target="$(uname -r | cut -d . -f 1,2)-sles12sp4";; + sles12.3) target="$(uname -r | cut -d . -f 1,2)-sles12sp3";; + sles12*) target="$(uname -r | cut -d . -f 1,2)-sles12";; + sles15.1) target="$(uname -r | cut -d . -f 1,2)-sles15sp1";; + sles15.2) target="$(uname -r | cut -d . -f 1,2)-sles15sp2";; + sles15.3) target="$(uname -r | cut -d . -f 1,2)-sles15sp3";; fc18) target="3.x-fc18";; *) fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";; esac