diff --git a/doc/develop.rst b/doc/develop.rst index 212507ddd..74bebd7a0 100644 --- a/doc/develop.rst +++ b/doc/develop.rst @@ -20,6 +20,7 @@ Configuration and Tools user-guides/acrn-shell user-guides/acrn-dm-parameters misc/tools/acrn-crashlog/README + misc/packaging/README misc/tools/** misc/acrn-manager/** diff --git a/misc/packaging/50-acrn.netdev b/misc/packaging/50-acrn.netdev new file mode 100644 index 000000000..29283cc1d --- /dev/null +++ b/misc/packaging/50-acrn.netdev @@ -0,0 +1,3 @@ +[NetDev] +Name=acrn-br0 +Kind=bridge diff --git a/misc/packaging/50-acrn.network b/misc/packaging/50-acrn.network new file mode 100644 index 000000000..bd5f16b96 --- /dev/null +++ b/misc/packaging/50-acrn.network @@ -0,0 +1,5 @@ +[Match] +Name=e* acrn_tap* tap* + +[Network] +Bridge=acrn-br0 diff --git a/misc/packaging/50-eth.network b/misc/packaging/50-eth.network new file mode 100644 index 000000000..a63931b12 --- /dev/null +++ b/misc/packaging/50-eth.network @@ -0,0 +1,5 @@ +[Match] +Name=acrn-br0 + +[Network] +DHCP=ipv4 diff --git a/misc/packaging/50-tap0.netdev b/misc/packaging/50-tap0.netdev new file mode 100644 index 000000000..a2d55b9d9 --- /dev/null +++ b/misc/packaging/50-tap0.netdev @@ -0,0 +1,3 @@ +[NetDev] +Name=tap0 +Kind=tap diff --git a/misc/packaging/README.rst b/misc/packaging/README.rst new file mode 100644 index 000000000..c048e6117 --- /dev/null +++ b/misc/packaging/README.rst @@ -0,0 +1,128 @@ +.. _ubuntu_sos: + +ubuntu_sos +########## + +Description +*********** +this scripts show how to build acrn-hypervisor and acrn-kernel deb package + +1. setup native ubuntu 18.04 +============================= +Base on GEO; config your proxy + + .. code-block:: none + + sudo apt install python3 + + sudo su + + +2. config release.json file +============================ +below is explanation for items in release.json,please change item accordingly,if do not change means go with default value + + .. code-block:: none + + { + + "//":"release ubuntu as sos verion", + + "install_package":"true",---------->this 1st time should set to true if you did not install acrn related compile package, if already install,set to false + + "gcc_version":"7.3.0",---------->gcc version should higher than 7.3.0 + + "binutils":"2.27",---------->binutils version should higher than 2.27 + + "//":"acrn-hypervisor config", + + "build_acrn":"true",---------->if you need build acrn-hypervisor set to true + + "sync_acrn_code":"true",---------->if you need sync acrn-hypervisor code set to true + + "acrn_repo":"https://github.com/projectacrn/acrn-hypervisor.git",---------->acrn repo + + "release_version":"remotes/origin/release_2.0",---------->acrn release branch + + "acrn_deb_package":"true",---------->if you need create acrn-hypervison deb set to true + + "install_acrn_deb":"false",---------->if you need install acrn-hypervisor deb set to true + + "build_cmd":---------->acrn-hypervisor build command must include scenario and board info and release type + + { + + "scenario": + + { + + "industry":"true", + + "hybrid":"true", + + "logical_partition":"true" + + + }, + + "board": + + { + + "nuc7i7dnb":"true", + + "whl-ipc-i5":"true" + + }, + + "release":"0"---------->0 means debug version,1 means release version + + }, + + "//":"kernel config", + + "build_acrn_kernel":"true",---------->if you need build acrn-kernel set to true + + "sync_acrn_kernel_code":"true",---------->if you need sync acrn-kernel code set to true + + "kernel_release_version":"remotes/origin/release_2.0",---------->acrn kernel release branch + + + "sos_kernel_repo":"https://github.com/projectacrn/acrn-kernel.git",---------->acrn kernel repo + + + "acrn_kernel_deb_package":"true",---------->if you need create acrn-kernel deb set to true + + "install_acrn_kernel_deb":"false",---------->if you need install acrn-kernel deb set to true + + "//":"misc", + + "auto_reboot":"false"---------->if you need reboot set to true + + } + +3.python3 install_uSoS.py +========================= +after finished , will get below two item + +acrn_deb_package.deb + +acrn_kernel_deb_package.deb + + +install command + +sudo dpkg -i acrn_deb_package.deb + +sudo dpkg -i acrn_kernel_deb_package.deb + + +uninstall + +sudo dpkg -r acrn-package + +sudo dpkg -r acrn-kernel-package + +4.python3 compile_iasl.py +========================= +this scriptrs is help compile iasl and cp to /usr/sbin diff --git a/misc/packaging/acrn-hypervisor.postinst b/misc/packaging/acrn-hypervisor.postinst new file mode 100644 index 000000000..2068636a9 --- /dev/null +++ b/misc/packaging/acrn-hypervisor.postinst @@ -0,0 +1,120 @@ +#!/bin/bash +#* Copyright (c) 2020 Intel Corporation All rights reserved. +# postinst script for acrn-hypervisor +set -e + + +echo "please choose , ," + +echo "Scenario is -> + 1. industry + 2. hybrid + 3. logical_partition" +read num + +if [[ $num -eq 1 ]] +then + echo "Scenario is industry" + SCENARIO="industry" +elif [[ $num -eq 2 ]] +then + echo "Scenario is hybrid" + SCENARIO="hybrid" + +elif [[ $num -eq 3 ]] +then + echo "Scenario is logical_partition" + SCENARIO="logical_partition" +fi + +echo "Board is -> + 1. nuc7i7dnb + 2. whl-ipc-i5" +read num2 + +if [[ $num2 -eq 1 ]] +then + echo "Board is nuc7i7dnb" + BOARD="nuc7i7dnb" +elif [[ $num2 -eq 2 ]] +then + echo "Board is whl-ipc-i5" + BOARD="whl-ipc-i5" +fi + +ACRNBIN="/boot/acrn.${SCENARIO}.${BOARD}.bin" + +echo "Your acrn bin is ->" +echo $ACRNBIN + + +echo "disk type is -> + 1. nvme + 2. sda" +read num3 + +if [[ $num3 -eq 1 ]] +then + echo "disk type is nvme" + type="nvme" +elif [[ $num3 -eq 2 ]] +then + echo "disk type is sda" + type="sda" +fi + + +str=$(blkid |grep ext4 |grep ${type}) + +uuid=$(echo $str |cut -d " " -f 2|cut -d "=" -f 2) + +str=$(blkid |grep ext4 |grep ${type}) + +partuuid=$(echo ${str##*PARTUUID=}) + +filename="/etc/grub.d/40_custom" + +kernelimg=$(grep module ${filename}|| true) +kernelimg2='/boot/' + +if [ "$kernelimg" ] +then + kernelimg2=$(echo $kernelimg |cut -d ' ' -f 2) +fi + +cat>"${filename}"<"${filename}"<