epm-kernel_update 1.27 KB
Newer Older
1 2
#!/bin/sh
#
3 4
# Copyright (C) 2013, 2016  Etersoft
# Copyright (C) 2013, 2016  Vitaly Lipatov <lav@etersoft.ru>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

epm_kernel_update()
{
Vitaly Lipatov's avatar
Vitaly Lipatov committed
22
	info "Starting update system kernel to the latest version"
23 24 25

	case $DISTRNAME in
	ALTLinux)
26 27 28 29 30
		load_helper epm-query_package
		if ! __epm_query_package kernel-image >/dev/null ; then
			info "No installed kernel packages, skipping update"
			return
		fi
31
		assure_exists update-kernel update-kernel 0.9.9
32
		sudocmd update-kernel $pkg_filenames || return
33
		docmd epm remove-old-kernels $pkg_filenames || fatal
34 35 36 37 38
		return ;;
	esac

	case $PMTYPE in
	*)
39
		fatal "Have no suitable command for $PMTYPE"
40 41 42
		;;
	esac
}