-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpodman
executable file
·55 lines (51 loc) · 1.08 KB
/
podman
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
55
#!/bin/bash
action=${1?-Need action (nconfig,check,build,merge)}
kver=${2:-6.1}
image=${3:-applehq/gentoo-stage4:latest}
if test -f /run/.containerenv; then
rsync -r /usr/src/kconfig /
pushd /kconfig
case "$action" in
merge|shell) ;;
*) gitargs="-X ours"
;;
esac
git merge --no-stat --allow-unrelated-histories $gitargs stable/linux-$kver.y -m "Merge linux-$kver.y"
case "$action" in
merge)
git mergetool --tool=vimdiff
;;
check)
./check
;;
*config)
make $action
make nconfig
;;
build)
./config
./build
;;
shell)
exec bash
;;
esac
else
case "$action" in
build)
container=$(podman run --detach -v ${PWD}:/usr/src/kconfig $image /usr/src/kconfig/podman "$@")
podman wait $container
podman logs --tail 10 $container
echo "$(cut -c-16 <<<$container):/kconfig/"
;;
shell|merge|*config)
podman run --rm -it -v ${PWD}:/usr/src/kconfig $image /usr/src/kconfig/podman "$@"
;;
__complete*)
compgen -W "build shell merge check allnoconfig defconfig"
;;
*)
podman run --rm -v ${PWD}:/usr/src/kconfig $image /usr/src/kconfig/podman "$@"
;;
esac
fi