Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
25c34527
Commit
25c34527
authored
Aug 03, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update compile-kernel script
parent
126217da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
37 deletions
+44
-37
img-kernel-utils/scripts/vm-scripts/compile-kernel
img-kernel-utils/scripts/vm-scripts/compile-kernel
+44
-37
No files found.
img-kernel-utils/scripts/vm-scripts/compile-kernel
View file @
25c34527
#!/bin/bash
#!/bin/bash
usage
()
{
usage
()
{
echo
"Usage:
$0
[-hdkms] [-l LINUX_PATH] [-o OUTPUT_STR] (-u CONFIG_PATH | -c CONFIG_PATH | -n OLD_CONFIG_PATH NEW_CONFIG_PATH)"
echo
"Usage:
$0
[-hdkms] [-l LINUX_PATH] [-o OUTPUT_STR] (-
p | -
u CONFIG_PATH | -c CONFIG_PATH | -n OLD_CONFIG_PATH NEW_CONFIG_PATH)"
exit
1
;
exit
1
;
}
}
linux_path
=
$HOME
/linux
linux_path
=
$HOME
/linux
output_str
=
""
output_str
=
""
while
getopts
"hdkmsu:c:nl:o:"
opt
;
do
while
getopts
"hdkm
p
su:c:nl:o:"
opt
;
do
case
"
${
opt
}
"
in
case
"
${
opt
}
"
in
h
)
h
)
usage
usage
...
@@ -28,6 +28,10 @@ while getopts "hdkmsu:c:nl:o:" opt; do
...
@@ -28,6 +28,10 @@ while getopts "hdkmsu:c:nl:o:" opt; do
compile_modules
=
1
compile_modules
=
1
install_opts+
=
"-m "
install_opts+
=
"-m "
;;
;;
p
)
partial_compile
=
1
config_set
=
1
;;
n
)
n
)
new_config
=
1
new_config
=
1
config_set
=
1
config_set
=
1
...
@@ -63,43 +67,45 @@ fi
...
@@ -63,43 +67,45 @@ fi
# Setup
# Setup
linux_path
=
$(
readlink
-m
$linux_path
)
linux_path
=
$(
readlink
-m
$linux_path
)
if
[
-n
"
${
new_config
}
"
]
;
then
if
[
"$#"
-ne
2
]
;
then
usage
fi
old_config_path
=
$(
readlink
-m
$1
)
new_config_path
=
$(
readlink
-m
$2
)
fi
export
ARCH
=
arm
;
export
CROSS_COMPILE
=
arm-linux-gnueabihf-
;
export
ARCH
=
arm
;
export
CROSS_COMPILE
=
arm-linux-gnueabihf-
;
cd
$linux_path
;
cd
$linux_path
;
# Kernel configuration
if
[
-z
"
$partial_compile
"
]
;
then
if
[
-n
"
${
new_config
}
"
]
;
then
if
[
-n
"
${
new_config
}
"
]
;
then
if
[
"$#"
-ne
2
]
;
then
make mrproper
;
usage
cp
$old_config_path
$linux_path
/.config
;
fi
make olddefconfig
;
old_config_path
=
$(
readlink
-m
$1
)
make menuconfig
;
new_config_path
=
$(
readlink
-m
$2
)
cp
$linux_path
/.config
$new_config_path
fi
elif
[
-n
"
${
update_config
}
"
]
;
then
# Kernel configuration
make mrproper
;
if
[
-n
"
${
new_config
}
"
]
;
then
cp
$config_path
${
config_path
}
_old
;
cp
$config_path
$linux_path
/.config
;
make mrproper
;
make olddefconfig
;
cp
$old_config_path
$linux_path
/.config
;
make menuconfig
;
make olddefconfig
;
cp
$linux_path
/.config
$config_path
make menuconfig
;
cp
$linux_path
/.config
$new_config_path
else
elif
[
-n
"
${
update_config
}
"
]
;
then
make mrproper
;
cp
$config_path
$linux_path
/.config
;
make mrproper
;
make olddefconfig
;
cp
$config_path
${
config_path
}
_old
;
cp
$config_path
$linux_path
/.config
;
make olddefconfig
;
make menuconfig
;
cp
$linux_path
/.config
$config_path
else
make mrproper
;
cp
$config_path
$linux_path
/.config
;
make olddefconfig
;
fi
fi
fi
# Compilation
# Compilation
...
@@ -162,5 +168,6 @@ echo "Archive saved to $output_name.tar.gz"
...
@@ -162,5 +168,6 @@ echo "Archive saved to $output_name.tar.gz"
if
[
-n
"
$copy_to_sepia
"
]
;
then
if
[
-n
"
$copy_to_sepia
"
]
;
then
echo
"Copying to sepia..."
;
echo
"Copying to sepia..."
;
scp
$output_name
.tar.gz sepia:Documents/tsn-internship/img-kernel-utils/custom-kernels
;
scp
$output_name
.tar.gz sepia:Documents/tsn-internship/tsn-rt-measures/img-kernel-utils/custom-kernels
;
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment