Skip to content

Commit ebc3559

Browse files
committed
Clean dev scripts
Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 9ca8509 commit ebc3559

File tree

9 files changed

+163
-7627
lines changed

9 files changed

+163
-7627
lines changed

Makefile

+13-73
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
11
KERNEL_SRC=$(HOME)/src/linux-rdma
2-
# VMware
3-
VMWARE_VM=$(HOME)/src/vm-machines/archlinux/archlinux.vmx
4-
VMWARE_VM_REPACK=$(HOME)/src/vm-machines/archlinux/archlinux-000001.vmdk
52

63
# KVM
74
#KVM_RELEASE=wheezy
85
#KVM_RELEASE=jessie
9-
KVM_RELEASE=sid
6+
#KVM_RELEASE=sid
7+
KVM_RELEASE=testing
108
#KVM_PACKAGES=openssh-server,python,perl,vim,pciutils,ibverbs-utils,libibverbs-dev,libmlx5-dev,infiniband-diags,opensm,librdmacm-dev,rdmacm-utils
11-
KVM_PACKAGES=openssh-server,python,perl,vim,pciutils,ibverbs-utils,libibverbs-dev,libmlx5-dev,infiniband-diags,librdmacm-dev,rdmacm-utils
12-
KVM_SHARED=$(HOME)/src/kvm-shared
9+
#KVM_PACKAGES=openssh-server,python,perl,vim,pciutils,ibverbs-utils,libibverbs-dev,libmlx5-dev,infiniband-diags,librdmacm-dev,rdmacm-utils
10+
KVM_PACKAGES=openssh-server,python,perl,vim,pciutils,iproute2
11+
KVM_SHARED=$(HOME)/src
1312

1413
# SimX
1514
SIMX_BIN=$(HOME)/src/simx/x86_64-softmmu/qemu-system-x86_64
1615

17-
# LIBS
18-
LIBIBVERBS_SRC=$(HOME)/src/libibverbs/
19-
LIBMLX5_SRC=$(HOME)/src/libmlx5/
20-
21-
# Strace
22-
STRACE_SRC=$(HOME)/src/strace-code/
23-
2416
ssh:
2517
@ssh root@localhost -p4444
2618

2719
kvm:
2820
@echo "Start KVM image"
2921
@# add -s option for running gdb
3022
@# and run "ggb vmlinux"
31-
@kvm -kernel $(KERNEL_SRC)/arch/x86/boot/bzImage -drive \
23+
@qemu-system-x86_64 -enable-kvm -kernel $(KERNEL_SRC)/arch/x86/boot/bzImage -drive \
3224
file=$(HOME)/src/dev-scripts/build/$(KVM_RELEASE).img,if=virtio,format=raw \
3325
-append 'root=/dev/vda earlyprintk=serial,ttyS0,115200 console=hvc0 debug rw net.ifnames=0' \
3426
-device virtio-serial-pci -serial mon:stdio -nographic \
3527
-net nic,model=virtio,macaddr=52:54:01:12:34:56 \
36-
-net user,hostfwd=tcp:127.0.0.1:4444-:22
28+
-net user,hostfwd=tcp:127.0.0.1:4444-:22 \
29+
-virtfs local,path=$(KVM_SHARED),mount_tag=host0,security_model=passthrough,id=host0
3730

3831
simx:
3932
@echo "Start SimX image"
@@ -45,7 +38,8 @@ simx:
4538
-append 'root=/dev/vda earlyprintk=serial,ttyS0,115200 console=hvc0 debug rw net.ifnames=0' \
4639
-net nic,model=virtio \
4740
-net user,hostfwd=tcp:127.0.0.1:4444-:22 \
48-
-device e1000 -device connectx4
41+
-device e1000 -device connectx4 \
42+
-virtfs local,path=$(KVM_SHARED),mount_tag=host0,security_model=passthrough,id=host0
4943

5044
kvm-image:
5145
@echo "Build Debian $(KVM_RELEASE) image"
@@ -55,6 +49,7 @@ kvm-image:
5549
@sudo sed -i '/^root/ { s/:x:/::/ }' build/kvm-image/etc/passwd
5650
@echo 'V0:23:respawn:/sbin/getty 115200 hvc0' | sudo tee -a build/kvm-image/etc/inittab
5751
@printf '\nauto eth0\niface eth0 inet dhcp\n' | sudo tee -a build/kvm-image/etc/network/interfaces
52+
@printf '\nhost0 /mnt 9p trans=virtio,version=9p2000.L 0 0\n' | sudo tee -a build/kvm-image/etc/fstab
5853
@sudo mkdir build/kvm-image/root/.ssh/
5954
@cat ~/.ssh/id_?sa.pub | sudo tee build/kvm-image/root/.ssh/authorized_keys
6055
@dd if=/dev/zero of=build/$(KVM_RELEASE).img bs=1M seek=4095 count=1
@@ -69,66 +64,11 @@ kvm-image:
6964
clean-kvm-image:
7065
@sudo rm -rf build/$(KVM_RELEASE).img build/mnt-$(KVM_RELEASE) build/kvm-image
7166

72-
vmware-config:
73-
@cp configs/vmware-config $(KERNEL_SRC)/.config
74-
7567
kvm-config:
7668
@cp configs/kvm-config $(KERNEL_SRC)/.config
7769

78-
clean-shared:
79-
@rm -rf $(KVM_SHARED)/*
80-
81-
libs:
82-
@echo "Build libibverbs"
83-
@cd $(LIBIBVERBS_SRC)/; ./autogen.sh; ./configure --prefix=$(KVM_SHARED) CFLAGS=-I$(KVM_SHARED)/include LDFLAGS=-L$(KVM_SHARED)/lib CPPFLAGS=-I$(KVM_SHARED)/include; $(MAKE); $(MAKE) install
84-
@echo "Build libmlx5"
85-
@cd $(LIBMLX5_SRC)/; ./autogen.sh; ./configure --prefix=$(KVM_SHARED) CFLAGS=-I$(KVM_SHARED)/include LDFLAGS=-L$(KVM_SHARED)/lib CPPFLAGS=-I$(KVM_SHARED)/include; $(MAKE); $(MAKE) install
86-
87-
build:
88-
@echo "Start kernel build"
89-
@make -C $(KERNEL_SRC) oldconfig
90-
@make -C $(KERNEL_SRC) -j8
91-
92-
khi:
93-
@echo "Install kernel headers"
94-
@make -C $(KERNEL_SRC) headers_install INSTALL_HDR_PATH=$(KVM_SHARED)
95-
96-
strace:
97-
@cd $(STRACE_SRC)/; ./bootstrap; ./configure --prefix=$(KVM_SHARED) CFLAGS=-I$(KVM_SHARED)/include LDFLAGS=-L$(KVM_SHARED)/lib CPPFLAGS=-I$(KVM_SHARED)/include; $(MAKE); $(MAKE) install
98-
99-
shared: clean-shared khi strace libs
100-
101-
scp:
102-
@ssh -p4444 root@localhost "rm -rf /home/leonro/src/kvm-shared"
103-
@scp -r -P4444 /home/leonro/src/kvm-shared root@localhost:/home/leonro/src/
104-
105-
test:
106-
@ssh -p4444 root@localhost "echo function_graph > /sys/kernel/debug/tracing/current_tracer"
107-
@ssh -p4444 root@localhost "echo ib* > /sys/kernel/debug/tracing/set_ftrace_filter"
108-
@ssh -p4444 root@localhost "echo uver* >> /sys/kernel/debug/tracing/set_ftrace_filter"
109-
@ssh -p4444 root@localhost "echo "" > /sys/kernel/debug/tracing/trace"
110-
@ssh -p4444 root@localhost "ibv_devinfo"
111-
@ssh -p4444 root@localhost "cat /sys/kernel/debug/tracing/trace"
112-
113-
stop-vmware-vm:
114-
@echo "Stop VMware VM"
115-
@vmrun stop $(VMWARE_VM)
116-
117-
start-vmware-vm:
118-
@echo "Start VMware VM"
119-
@vmrun start $(VMWARE_VM)
120-
121-
update-vmware-vm:
122-
@echo "Patch boot partition"
123-
@mkdir -p build
124-
@mkdir -p build/vmware
125-
@vmware-mount $(VMWARE_VM_REPACK) build/vmware
126-
@sudo cp -v $(KERNEL_SRC)/arch/x86/boot/bzImage build/vmware/vmlinuz-linux-dev
127-
@sudo cp -v $(KERNEL_SRC)/System.map build/vmware
128-
@vmware-mount -d build/vmware
129-
@rmdir -rf build/vmware
130-
131-
vmware-vm: stop-vmware-vm update-vmware-vm start-vmware-vm
70+
off:
71+
@ssh -p4444 root@localhost "poweroff"
13272

13373
all:
13474
@echo "Do nothing!!!!!"

0 commit comments

Comments
 (0)