-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdkms-2.6.1-procconfig.patch
55 lines (53 loc) · 2.47 KB
/
dkms-2.6.1-procconfig.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- dkms-2.6.1/dkms 2018-08-10 15:04:15.002701863 +0100
+++ dkms-2.6.1/dkms.procconfig~ 2018-08-10 15:20:19.996172127 +0100
@@ -1173,13 +1173,20 @@
else
config_arch=$2
fi
- for config_type in BOOT smp enterprise secure i586-up-1GB i686-up-4GB p3-smp-64GB desktop586 desktop laptop server; do
- [ `echo "$1" | grep "$config_type"` ] && kernel_config="$kernel_source_dir/arch/$config_arch/defconfig-$config_type"
- [ ! -e "$kernel_config" ] && kernel_config=""
- done
- [ -z "$kernel_config" ] && kernel_config="$kernel_source_dir/arch/$config_arch/defconfig"
- [ ! -e "$kernel_config" ] && kernel_config=""
fi
+ if [ "$1" == `uname -r` ] && [ -e "/proc/config.gz" ]; then
+ kernel_config="/proc/config.gz"
+ elif [ -e "/boot/config-$1" ]; then
+ kernel_config="/boot/config-$1"
+ else
+ for config_type in BOOT smp enterprise secure i586-up-1GB i686-up-4GB p3-smp-64GB desktop586 desktop laptop server; do
+ [ `echo "$1" | grep "$config_type"` ] && kernel_config="$kernel_source_dir/arch/$config_arch/defconfig-$config_type"
+ [ ! -e "$kernel_config" ] && kernel_config=""
+ done
+ [ -z "$kernel_config" ] && kernel_config="$kernel_source_dir/arch/$config_arch/defconfig"
+ [ ! -e "$kernel_config" ] && kernel_config=""
+ fi
+
elif [ -e /etc/redhat-release ] || [ -e /etc/fedora-release ]; then
# Note this also applies to VMware 3.x
if [[ -z $kernel_config && -d $kernel_source_dir/configs ]]; then
@@ -1234,7 +1241,11 @@
if [[ $kernel_config ]]; then
echo $"using $kernel_config"
- cp -f "$kernel_config" .config
+ if file -b -i "$kernel_config" | grep -q "application/x-gzip"; then
+ zcat "$kernel_config" > .config
+ else
+ cp -f "$kernel_config" .config
+ fi
elif [[ -e .config ]]; then
warn $"Using $kernel_source_dir/.config" \
$"(I hope this is the correct config for this kernel)"
@@ -1260,7 +1271,11 @@
if [[ $kernel_config ]]; then
echo $"using $kernel_config"
- cp -f "$kernel_config" .config
+ if file -b -i "$kernel_config" | grep -q "application/x-gzip"; then
+ zcat "$kernel_config" > .config
+ else
+ cp -f "$kernel_config" .config
+ fi
elif [[ -e .config ]]; then
warn $"using $kernel_source_dir/.config" \
$"(I hope this is the correct config for this kernel)"