HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.

This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build

Tracked-On: #3482
Signed-off-by: Terry Zou <terry.zou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Terry Zou 2019-07-29 12:21:54 +08:00 committed by Xie, Nanlin
parent 555a03db99
commit a9c38a5cfb
119 changed files with 62 additions and 57 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@ doc/doxygen
doc/_build doc/_build
doc/tools doc/tools
doc/reference/kconfig/*.rst doc/reference/kconfig/*.rst
doc/misc
build build
*.bak *.bak
*.sav *.sav

View File

@ -16,9 +16,9 @@ RELEASE ?= 0
O ?= build O ?= build
ROOT_OUT := $(shell mkdir -p $(O);cd $(O);pwd) ROOT_OUT := $(shell mkdir -p $(O);cd $(O);pwd)
HV_OUT := $(ROOT_OUT)/hypervisor HV_OUT := $(ROOT_OUT)/hypervisor
EFI_OUT := $(ROOT_OUT)/efi-stub EFI_OUT := $(ROOT_OUT)/misc/efi-stub
DM_OUT := $(ROOT_OUT)/devicemodel DM_OUT := $(ROOT_OUT)/devicemodel
TOOLS_OUT := $(ROOT_OUT)/tools TOOLS_OUT := $(ROOT_OUT)/misc/tools
DOC_OUT := $(ROOT_OUT)/doc DOC_OUT := $(ROOT_OUT)/doc
BUILD_VERSION ?= BUILD_VERSION ?=
BUILD_TAG ?= BUILD_TAG ?=
@ -32,7 +32,7 @@ hypervisor:
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) $(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE)
ifeq ($(FIRMWARE),uefi) ifeq ($(FIRMWARE),uefi)
echo "building hypervisor as EFI executable..." echo "building hypervisor as EFI executable..."
$(MAKE) -C $(T)/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) $(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT)
endif endif
sbl-hypervisor: sbl-hypervisor:
@ -48,14 +48,14 @@ devicemodel: tools
tools: tools:
mkdir -p $(TOOLS_OUT) mkdir -p $(TOOLS_OUT)
$(MAKE) -C $(T)/tools OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE) $(MAKE) -C $(T)/misc OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE)
doc: doc:
$(MAKE) -C $(T)/doc html BUILDDIR=$(DOC_OUT) $(MAKE) -C $(T)/doc html BUILDDIR=$(DOC_OUT)
.PHONY: clean .PHONY: clean
clean: clean:
$(MAKE) -C $(T)/tools OUT_DIR=$(TOOLS_OUT) clean $(MAKE) -C $(T)/misc OUT_DIR=$(TOOLS_OUT) clean
$(MAKE) -C $(T)/doc BUILDDIR=$(DOC_OUT) clean $(MAKE) -C $(T)/doc BUILDDIR=$(DOC_OUT) clean
rm -rf $(ROOT_OUT) rm -rf $(ROOT_OUT)
@ -68,7 +68,7 @@ ifeq ($(FIRMWARE),sbl)
endif endif
ifeq ($(FIRMWARE),uefi) ifeq ($(FIRMWARE),uefi)
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) $(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE)
$(MAKE) -C $(T)/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install $(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install
endif endif
hypervisor-install-debug: hypervisor-install-debug:
@ -76,7 +76,7 @@ ifeq ($(FIRMWARE),sbl)
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install-debug $(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install-debug
endif endif
ifeq ($(FIRMWARE),uefi) ifeq ($(FIRMWARE),uefi)
$(MAKE) -C $(T)/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install-debug $(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install-debug
endif endif
sbl-hypervisor-install: sbl-hypervisor-install:
@ -91,4 +91,4 @@ devicemodel-install:
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) install $(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) install
tools-install: tools-install:
$(MAKE) -C $(T)/tools OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE) install $(MAKE) -C $(T)/misc OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE) install

View File

@ -43,7 +43,7 @@ doxy:
$(Q)find doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/' $(Q)find doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/'
content: content:
$(Q)scripts/extract_content.py . tools $(Q)scripts/extract_content.py . misc
kconfig: kconfig:
$(Q)srctree=../hypervisor \ $(Q)srctree=../hypervisor \

View File

@ -487,7 +487,7 @@ partition. Follow these steps:
<https://github.com/projectacrn/acrn-hypervisor/blob/master/efi-stub/clearlinux/acrn.conf>`__ <https://github.com/projectacrn/acrn-hypervisor/blob/master/efi-stub/clearlinux/acrn.conf>`__
as shown here: as shown here:
.. literalinclude:: ../../efi-stub/clearlinux/acrn.conf .. literalinclude:: ../../misc/efi-stub/clearlinux/acrn.conf
:caption: efi-stub/clearlinux/acrn.conf :caption: efi-stub/clearlinux/acrn.conf
On the platform, copy the ``acrn.conf`` file to the EFI partition we mounted earlier: On the platform, copy the ``acrn.conf`` file to the EFI partition we mounted earlier:

View File

@ -151,7 +151,7 @@ reason and times of each vm_exit after we have done some operations.
# acrnalyze.py -i /home/trace/acrntrace/20190219-001529/1 -o vmexit --vm_exit # acrnalyze.py -i /home/trace/acrntrace/20190219-001529/1 -o vmexit --vm_exit
.. note:: The acrnalyze.py script is in the .. note:: The acrnalyze.py script is in the
``acrn-hypervisor/tools/acrntrace/scripts`` folder. The location ``acrn-hypervisor/misc/tools/acrntrace/scripts`` folder. The location
of the trace files produced by ``acrntrace`` may be different in your system. of the trace files produced by ``acrntrace`` may be different in your system.
.. figure:: images/debug_image28.png .. figure:: images/debug_image28.png
@ -174,7 +174,7 @@ shown in the following example:
trace event id trace event id
2. Add the following format to 2. Add the following format to
``acrn-hypervisor/tools/acrntrace/scripts/formats``: ``acrn-hypervisor/misc/tools/acrntrace/scripts/formats``:
.. figure:: images/debug_image1.png .. figure:: images/debug_image1.png
:align: center :align: center
@ -224,7 +224,7 @@ shown in the following example:
formats /home/trace/acrntrace/20190219-001529/1 | grep "trace test" formats /home/trace/acrntrace/20190219-001529/1 | grep "trace test"
.. note:: The acrnalyze.py script is in the .. note:: The acrnalyze.py script is in the
``acrn-hypervisor/tools/acrntrace/scripts`` folder. The location ``acrn-hypervisor/misc/tools/acrntrace/scripts`` folder. The location
of the trace files produced by ``acrntrace`` may be different in your system. of the trace files produced by ``acrntrace`` may be different in your system.
and we will get the following log: and we will get the following log:

View File

@ -16,7 +16,7 @@ The ACRN Service OS is based on `Clear Linux OS`_ and it uses `systemd-networkd`
to set up the Service OS networking. A few files are responsible for setting up the to set up the Service OS networking. A few files are responsible for setting up the
ACRN bridge (``acrn-br0``), the TAP device (``tap0``), and how these are all ACRN bridge (``acrn-br0``), the TAP device (``tap0``), and how these are all
connected. Those files are installed in ``/usr/lib/systemd/network`` connected. Those files are installed in ``/usr/lib/systemd/network``
on the target device and can also be found under ``tools/acrnbridge`` in the source code. on the target device and can also be found under ``misc/acrnbridge`` in the source code.
Setting up the static IP address Setting up the static IP address
******************************** ********************************
@ -35,8 +35,8 @@ Modify the ``[Network]`` section in the
``/etc/systemd/network/50-eth.network`` file you just created. ``/etc/systemd/network/50-eth.network`` file you just created.
This is the content of the file used in ACRN by default. This is the content of the file used in ACRN by default.
.. literalinclude:: ../../tools/acrnbridge/eth.network .. literalinclude:: ../../misc/acrnbridge/eth.network
:caption: tools/acrnbridge/eth.network :caption: misc/acrnbridge/eth.network
:emphasize-lines: 5 :emphasize-lines: 5
Edit the file to remove the line highlighted above and add your network settings in Edit the file to remove the line highlighted above and add your network settings in

View File

@ -7,4 +7,4 @@ Tools
:glob: :glob:
:maxdepth: 1 :maxdepth: 1
../tools/** ../misc/**

View File

@ -45,7 +45,7 @@ ARCH_LDFLAGS :=
.PHONY: default .PHONY: default
default: all default: all
include $(BASEDIR)/../scripts/deps.mk include $(BASEDIR)/../misc/acrn-config/library/deps.mk
include scripts/kconfig/kconfig.mk include scripts/kconfig/kconfig.mk

View File

@ -18,7 +18,7 @@ HV_DEFCONFIG := defconfig
HV_CONFIG_H := include/config.h HV_CONFIG_H := include/config.h
HV_CONFIG_MK := include/config.mk HV_CONFIG_MK := include/config.mk
KCONFIG_DIR := $(BASEDIR)/../scripts/kconfig KCONFIG_DIR := $(BASEDIR)/../misc/acrn-config/kconfig
# Backward-compatibility for RELEASE=(0|1) # Backward-compatibility for RELEASE=(0|1)
ifdef RELEASE ifdef RELEASE

View File

@ -10,26 +10,26 @@ all: acrn-manager acrnbridge
endif endif
acrn-crashlog: acrn-crashlog:
$(MAKE) -C $(T)/acrn-crashlog OUT_DIR=$(OUT_DIR) RELEASE=$(RELEASE) $(MAKE) -C $(T)/tools/acrn-crashlog OUT_DIR=$(OUT_DIR) RELEASE=$(RELEASE)
acrnlog: acrnlog:
$(MAKE) -C $(T)/acrnlog OUT_DIR=$(OUT_DIR) $(MAKE) -C $(T)/tools/acrnlog OUT_DIR=$(OUT_DIR)
acrn-manager: acrn-manager:
$(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) RELEASE=$(RELEASE) $(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) RELEASE=$(RELEASE)
acrntrace: acrntrace:
$(MAKE) -C $(T)/acrntrace OUT_DIR=$(OUT_DIR) $(MAKE) -C $(T)/tools/acrntrace OUT_DIR=$(OUT_DIR)
acrnbridge: acrnbridge:
$(MAKE) -C $(T)/acrnbridge OUT_DIR=$(OUT_DIR) $(MAKE) -C $(T)/acrnbridge OUT_DIR=$(OUT_DIR)
.PHONY: clean .PHONY: clean
clean: clean:
$(MAKE) -C $(T)/acrn-crashlog OUT_DIR=$(OUT_DIR) clean $(MAKE) -C $(T)/tools/acrn-crashlog OUT_DIR=$(OUT_DIR) clean
$(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) clean $(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) clean
$(MAKE) -C $(T)/acrntrace OUT_DIR=$(OUT_DIR) clean $(MAKE) -C $(T)/tools/acrntrace OUT_DIR=$(OUT_DIR) clean
$(MAKE) -C $(T)/acrnlog OUT_DIR=$(OUT_DIR) clean $(MAKE) -C $(T)/tools/acrnlog OUT_DIR=$(OUT_DIR) clean
rm -rf $(OUT_DIR) rm -rf $(OUT_DIR)
.PHONY: install .PHONY: install
@ -40,16 +40,16 @@ install: acrn-manager-install acrnbridge-install
endif endif
acrn-crashlog-install: acrn-crashlog-install:
$(MAKE) -C $(T)/acrn-crashlog OUT_DIR=$(OUT_DIR) install $(MAKE) -C $(T)/tools/acrn-crashlog OUT_DIR=$(OUT_DIR) install
acrnlog-install: acrnlog-install:
$(MAKE) -C $(T)/acrnlog OUT_DIR=$(OUT_DIR) install $(MAKE) -C $(T)/tools/acrnlog OUT_DIR=$(OUT_DIR) install
acrn-manager-install: acrn-manager-install:
$(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) install $(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) install
acrntrace-install: acrntrace-install:
$(MAKE) -C $(T)/acrntrace OUT_DIR=$(OUT_DIR) install $(MAKE) -C $(T)/tools/acrntrace OUT_DIR=$(OUT_DIR) install
acrnbridge-install: acrnbridge-install:
$(MAKE) -C $(T)/acrnbridge OUT_DIR=$(OUT_DIR) install $(MAKE) -C $(T)/acrnbridge OUT_DIR=$(OUT_DIR) install

View File

@ -4,7 +4,8 @@
# This script takes a Kconfig and a defconfig file, and expands it to a .config # This script takes a Kconfig and a defconfig file, and expands it to a .config
# with all default values listed explicitly. # with all default values listed explicitly.
import sys, os import sys
import os
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson # Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
# SPDX-License-Identifier: ISC # SPDX-License-Identifier: ISC

View File

@ -4,49 +4,50 @@
# This script takes a Kconfig and a .config, and generates a C header file with # This script takes a Kconfig and a .config, and generates a C header file with
# all the configuration data defined as object-like macros. # all the configuration data defined as object-like macros.
import sys, os import sys
import os
import re
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson # Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
# SPDX-License-Identifier: ISC # SPDX-License-Identifier: ISC
# Refer to scripts/kconfig/LICENSE.kconfiglib for the permission notice. # Refer to scripts/kconfig/LICENSE.kconfiglib for the permission notice.
import kconfiglib import kconfiglib
import re
class Acrn_config(kconfiglib.Kconfig): class AcrnConfig(kconfiglib.Kconfig):
help_regex = re.compile("64-bit[\s\n]+integer") help_regex = re.compile("64-bit[\s\n]+integer")
def __init__(self, filename="Kconfig", warn=True, warn_to_stderr=True, def __init__(self, filename="Kconfig", warn=True, warn_to_stderr=True, encoding="utf-8"):
encoding="utf-8"):
kconfiglib.Kconfig.__init__(self, filename, warn, warn_to_stderr, encoding) kconfiglib.Kconfig.__init__(self, filename, warn, warn_to_stderr, encoding)
def write_autoconf(self, filename, def write_autoconf(self, filename,
header="/* Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) */\n"): header="/* Generated by Kconfiglib (https://github.com/ulfalizer/"
"Kconfiglib) */\n"):
guard_begin = "#ifndef HV_KCONFIG\n#define HV_KCONFIG\n" guard_begin = "#ifndef HV_KCONFIG\n#define HV_KCONFIG\n"
guard_end = "#endif" guard_end = "#endif"
with open(filename, "w") as f: with open(filename, "w") as f_autoconf:
f.write(header) f_autoconf.write(header)
f.write(guard_begin) f_autoconf.write(guard_begin)
for sym in self.defined_syms: for sym in self.defined_syms:
if sym.config_string in ("",None): if sym.config_string in ("", None):
continue continue
else: else:
val = sym.str_value val = sym.str_value
if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE): if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE):
if val != "n": if val != "n":
f.write("#define {}{}{} 1\n" f_autoconf.write("#define {}{}{} 1\n"
.format(self.config_prefix, sym.name, .format(self.config_prefix, sym.name,
"_MODULE" if val == "m" else "")) "_MODULE" if val == "m" else ""))
elif sym.orig_type == kconfiglib.STRING: elif sym.orig_type == kconfiglib.STRING:
f.write('#define {}{} "{}"\n' f_autoconf.write('#define {}{} "{}"\n'
.format(self.config_prefix, sym.name, .format(self.config_prefix, sym.name,
kconfiglib.escape(val))) kconfiglib.escape(val)))
elif sym.orig_type in (kconfiglib.INT, kconfiglib.HEX): elif sym.orig_type in (kconfiglib.INT, kconfiglib.HEX):
if sym.orig_type == kconfiglib.HEX: if sym.orig_type == kconfiglib.HEX:
val = val + "U" val = val + "U"
if not val.startswith(("0x", "0X")): if not val.startswith(("0x", "0X")):
val = "0x" + val val = "0x" + val
elif sym.orig_type == kconfiglib.INT and len(sym.ranges) > 0: elif sym.orig_type == kconfiglib.INT and len(sym.ranges) > 0:
left_sym = sym.ranges[0][0] left_sym = sym.ranges[0][0]
right_sym = sym.ranges[0][1] right_sym = sym.ranges[0][1]
@ -56,16 +57,16 @@ class Acrn_config(kconfiglib.Kconfig):
val = val + "U" val = val + "U"
_help = sym.nodes[0].help _help = sym.nodes[0].help
if _help not in (None,"") and len(self.help_regex.findall(_help)) > 0: if _help not in (None, "") and len(self.help_regex.findall(_help)) > 0:
val = val + "L" val = val + "L"
f.write("#define {}{} {}\n" f_autoconf.write("#define {}{} {}\n"
.format(self.config_prefix, sym.name, val)) .format(self.config_prefix, sym.name, val))
else: else:
raise Exception("Internal error while creating C " raise Exception(
'header: unknown type "{}".' 'Internal error while creating C header: unknown type "{}".' \
.format(sym.orig_type)) .format(sym.orig_type))
f.write(guard_end) f_autoconf.write(guard_end)
def usage(): def usage():
@ -87,9 +88,9 @@ def main():
sys.stderr.write("Cannot find file %s\n" % config_path) sys.stderr.write("Cannot find file %s\n" % config_path)
sys.exit(1) sys.exit(1)
kconfig = Acrn_config(kconfig_path) kconfig = AcrnConfig(kconfig_path)
kconfig.load_config(config_path) kconfig.load_config(config_path)
kconfig.write_autoconf(sys.argv[3],header) kconfig.write_autoconf(sys.argv[3], header)
sys.stdout.write("Configuration header written to %s.\n" % sys.argv[3]) sys.stdout.write("Configuration header written to %s.\n" % sys.argv[3])
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -5,7 +5,8 @@
# having the default values. The minimized config can act as a defconfig for # having the default values. The minimized config can act as a defconfig for
# future use. # future use.
import sys, os import sys
import os
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson # Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
# SPDX-License-Identifier: ISC # SPDX-License-Identifier: ISC

View File

@ -9,7 +9,8 @@
# 3. reconstruct .config with the given list of symbol-value pairs if there # 3. reconstruct .config with the given list of symbol-value pairs if there
# is any disagreement. # is any disagreement.
import sys, os import sys
import os
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson # Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
# SPDX-License-Identifier: ISC # SPDX-License-Identifier: ISC

View File

@ -59,10 +59,10 @@ LDSCRIPT := $(GNUEFI_DIR)/elf_$(ARCH)_efi.lds
INCDIR := $(SYSROOT)/usr/include INCDIR := $(SYSROOT)/usr/include
CFLAGS=-I. -I.. -I../hypervisor/include/arch/x86/guest -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \ CFLAGS=-I. -I.. -I../../hypervisor/include/arch/x86/guest -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
-I../hypervisor/include/public -I../hypervisor/include/lib -I../hypervisor/boot/include/guest \ -I../../hypervisor/include/public -I../../hypervisor/include/lib -I../../hypervisor/boot/include/guest \
-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \ -DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
-Wall -I../fs/ -D$(ARCH) -O2 -I../hypervisor/include/arch/x86 \ -Wall -I../fs/ -D$(ARCH) -O2 -I../../hypervisor/include/arch/x86 \
-include config.h -include config.h
CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387 CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387

Some files were not shown because too many files have changed in this diff Show More