2018-05-15 09:09:20 +08:00
|
|
|
|
|
|
|
OUT_DIR ?= .
|
|
|
|
|
2018-06-07 23:04:02 +08:00
|
|
|
CFLAGS := -Wall
|
|
|
|
CFLAGS += -I../../devicemodel/include
|
2018-06-23 00:08:59 +08:00
|
|
|
CFLAGS += -I../../devicemodel/include/public
|
2018-06-21 23:31:46 +08:00
|
|
|
CFLAGS += -I../../hypervisor/include
|
|
|
|
|
2018-06-07 23:04:02 +08:00
|
|
|
ifeq ($(RELEASE),0)
|
|
|
|
CFLAGS += -g -DMNGR_DEBUG
|
|
|
|
endif
|
|
|
|
|
2018-06-13 15:54:22 +08:00
|
|
|
LDFLAGS := -L$(OUT_DIR)
|
2018-06-07 23:04:02 +08:00
|
|
|
LDFLAGS += -lacrn-mngr
|
|
|
|
LDFLAGS += -lpthread
|
|
|
|
|
2018-06-01 16:32:07 +08:00
|
|
|
.PHONY: all
|
2018-06-21 23:31:46 +08:00
|
|
|
all: $(OUT_DIR)/libacrn-mngr.a $(OUT_DIR)/acrn_mngr.h $(OUT_DIR)/acrnctl $(OUT_DIR)/acrnd
|
2018-05-29 23:44:30 +08:00
|
|
|
|
|
|
|
$(OUT_DIR)/libacrn-mngr.a: acrn_mngr.c acrn_mngr.h
|
2018-06-07 23:04:02 +08:00
|
|
|
$(CC) $(CFLAGS) -c acrn_mngr.c -o $(OUT_DIR)/acrn_mngr.o
|
2018-06-01 16:32:07 +08:00
|
|
|
ar -cr $@ $(OUT_DIR)/acrn_mngr.o
|
2018-06-07 23:04:02 +08:00
|
|
|
|
|
|
|
ifneq ($(OUT_DIR),.)
|
|
|
|
$(OUT_DIR)/acrn_mngr.h:
|
2018-05-30 02:16:56 +08:00
|
|
|
cp ./acrn_mngr.h $(OUT_DIR)/
|
2018-06-07 23:04:02 +08:00
|
|
|
endif
|
2018-05-29 23:44:30 +08:00
|
|
|
|
2018-06-07 23:04:02 +08:00
|
|
|
$(OUT_DIR)/acrnctl: acrnctl.c acrn_mngr.h $(OUT_DIR)/libacrn-mngr.a
|
|
|
|
$(CC) -o $(OUT_DIR)/acrnctl acrnctl.c acrn_vm_ops.c $(CFLAGS) $(LDFLAGS)
|
DM:tools: add acrnctl tool
The acrnctl can help user to create, delete, launch and stop UOSs,
To see what it can do, just run:
# acrnctl
or
# acrnctl help
you may see:
support:
list
start
stop
del
add
Use acrnctl [cmd] help for details
There are examples:
(1) add a VM
Each time you can just add one VM. Suppose you have an UOS
launch script, such as launch_UOS.sh
you can run:
# acrnctl add launch_UOS.sh -U 1
vm1-14:59:30 added
Note that, launch script shoud be able to launch ONE UOS. If
it fail, it is better to print some error logs, to tell user
the reason, so that he knows how to solve it.
The vmname is important, the acrnctl searchs VMs by their
names. so duplicated VM names are not allowed. Beside, if the
launch script changes VM name at launch time, acrnctl will
not recgonize it.
(2) delete VMs
# acrnctl del vm1-14:59:30
(3) show VMs
# acrnctl list
vm1-14:59:30 untracked
vm-yocto stop
vm-android stop
(4) start VM
you can start a vm with 'stop' status, each time can start
one VM.
# acrnctl start vm-yocto
(5) stop VM
you can stop VMs, if their status is not 'stop'
# acrnctl stop vm-yocto vm1-14:59:30 vm-android
Acked-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Zhao, Yakui <yakui.zhao@intel.com>
Signed-off-by: Tao, Yuhong <yuhong.tao@intel.com>
2018-04-03 21:43:00 +08:00
|
|
|
|
2018-06-21 23:31:46 +08:00
|
|
|
$(OUT_DIR)/acrnd: acrnd.c $(OUT_DIR)/libacrn-mngr.a
|
|
|
|
$(CC) -o $(OUT_DIR)/acrnd acrnd.c acrn_vm_ops.c $(CFLAGS) $(LDFLAGS)
|
|
|
|
ifneq ($(OUT_DIR),.)
|
|
|
|
cp ./acrnd.service $(OUT_DIR)/acrnd.service
|
|
|
|
endif
|
|
|
|
|
2018-06-01 16:32:07 +08:00
|
|
|
.PHONY: clean
|
DM:tools: add acrnctl tool
The acrnctl can help user to create, delete, launch and stop UOSs,
To see what it can do, just run:
# acrnctl
or
# acrnctl help
you may see:
support:
list
start
stop
del
add
Use acrnctl [cmd] help for details
There are examples:
(1) add a VM
Each time you can just add one VM. Suppose you have an UOS
launch script, such as launch_UOS.sh
you can run:
# acrnctl add launch_UOS.sh -U 1
vm1-14:59:30 added
Note that, launch script shoud be able to launch ONE UOS. If
it fail, it is better to print some error logs, to tell user
the reason, so that he knows how to solve it.
The vmname is important, the acrnctl searchs VMs by their
names. so duplicated VM names are not allowed. Beside, if the
launch script changes VM name at launch time, acrnctl will
not recgonize it.
(2) delete VMs
# acrnctl del vm1-14:59:30
(3) show VMs
# acrnctl list
vm1-14:59:30 untracked
vm-yocto stop
vm-android stop
(4) start VM
you can start a vm with 'stop' status, each time can start
one VM.
# acrnctl start vm-yocto
(5) stop VM
you can stop VMs, if their status is not 'stop'
# acrnctl stop vm-yocto vm1-14:59:30 vm-android
Acked-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Zhao, Yakui <yakui.zhao@intel.com>
Signed-off-by: Tao, Yuhong <yuhong.tao@intel.com>
2018-04-03 21:43:00 +08:00
|
|
|
clean:
|
2018-05-17 03:21:45 +08:00
|
|
|
rm -f $(OUT_DIR)/acrnctl
|
2018-06-01 16:32:07 +08:00
|
|
|
rm -f $(OUT_DIR)/acrn_mngr.o
|
2018-05-29 23:44:30 +08:00
|
|
|
rm -f $(OUT_DIR)/libacrn-mngr.a
|
2018-06-07 23:04:02 +08:00
|
|
|
ifneq ($(OUT_DIR),.)
|
2018-06-04 15:57:25 +08:00
|
|
|
rm -f $(OUT_DIR)/acrn_mngr.h
|
2018-06-21 23:31:46 +08:00
|
|
|
rm -f $(OUT_DIR)/acrnd.service
|
2018-06-07 23:04:02 +08:00
|
|
|
endif
|
2018-06-21 23:31:46 +08:00
|
|
|
rm -f $(OUT_DIR)/acrnd
|
2018-05-17 03:21:45 +08:00
|
|
|
|
2018-06-01 16:32:07 +08:00
|
|
|
.PHONY: install
|
2018-05-17 03:21:45 +08:00
|
|
|
install: $(OUT_DIR)/acrnctl
|
|
|
|
install -d $(DESTDIR)/usr/bin
|
2018-06-21 23:31:46 +08:00
|
|
|
install -d $(DESTDIR)/usr/lib/systemd/system
|
2018-05-17 03:21:45 +08:00
|
|
|
install -t $(DESTDIR)/usr/bin $(OUT_DIR)/acrnctl
|
2018-06-21 23:31:46 +08:00
|
|
|
install -t $(DESTDIR)/usr/bin $(OUT_DIR)/acrnd
|
|
|
|
install -p -D -m 0644 $(OUT_DIR)/acrnd.service $(DESTDIR)/usr/lib/systemd/system
|