modify create-up2-images scripts

This commit is contained in:
wenlingz 2019-01-31 11:56:47 +08:00 committed by David Kinder
parent eb7091bb1f
commit 37ce259fb9
2 changed files with 24 additions and 32 deletions

View File

@ -46,19 +46,20 @@ create_sos_images() {
return 1
}
SOS_BOOTARGS_DEBUG=${ACRN_HV_CODE_PATH}/devicemodel/samples/up2/sos_bootargs_debug.txt
SOS_BOOTARGS_DEBUG=sos_rootfs/usr/share/acrn/samples/up2/sos_bootargs_debug.txt
if [[ ! ${ACRN_SBL} && ! -f ${ACRN_SBL} ]]
then
if [ ${ACRN_HV_CODE_PATH} ]
then
make -C ${ACRN_HV_CODE_PATH} clean || return 1
make -C ${ACRN_HV_CODE_PATH} hypervisor BOARD=up2 FIRMWARE=sbl || return 1
ACRN_SBL=${ACRN_HV_CODE_PATH}/build/hypervisor/acrn.32.out
else
echo "Need to provide acrn.sbl or acrn-hypervisor source code path"
return 1
fi
if [[ ! ${ACRN_SBL} || ! -f ${ACRN_SBL} ]]
then
ACRN_SBL=sos_rootfs/usr/lib/acrn/acrn.up2.sbl
fi
if [ ${ACRN_HV_CODE_PATH} ]
then
SOS_BOOTARGS_DEBUG=${ACRN_HV_CODE_PATH}/devicemodel/samples/up2/sos_bootargs_debug.txt
make -C ${ACRN_HV_CODE_PATH} clean || return 1
make -C ${ACRN_HV_CODE_PATH} hypervisor BOARD=up2 FIRMWARE=sbl || return 1
ACRN_SBL=${ACRN_HV_CODE_PATH}/build/hypervisor/acrn.32.out
fi
if [ ! -f ${ACRN_SBL} ]
@ -67,6 +68,8 @@ create_sos_images() {
return 1
fi
echo "ACRN_SBL:"${ACRN_SBL}
if [ -f ${SOS_BOOTARGS_DEBUG} ]
then
echo -n "CMDLINE: "
@ -151,7 +154,7 @@ LAAG_BUNDLE_APPEND=""
SOS_ROOTFS_SIZE=3584
LAAG_IMAGE_SIZE=10240
LAAG_VDISK_SIZE=5120
MIRRORURL="https://cdn.download.clearlinux.org/releases/"
MIRRORURL="https://cdn.download.clearlinux.org/update/"
SIGN_KEY="https://download.clearlinux.org/secureboot/DefaultIASSigningPrivateKey.pem"
IMAGE=all
@ -225,10 +228,6 @@ if [[ ${IMAGE} == "sos" || ${IMAGE} == "all" ]]; then
echo "--clearlinux-version: must be provided for SOS images building."
exit 1
fi
if [[ ! ${ACRN_SBL} && ! ${ACRN_HV_CODE_PATH} ]]; then
echo "Should provide --acrn-sbl-path or --acrn-code-path for SOS images building"
exit 1
fi
fi
# check valid LaaG image and vdisk sizes

View File

@ -76,6 +76,11 @@ Build ACRN for UP2
In Clear Linux, build out the SOS and LaaG image with these two files:
* create-up2-images.sh
.. code-block:: none
$ wget https://raw.githubusercontent.com/projectacrn/acrn-hypervisor/master/doc/tutorials/create-up2-images.sh
* uos.json
An example of the configuration file ``uos.json``:
@ -99,26 +104,14 @@ An example of the configuration file ``uos.json``:
the "Version" argument, ``"Version": 2****`` instead
of ``"Version": 27230`` for example.
Clone the source code of ``acrn-hypervisor`` for building and use
``v0.5`` release for example:
.. code-block:: none
$ cd ~
$ git clone https://github.com/projectacrn/acrn-hypervisor
$ cd acrn-hypervisor
$ git checkout v0.5
.. note::
You can switch to other version with the command ``git checkout`` if needed.
Build SOS and LaaG image:
.. code-block:: none
$ sudo -s
# ./acrn-hypervisor/devicemodel/samples/up2/create-up2-images.sh --images-type all \
--clearlinux-version 27230 --laag-json uos.json --acrn-code-path /path/to/acrn-hypervisor/
$ sudo -s
# chmod +x create-up2-images.sh
# ./create-up2-images.sh --images-type all --clearlinux-version 27230 --laag-json uos.json
.. note::
You must have root privileges to run ``create-up2-images.sh``.