Commit 23aa9781 authored by Joanne Hugé's avatar Joanne Hugé

Update compile kernel script

parent 6ecab67e
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage: $0 [-hdkms] [-l LINUX_PATH] [-o OUTPUT_STR] (-p | -u CONFIG_PATH | -c CONFIG_PATH | -n OLD_CONFIG_PATH NEW_CONFIG_PATH)" echo "Usage: $0 [-hgdkms] [-l LINUX_PATH] [-o OUTPUT_STR | -O OUTPUT_NAME] (-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 "hdkmpsu:c:nl:o:" opt; do while getopts "hgdkmpsu:c:nl:o:O:" opt; do
case "${opt}" in case "${opt}" in
h ) h )
usage usage
;; ;;
g )
update_git=1
;;
s ) s )
copy_to_sepia=1 copy_to_sepia=1
;; ;;
...@@ -52,6 +55,9 @@ while getopts "hdkmpsu:c:nl:o:" opt; do ...@@ -52,6 +55,9 @@ while getopts "hdkmpsu:c:nl:o:" opt; do
o ) o )
output_str="_${OPTARG}" output_str="_${OPTARG}"
;; ;;
O )
output_name="${OPTARG}"
;;
* ) * )
usage usage
;; ;;
...@@ -70,6 +76,10 @@ linux_path=$(readlink -m $linux_path) ...@@ -70,6 +76,10 @@ linux_path=$(readlink -m $linux_path)
export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-; export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-;
cd $linux_path; cd $linux_path;
if [ -n "$update_git" ]; then
git pull;
fi
if [ -z "$partial_compile" ]; then if [ -z "$partial_compile" ]; then
if [ -n "${new_config}" ]; then if [ -n "${new_config}" ]; then
...@@ -133,7 +143,9 @@ fi ...@@ -133,7 +143,9 @@ fi
# Compression # Compression
kernel_version=$(git describe --tags) kernel_version=$(git describe --tags)
output_name=${kernel_version}_kernel${output_str} if [ -z "$output_name" ]; then
output_name=${kernel_version}_kernel${output_str}
fi
echo "Creating output folder"; echo "Creating output folder";
mkdir -p ../$output_name; mkdir -p ../$output_name;
......
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