From 7bf6d65fccb92a509ce93595e5de2e2dc675cd6b Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Thu, 4 Sep 2008 12:55:05 +0200 Subject: [PATCH] Added check for grsec kernel version. --- src/actions/main.queue | 1 + src/functions.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/actions/main.queue b/src/actions/main.queue index 7e8ae18..0335654 100644 --- a/src/actions/main.queue +++ b/src/actions/main.queue @@ -2,6 +2,7 @@ true first_warning true check_apache_version true check_upgrade +true check_grsec_kernel pkg xlibs remove_x true remove_bloat true apt_listchanges disable diff --git a/src/functions.sh b/src/functions.sh index cbb7d61..fc5e65d 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -340,6 +340,32 @@ Nakon toga ponovno pozovite ovu skriptu." fi } +# if grsec is installed make sure it is fresh +check_grsec_kernel () { + local ver=`uname -r` + + log "Kernel version: $ver" + if [ "$ver" = "${ver%-grsec}" ]; then + # not grsec variant + return 0 + fi + + if [ "$ver" = "${ver#2.6.2[2-9]}" ]; then + # kernel too old + notice " +Prije prelaska na Debian Etch potrebno je napraviti nadogradnju na najnoviji grsec kernel. + +Pokrenite: + # apt-get update + # apt-get install kernel-2.6-cn + # reboot + +Nakon toga ponovno pozovite ovu skriptu." + log "carnet-upgrade aborted, kernel upgrade needed." + exit 1 + fi +} + upgrade () { local i to_install packages case "$1" in -- 1.7.10.4