-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathkernel-minor-version-bump
More file actions
executable file
·93 lines (77 loc) · 2.28 KB
/
Copy pathkernel-minor-version-bump
File metadata and controls
executable file
·93 lines (77 loc) · 2.28 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
BASE_VER="5.10."
if [ -z "$1" -o -z "$2" ]; then
echo "
Usage: $0 FROM_minor_version TO_minor_version
Example: $0 233-cip56 234-cip57
Base Version: ${BASE_VER}xxx-cipxx
Note: Can be run multiple times as needed.
"
exit 1
fi
if [ "${1//./}" != "${1}" ]; then
echo "$0: '$1' is not a single minor version"
exit 1
fi
if [ "${2//./}" != "${2}" ]; then
echo "$0: '$2' is not a single minor version"
exit 1
fi
TOOLCHAIN_CC="$(pwd)/output/host/usr/bin/x86_64-unknown-linux-gnu-gcc"
TOOLCHAIN_LD="$(pwd)/output/host/usr/bin/x86_64-unknown-linux-gnu-ld"
if [ ! -x "$TOOLCHAIN_CC" ] || [ ! -x "$TOOLCHAIN_LD" ]; then
echo "$0: Toolchain gcc/ld path not found"
exit 1
fi
error_restore_exit()
{
mv .config.save .config
exit 1
}
CONFIGS="$(ls -1 x86_64-configs/astlinux-*[.]config)"
CONFIGS="$CONFIGS runnix.config runnix-iso.config"
LINUX64_CONFIGS="$(ls -1 project/astlinux/genx86_64/linux*[.]config)"
LINUX64_CONFIGS="$LINUX64_CONFIGS $(ls -1 project/runnix/genx86_64/linux*[.]config)"
LINUX64_CONFIGS="$LINUX64_CONFIGS $(ls -1 project/runnix-iso/genx86_64/linux*[.]config)"
unset IFS
for config in $CONFIGS; do
if grep -q "linux-cip-${BASE_VER//./[.]}${1}" "$config"; then
echo "Command: sed -i \"s:linux-cip-${BASE_VER//./[.]}${1}:linux-cip-${BASE_VER}${2}:\" \"$config\""
sed -i "s:linux-cip-${BASE_VER//./[.]}${1}:linux-cip-${BASE_VER}${2}:" "$config"
fi
done
mv .config .config.save
unset IFS
for linux in $LINUX64_CONFIGS; do
case "$linux" in
*/astlinux/*) config="$(ls -1 x86_64-configs/astlinux-*[.]config | head -n1)" ;;
*/runnix/*) config="runnix.config" ;;
*/runnix-iso/*) config="runnix-iso.config" ;;
*) config="" ;;
esac
if [ -z "$config" ]; then
echo "$0: No config found for linux: $linux"
error_restore_exit
fi
echo "Kernel x86_64: $linux, Using config: $config"
cp "$config" .config
make linux-dirclean
make linux-patch
if [ $? -ne 0 ]; then
error_restore_exit
fi
(
cd output/build/linux-custom/
cp "../../../$linux" .config
ARCH=x86_64 make oldconfig CC="${TOOLCHAIN_CC}" LD="${TOOLCHAIN_LD}"
echo "========"
diff -u "../../../$linux" .config
echo "========"
cp .config "../../../$linux"
)
done
echo ""
echo "Back to Working Config..."
echo ""
mv .config.save .config
make linux-dirclean