-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrudeploy.sh
More file actions
executable file
·74 lines (57 loc) · 1.69 KB
/
Copy pathrudeploy.sh
File metadata and controls
executable file
·74 lines (57 loc) · 1.69 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
#!/bin/bash
# This script using for deploying source files into linufs DIR.
LINUFS="/root/linufs"
VERSION=4
PATCHLEVEL=14
SUBLEVEL=2
RAMUFS_C="ramufs.c"
RAMUFS_H="ramufs.h"
RUFSLIB_C="rufslib.c"
UFS_KCONFIG="ufs_Kconfig"
UFS_MAKEFILE="ufs_Makefile"
_CONFIG="_config"
PATH_UFS=${LINUFS}"/drivers/scsi/ufs/"
HELP="Usage: rudeploy [run]|[check]"
if [ $# -eq 0 ] || [ $# -gt 1 ] || [ "$1" = "help" ] ; then
echo ${HELP}
exit 1
fi
function check() {
if [ ! -d $LINUFS ] ; then
echo "Linux source DIR ["${LINUFS}"] NOT found!"
exit 0
fi
L_VERSION=`sed -n 2p ${LINUFS}"/Makefile" | sed "s/[^0-9]//g"`
L_PATCHLEVEL=`sed -n 3p ${LINUFS}"/Makefile" | sed "s/[^0-9]//g"`
L_SUBLEVEL=`sed -n 4p ${LINUFS}"/Makefile" | sed "s/[^0-9]//g"`
echo "Current version: ${VERSION}.${PATCHLEVEL}.${SUBLEVEL}"
echo "Target Linux version: ${L_VERSION}.${L_PATCHLEVEL}.${L_SUBLEVEL}"
if [ $L_VERSION -ne $VERSION ] || [ $L_PATCHLEVEL -ne $PATCHLEVEL ] || [ $L_SUBLEVEL -ne $SUBLEVEL ] ; then
echo "EXIT ERROR: Linux version unmatched"
exit 0
else
echo "Linux version matched"
fi
}
if [ $1 = "check" ] ; then
check
exit 0
fi
function deploy() {
echo "copy $1 to $2"
cp $1 $2
}
if [ $1 = "run" ] ; then
check
deploy ${RAMUFS_C} ${PATH_UFS}${RAMUFS_C}
deploy ${RAMUFS_H} ${PATH_UFS}${RAMUFS_H}
deploy ${RUFSLIB_C} ${PATH_UFS}${RUFSLIB_C}
deploy ${UFS_KCONFIG} ${PATH_UFS}"Kconfig"
deploy ${UFS_MAKEFILE} ${PATH_UFS}"Makefile"
echo "Rename .config as .config_bak"
mv ${LINUFS}"/.config" ${LINUFS}"/.config_bak"
deploy ${_CONFIG} ${LINUFS}"/.config"
echo "Completed!"
exit 0
fi
echo ${HELP}