From 6ae7ef48d0237615afda2ad04368f17c9019ff17 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Tue, 5 May 2020 16:07:01 +0200 Subject: [PATCH] Added --rc option --- pkgkernel-auto.sh | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/pkgkernel-auto.sh b/pkgkernel-auto.sh index 50e398c..567f3ad 100755 --- a/pkgkernel-auto.sh +++ b/pkgkernel-auto.sh @@ -8,9 +8,9 @@ DEFAULT='\033[0m' # Defaults values PREFIX='linux-' EXTENSION='.tar.xz' +MAINLINE=1 SHOW_MENU_CONFIG=0 - # Function to script script if step fail isPreviousStepOk () { if [ $? -ne 0 ]; then @@ -27,7 +27,8 @@ while [ $# -gt 0 ]; do printf "* pkgkernel-auto: Usage\n" printf "* --menu: show kernel menu\n" printf "* --archive : Use local kernel archive\n" - printf "* --extension : if not a archive extension is not tar.xz (tar.xz or tar.gz))\n" + printf "* --extension : if not a archive extension is not tar.xz (tar.xz or tar.gz)\n" + printf "* --rc: Get RC version instead of mainline\n" printf "****************************************************************************************************\n" printf "Example with RC kernel: \n" printf "pkgkernel-auto.sh --archive /home/dbroqua/Downloads/linux-5.7-rc4.tar.gz --extension tar.gz \n" @@ -41,6 +42,9 @@ while [ $# -gt 0 ]; do ARCHIVE=$2 shift ;; + --rc) + MAINLINE=0 + ;; --extension) EXTENSION=$2 shift @@ -58,15 +62,29 @@ if [ "${ARCHIVE}" != "" ] ; then FILE=`basename "$ARCHIVE"` KERNEL=`echo ${FILE}|sed 's/linux-//'|sed "s/\.${EXTENSION}//"` else - # Get last kernel version - INFO=`curl -Ls https://www.kernel.org/ | perl -lne 'BEGIN{$/=""} print "$1 $2" if \ - /latest_link.*?(.*?)(.*?)