View | Details | Raw Unified | Return to bug 22271
Collapse All | Expand All

(-)update_kernel_modules_cetus.sh.orig (-4 / +33 lines)
Lines 28-34 Link Here
28
        cat <<EOF
28
        cat <<EOF
29
Usage: $PROG [options]
29
Usage: $PROG [options]
30
Valid options are:
30
Valid options are:
31
	-f, --force	force kernel upgrade
31
	-a, --all	install all kernel modules
32
	-i		interactive modules install, exclude force install
33
	-f, --force	force kernel upgrade, non-interactively
32
	-t, --type	install kernel with specified flavour (ovz-smp, std-def, etc)
34
	-t, --type	install kernel with specified flavour (ovz-smp, std-def, etc)
33
	-r, --release	install kernel with specified release (alt10, alt22, etc)
35
	-r, --release	install kernel with specified release (alt10, alt22, etc)
34
	-h, --help	show this text and exit
36
	-h, --help	show this text and exit
Lines 37-50 Link Here
37
}
39
}
38
40
39
#parse command line options
41
#parse command line options
40
TEMP=`getopt -n $PROG -o f,t:,r:,h -l force,type:,release:,help -- "$@"` || show_help
42
TEMP=`getopt -n $PROG -o a,i,f,t:,r:,h -l all,force,type:,release:,help -- "$@"` || show_help
41
eval set -- "$TEMP"
43
eval set -- "$TEMP"
42
44
43
while :; do
45
while :; do
44
        case "$1" in
46
        case "$1" in
45
                --) shift; break
47
                --) shift; break
46
                        ;;
48
                        ;;
47
                -f|--force) force=1
49
                -a|--all) all=1
50
            		;;
51
                -i) interactive=1 ; force=0
52
                        ;;
53
                -f|--force) force=1 ; interactive=0
48
                        ;;
54
                        ;;
49
		-t|--type) shift ; kernel_flavour="$1"
55
		-t|--type) shift ; kernel_flavour="$1"
50
			;;
56
			;;
Lines 129-139 Link Here
129
# get list of all available modules
135
# get list of all available modules
130
ALLMODULES="$(apt-cache pkgnames kernel-modules | grep $kernel_flavour | sed -e "s,^kernel-modules-\(.*\)-$kernel_flavour.*,\1,g"| sed -e "s,-[[:digit:]]\.[[:digit:]]\.[[:digit:]].*,,g" | sort -u)"
136
ALLMODULES="$(apt-cache pkgnames kernel-modules | grep $kernel_flavour | sed -e "s,^kernel-modules-\(.*\)-$kernel_flavour.*,\1,g"| sed -e "s,-[[:digit:]]\.[[:digit:]]\.[[:digit:]].*,,g" | sort -u)"
131
137
138
function module_install() {
139
    module=$1
140
#    interactive=$2
141
    if [ "$interactive" == 1 ]; then
142
	echo -n "Try to install or update module $module [y]/n? "
143
	read
144
	case "$REPLY" in
145
		n|no|N|No|NO|0) return 0
146
			;;
147
		*)
148
			;;
149
	esac
150
    fi
151
    $SUDO apt-get install -y "$module"
152
}
153
132
for module in $ALLMODULES; do
154
for module in $ALLMODULES; do
133
	module_pkgname=kernel-modules-$module
155
	module_pkgname=kernel-modules-$module
134
	if rpm -q $module_pkgname-"$modules_kernel_flavour" &>/dev/null; then
156
	if rpm -q $module_pkgname-"$modules_kernel_flavour" &>/dev/null; then
135
		message "$module_pkgname is installed, trying to update..."
157
		message "$module_pkgname is installed, trying to update..."
136
		$SUDO apt-get install -y "$module_pkgname-$newkernel_ver_flav_rel"
158
		module_install "$module_pkgname-$newkernel_ver_flav_rel" $interactive
159
#		$SUDO apt-get install -y "$module_pkgname-$newkernel_ver_flav_rel"
160
	else
161
		if [ $all == 1 ]; then
162
			message "$module_pkgname is not istalled, trying to install..."
163
			module_install "$module_pkgname-$newkernel_ver_flav_rel" $interactive
164
#			$SUDO apt-get install -y "$module_pkgname-$newkernel_ver_flav_rel"
165
		fi
137
	fi
166
	fi
138
done
167
done
139
168

Return to bug 22271