Commit 25c34527 authored by Joanne Hugé's avatar Joanne Hugé

Update compile-kernel script

parent 126217da
#!/bin/bash
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;
}
linux_path=$HOME/linux
output_str=""
while getopts "hdkmsu:c:nl:o:" opt; do
while getopts "hdkmpsu:c:nl:o:" opt; do
case "${opt}" in
h )
usage
......@@ -28,6 +28,10 @@ while getopts "hdkmsu:c:nl:o:" opt; do
compile_modules=1
install_opts+="-m "
;;
p )
partial_compile=1
config_set=1
;;
n )
new_config=1
config_set=1
......@@ -63,21 +67,22 @@ fi
# Setup
linux_path=$(readlink -m $linux_path)
if [ -n "${new_config}" ]; then
export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-;
cd $linux_path;
if [ -z "$partial_compile" ]; then
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-;
cd $linux_path;
fi
# Kernel configuration
# Kernel configuration
if [ -n "${new_config}" ]; then
if [ -n "${new_config}" ]; then
make mrproper;
cp $old_config_path $linux_path/.config;
......@@ -85,7 +90,7 @@ if [ -n "${new_config}" ]; then
make menuconfig;
cp $linux_path/.config $new_config_path
elif [ -n "${update_config}" ]; then
elif [ -n "${update_config}" ]; then
make mrproper;
cp $config_path ${config_path}_old;
......@@ -94,12 +99,13 @@ elif [ -n "${update_config}" ]; then
make menuconfig;
cp $linux_path/.config $config_path
else
else
make mrproper;
cp $config_path $linux_path/.config;
make olddefconfig;
fi
fi
# Compilation
......@@ -162,5 +168,6 @@ echo "Archive saved to $output_name.tar.gz"
if [ -n "$copy_to_sepia" ]; then
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment