forked from rosalab/linux-dev-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.31 KB
/
Makefile
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
BASE_PROJ ?= $(shell pwd)
LINUX ?= ${BASE_PROJ}/linux
SSH_PORT ?= "52222"
NET_PORT ?= "52223"
GDB_PORT ?= "1234"
.ALWAYS:
all: vmlinux
docker: .ALWAYS
docker buildx build --network=host --progress=plain -t runtime-dev .
qemu-run:
docker run --privileged --rm \
--device=/dev/kvm:/dev/kvm \
-v ${BASE_PROJ}:/linux-dev-env -v ${LINUX}:/linux \
-w /linux \
-p 127.0.0.1:${SSH_PORT}:52222 \
-p 127.0.0.1:${NET_PORT}:52223 \
-p 127.0.0.1:${GDB_PORT}:1234 \
-it runtime-dev:latest \
/linux-dev-env/q-script/yifei-q -s
# connect running qemu by ssh
qemu-ssh:
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -t [email protected] -p ${SSH_PORT}
vmlinux:
docker run --rm -v ${LINUX}:/linux -w /linux runtime-dev make -j`nproc` bzImage
headers-install:
docker run --rm -v ${LINUX}:/linux -w /linux runtime-dev make -j`nproc` headers_install
modules-install:
docker run --rm -v ${LINUX}:/linux -w /linux runtime-dev make -j`nproc` modules
docker run --rm -v ${LINUX}:/linux -w /linux runtime-dev make -j`nproc` modules_install
kernel:
docker run --rm -v ${LINUX}:/linux -w /linux runtime-dev make -j`nproc`
linux-clean:
docker run --rm -v ${LINUX}:/linux -w /linux runtime-dev make distclean
enter-docker:
docker run --rm -v ${BASE_PROJ}:/linux-dev-env -w /linux-dev-env -it runtime-dev /bin/bash