mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 12:12:16 +00:00
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:
parent
555a03db99
commit
a9c38a5cfb
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@ doc/doxygen
|
||||
doc/_build
|
||||
doc/tools
|
||||
doc/reference/kconfig/*.rst
|
||||
doc/misc
|
||||
build
|
||||
*.bak
|
||||
*.sav
|
||||
|
16
Makefile
16
Makefile
@ -16,9 +16,9 @@ RELEASE ?= 0
|
||||
O ?= build
|
||||
ROOT_OUT := $(shell mkdir -p $(O);cd $(O);pwd)
|
||||
HV_OUT := $(ROOT_OUT)/hypervisor
|
||||
EFI_OUT := $(ROOT_OUT)/efi-stub
|
||||
EFI_OUT := $(ROOT_OUT)/misc/efi-stub
|
||||
DM_OUT := $(ROOT_OUT)/devicemodel
|
||||
TOOLS_OUT := $(ROOT_OUT)/tools
|
||||
TOOLS_OUT := $(ROOT_OUT)/misc/tools
|
||||
DOC_OUT := $(ROOT_OUT)/doc
|
||||
BUILD_VERSION ?=
|
||||
BUILD_TAG ?=
|
||||
@ -32,7 +32,7 @@ hypervisor:
|
||||
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE)
|
||||
ifeq ($(FIRMWARE),uefi)
|
||||
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
|
||||
|
||||
sbl-hypervisor:
|
||||
@ -48,14 +48,14 @@ devicemodel: tools
|
||||
|
||||
tools:
|
||||
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:
|
||||
$(MAKE) -C $(T)/doc html BUILDDIR=$(DOC_OUT)
|
||||
|
||||
.PHONY: 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
|
||||
rm -rf $(ROOT_OUT)
|
||||
|
||||
@ -68,7 +68,7 @@ ifeq ($(FIRMWARE),sbl)
|
||||
endif
|
||||
ifeq ($(FIRMWARE),uefi)
|
||||
$(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
|
||||
|
||||
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
|
||||
endif
|
||||
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
|
||||
|
||||
sbl-hypervisor-install:
|
||||
@ -91,4 +91,4 @@ devicemodel-install:
|
||||
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) 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
|
||||
|
@ -43,7 +43,7 @@ doxy:
|
||||
$(Q)find doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/'
|
||||
|
||||
content:
|
||||
$(Q)scripts/extract_content.py . tools
|
||||
$(Q)scripts/extract_content.py . misc
|
||||
|
||||
kconfig:
|
||||
$(Q)srctree=../hypervisor \
|
||||
|
@ -487,7 +487,7 @@ partition. Follow these steps:
|
||||
<https://github.com/projectacrn/acrn-hypervisor/blob/master/efi-stub/clearlinux/acrn.conf>`__
|
||||
as shown here:
|
||||
|
||||
.. literalinclude:: ../../efi-stub/clearlinux/acrn.conf
|
||||
.. literalinclude:: ../../misc/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:
|
||||
|
@ -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
|
||||
|
||||
.. 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.
|
||||
|
||||
.. figure:: images/debug_image28.png
|
||||
@ -174,7 +174,7 @@ shown in the following example:
|
||||
trace event id
|
||||
|
||||
2. Add the following format to
|
||||
``acrn-hypervisor/tools/acrntrace/scripts/formats``:
|
||||
``acrn-hypervisor/misc/tools/acrntrace/scripts/formats``:
|
||||
|
||||
.. figure:: images/debug_image1.png
|
||||
:align: center
|
||||
@ -224,7 +224,7 @@ shown in the following example:
|
||||
formats /home/trace/acrntrace/20190219-001529/1 | grep "trace test"
|
||||
|
||||
.. 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.
|
||||
|
||||
and we will get the following log:
|
||||
|
@ -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
|
||||
ACRN bridge (``acrn-br0``), the TAP device (``tap0``), and how these are all
|
||||
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
|
||||
********************************
|
||||
@ -35,8 +35,8 @@ Modify the ``[Network]`` section in the
|
||||
``/etc/systemd/network/50-eth.network`` file you just created.
|
||||
This is the content of the file used in ACRN by default.
|
||||
|
||||
.. literalinclude:: ../../tools/acrnbridge/eth.network
|
||||
:caption: tools/acrnbridge/eth.network
|
||||
.. literalinclude:: ../../misc/acrnbridge/eth.network
|
||||
:caption: misc/acrnbridge/eth.network
|
||||
:emphasize-lines: 5
|
||||
|
||||
Edit the file to remove the line highlighted above and add your network settings in
|
||||
|
@ -7,4 +7,4 @@ Tools
|
||||
:glob:
|
||||
:maxdepth: 1
|
||||
|
||||
../tools/**
|
||||
../misc/**
|
||||
|
@ -45,7 +45,7 @@ ARCH_LDFLAGS :=
|
||||
.PHONY: default
|
||||
default: all
|
||||
|
||||
include $(BASEDIR)/../scripts/deps.mk
|
||||
include $(BASEDIR)/../misc/acrn-config/library/deps.mk
|
||||
|
||||
include scripts/kconfig/kconfig.mk
|
||||
|
||||
|
@ -18,7 +18,7 @@ HV_DEFCONFIG := defconfig
|
||||
HV_CONFIG_H := include/config.h
|
||||
HV_CONFIG_MK := include/config.mk
|
||||
|
||||
KCONFIG_DIR := $(BASEDIR)/../scripts/kconfig
|
||||
KCONFIG_DIR := $(BASEDIR)/../misc/acrn-config/kconfig
|
||||
|
||||
# Backward-compatibility for RELEASE=(0|1)
|
||||
ifdef RELEASE
|
||||
|
@ -10,26 +10,26 @@ all: acrn-manager acrnbridge
|
||||
endif
|
||||
|
||||
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:
|
||||
$(MAKE) -C $(T)/acrnlog OUT_DIR=$(OUT_DIR)
|
||||
$(MAKE) -C $(T)/tools/acrnlog OUT_DIR=$(OUT_DIR)
|
||||
|
||||
acrn-manager:
|
||||
$(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) RELEASE=$(RELEASE)
|
||||
|
||||
acrntrace:
|
||||
$(MAKE) -C $(T)/acrntrace OUT_DIR=$(OUT_DIR)
|
||||
$(MAKE) -C $(T)/tools/acrntrace OUT_DIR=$(OUT_DIR)
|
||||
|
||||
acrnbridge:
|
||||
$(MAKE) -C $(T)/acrnbridge OUT_DIR=$(OUT_DIR)
|
||||
|
||||
.PHONY: 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)/acrntrace OUT_DIR=$(OUT_DIR) clean
|
||||
$(MAKE) -C $(T)/acrnlog OUT_DIR=$(OUT_DIR) clean
|
||||
$(MAKE) -C $(T)/tools/acrntrace OUT_DIR=$(OUT_DIR) clean
|
||||
$(MAKE) -C $(T)/tools/acrnlog OUT_DIR=$(OUT_DIR) clean
|
||||
rm -rf $(OUT_DIR)
|
||||
|
||||
.PHONY: install
|
||||
@ -40,16 +40,16 @@ install: acrn-manager-install acrnbridge-install
|
||||
endif
|
||||
|
||||
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:
|
||||
$(MAKE) -C $(T)/acrnlog OUT_DIR=$(OUT_DIR) install
|
||||
$(MAKE) -C $(T)/tools/acrnlog OUT_DIR=$(OUT_DIR) install
|
||||
|
||||
acrn-manager-install:
|
||||
$(MAKE) -C $(T)/acrn-manager OUT_DIR=$(OUT_DIR) install
|
||||
|
||||
acrntrace-install:
|
||||
$(MAKE) -C $(T)/acrntrace OUT_DIR=$(OUT_DIR) install
|
||||
$(MAKE) -C $(T)/tools/acrntrace OUT_DIR=$(OUT_DIR) install
|
||||
|
||||
acrnbridge-install:
|
||||
$(MAKE) -C $(T)/acrnbridge OUT_DIR=$(OUT_DIR) install
|
@ -4,7 +4,8 @@
|
||||
# This script takes a Kconfig and a defconfig file, and expands it to a .config
|
||||
# with all default values listed explicitly.
|
||||
|
||||
import sys, os
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
|
||||
# SPDX-License-Identifier: ISC
|
@ -4,49 +4,50 @@
|
||||
# This script takes a Kconfig and a .config, and generates a C header file with
|
||||
# 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
|
||||
# SPDX-License-Identifier: ISC
|
||||
# Refer to scripts/kconfig/LICENSE.kconfiglib for the permission notice.
|
||||
import kconfiglib
|
||||
import re
|
||||
|
||||
class Acrn_config(kconfiglib.Kconfig):
|
||||
class AcrnConfig(kconfiglib.Kconfig):
|
||||
help_regex = re.compile("64-bit[\s\n]+integer")
|
||||
def __init__(self, filename="Kconfig", warn=True, warn_to_stderr=True,
|
||||
encoding="utf-8"):
|
||||
def __init__(self, filename="Kconfig", warn=True, warn_to_stderr=True, encoding="utf-8"):
|
||||
kconfiglib.Kconfig.__init__(self, filename, warn, warn_to_stderr, encoding)
|
||||
|
||||
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_end = "#endif"
|
||||
|
||||
with open(filename, "w") as f:
|
||||
f.write(header)
|
||||
f.write(guard_begin)
|
||||
with open(filename, "w") as f_autoconf:
|
||||
f_autoconf.write(header)
|
||||
f_autoconf.write(guard_begin)
|
||||
|
||||
for sym in self.defined_syms:
|
||||
if sym.config_string in ("",None):
|
||||
if sym.config_string in ("", None):
|
||||
continue
|
||||
else:
|
||||
val = sym.str_value
|
||||
if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE):
|
||||
if val != "n":
|
||||
f.write("#define {}{}{} 1\n"
|
||||
f_autoconf.write("#define {}{}{} 1\n"
|
||||
.format(self.config_prefix, sym.name,
|
||||
"_MODULE" if val == "m" else ""))
|
||||
elif sym.orig_type == kconfiglib.STRING:
|
||||
f.write('#define {}{} "{}"\n'
|
||||
f_autoconf.write('#define {}{} "{}"\n'
|
||||
.format(self.config_prefix, sym.name,
|
||||
kconfiglib.escape(val)))
|
||||
elif sym.orig_type in (kconfiglib.INT, kconfiglib.HEX):
|
||||
if sym.orig_type == kconfiglib.HEX:
|
||||
val = val + "U"
|
||||
if not val.startswith(("0x", "0X")):
|
||||
val = "0x" + val
|
||||
val = val + "U"
|
||||
if not val.startswith(("0x", "0X")):
|
||||
val = "0x" + val
|
||||
elif sym.orig_type == kconfiglib.INT and len(sym.ranges) > 0:
|
||||
left_sym = sym.ranges[0][0]
|
||||
right_sym = sym.ranges[0][1]
|
||||
@ -56,16 +57,16 @@ class Acrn_config(kconfiglib.Kconfig):
|
||||
val = val + "U"
|
||||
|
||||
_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"
|
||||
f.write("#define {}{} {}\n"
|
||||
f_autoconf.write("#define {}{} {}\n"
|
||||
.format(self.config_prefix, sym.name, val))
|
||||
else:
|
||||
raise Exception("Internal error while creating C "
|
||||
'header: unknown type "{}".'
|
||||
.format(sym.orig_type))
|
||||
raise Exception(
|
||||
'Internal error while creating C header: unknown type "{}".' \
|
||||
.format(sym.orig_type))
|
||||
|
||||
f.write(guard_end)
|
||||
f_autoconf.write(guard_end)
|
||||
|
||||
|
||||
def usage():
|
||||
@ -87,9 +88,9 @@ def main():
|
||||
sys.stderr.write("Cannot find file %s\n" % config_path)
|
||||
sys.exit(1)
|
||||
|
||||
kconfig = Acrn_config(kconfig_path)
|
||||
kconfig = AcrnConfig(kconfig_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])
|
||||
|
||||
if __name__ == "__main__":
|
@ -5,7 +5,8 @@
|
||||
# having the default values. The minimized config can act as a defconfig for
|
||||
# future use.
|
||||
|
||||
import sys, os
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
|
||||
# SPDX-License-Identifier: ISC
|
@ -9,7 +9,8 @@
|
||||
# 3. reconstruct .config with the given list of symbol-value pairs if there
|
||||
# is any disagreement.
|
||||
|
||||
import sys, os
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Kconfiglib: Copyright (c) 2011-2018, Ulf Magnusson
|
||||
# SPDX-License-Identifier: ISC
|
@ -59,10 +59,10 @@ LDSCRIPT := $(GNUEFI_DIR)/elf_$(ARCH)_efi.lds
|
||||
|
||||
INCDIR := $(SYSROOT)/usr/include
|
||||
|
||||
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 \
|
||||
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 \
|
||||
-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
|
||||
|
||||
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
Loading…
Reference in New Issue
Block a user