-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdefconfig.sh
executable file
·51 lines (43 loc) · 1.22 KB
/
defconfig.sh
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
#!/usr/bin/env sh
set -e
# run kernel menuconfig in container, using `rockchip_linux_defconfig` from the
# current working directory as a starting point if present (stock radxa config
# otherwise)
#
# output will overwrite `rockchip_linux_defconfig` in current working directory
self=$(
self=${0}
while [ -L "${self}" ]
do
cd "${self%/*}"
self=$(readlink "${self}")
done
cd "${self%/*}"
echo "$(pwd -P)/${self##*/}"
)
if [ -f rockchip_linux_defconfig ]; then
>&2 echo "This will overwrite rockchip_linux_defconfig in $(pwd)"
while true; do
read -p "Continue (y/N)? " choice
case "$choice" in
y|Y ) break;;
n|N|'' ) exit 1;;
* ) ;;
esac
done
DEFCONFIG="$(pwd)"
export DEFCONFIG
fi
docker rm -f rock5-kernel-config >/dev/null 2>&1 || true
# shellcheck disable=SC2086
(cd "$(dirname "${self}")" && docker buildx bake \
--pull \
--load \
kernel-config)
docker run -it \
--name rock5-kernel-config \
-w /rk3588-sdk/kernel \
milas/rock5-toolchain:kernel-config \
sh -c 'make menuconfig && make savedefconfig'
docker cp rock5-kernel-config:/rk3588-sdk/kernel/defconfig rockchip_linux_defconfig
docker rm -f rock5-kernel-config >/dev/null 2>&1 || true