forked from djkabutar/rk3399_kernel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev-shell
executable file
·45 lines (41 loc) · 930 Bytes
/
dev-shell
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
#!/bin/bash
CURDIR="$PWD"
case $(uname -s) in
Darwin)
exec docker run \
--rm \
-it \
-e HOME -v "${HOME}:${HOME}" \
-e USER \
-u "$(id -u):$(id -g)" \
--privileged \
-h rock64-build-env \
-v "${CURDIR}:${CURDIR}" \
-w "${CURDIR}" \
ayufan/rock64-dockerfiles:x86_64 \
"$@"
;;
Linux)
exec docker run \
--rm \
-it \
-e HOME -v "${HOME}:${HOME}" \
-e USER \
-u "$(id -u):$(id -g)" \
$(id -Gz | xargs -0 -n1 -I{} echo "--group-add={}") \
-v /etc/passwd:/etc/passwd:ro \
-v /dev/bus/usb:/dev/bus/usb \
-v "${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}" \
-e SSH_AUTH_SOCK \
--privileged \
-h rock64-build-env \
-v "${CURDIR}:${CURDIR}" \
-w "${CURDIR}" \
ayufan/rock64-dockerfiles:x86_64 \
"$@"
;;
*)
echo "Not supported: $(uname -s)"
exit 1
;;
esac