-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables
executable file
·54 lines (41 loc) · 1.43 KB
/
variables
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
#!/usr/bin/env bash
# shellcheck disable=SC2034
# SPDX-License-Identifier: MIT
# Copyright (C) 2023 Utsav Balar
# Copyright (C) 2023 Vicharak Computers LLP
# Date for boot image
DATE=$(date +"%d.%m.%y")
export DATE
# Kernel directory path
export KERNEL_DIR="${SCRIPT_DIR}"/..
# Kernel out directory path
export OUT_DIR=${KERNEL_DIR}/out
# Set boot image name
export FILENAME="${OUT_DIR}/boot-${DATE}.img"
# Set default extlinux config
export EXTLINUX_CONF="${KERNEL_DIR}/extlinux/vicharak.conf"
# Get kernel version
function get_kernel_version() {
if [ -f "${OUT_DIR}"/include/config/kernel.release ]; then
KERNEL_VERSION=$(cat "${OUT_DIR}"/include/config/kernel.release 2>/dev/null)
else
local version patchlevel sublevel
version=$(grep -w "VERSION =" "${SCRIPT_DIR}"/../Makefile | awk '{print $3}')
patchlevel=$(grep -w "PATCHLEVEL =" "${SCRIPT_DIR}"/../Makefile | awk '{print $3}')
sublevel=$(grep -w "SUBLEVEL =" "${SCRIPT_DIR}"/../Makefile | awk '{print $3}')
KERNEL_VERSION="${version}.${patchlevel}.${sublevel}"
fi
echo "${KERNEL_VERSION}"
}
# Kernel version
KERNEL_VERSION=$(get_kernel_version)
export KERNEL_VERSION
# Default Clang toolchain directory
export CLANG_DIR=${KERNEL_DIR}/../clang
# Default Clang version
export DEFAULT_CLANG_VERSION=12
# Default GCC toolchain directory
export GCC64_DIR=${KERNEL_DIR}/../gcc-"${DEVICE_ARCH}"
export GCC32_DIR=${KERNEL_DIR}/../gcc32
# set PS3 prompt
export PS3="Select device: "