mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 04:02:05 +00:00
doc: content updates to Install ACRN out of the box file
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
This commit is contained in:
parent
df465cc1df
commit
dd1172ee63
@ -1,38 +1,39 @@
|
||||
.. _acrn_ootb:
|
||||
.. _acrn_ootb:
|
||||
|
||||
Install ACRN use out-of-the-box image
|
||||
#####################################
|
||||
In this tutorial, we will learn to generate an out-of-the-box (OOTB) Service VM
|
||||
or even a Preempt-RT VM image so that we can use ACRN or RTVM immediately after
|
||||
installation without any configuration or modification.
|
||||
Install ACRN Out-of-the-box
|
||||
###########################
|
||||
|
||||
In this tutorial, we will learn to generate an out-of-the-box (OOTB) Service VM or a Preempt-RT VM image so that we can use ACRN or RTVM immediately after installation without any configuration or modification.
|
||||
|
||||
Set up a Build Environment
|
||||
**************************
|
||||
|
||||
Set up build environment
|
||||
************************
|
||||
#. Follow the `Clear Linux OS installation guide
|
||||
<https://clearlinux.org/documentation/clear-linux/get-started/bare-metal-install-server>`_
|
||||
to install a native Clear Linux OS on development machine.
|
||||
to install a native Clear Linux OS on a development machine.
|
||||
|
||||
#. Login in the Clear Linux OS and install these bundles::
|
||||
#. Log in to the Clear Linux OS and install these bundles::
|
||||
|
||||
$ sudo swupd bundle-add clr-installer vim network-basic
|
||||
|
||||
.. _set_up_ootb_service_vm:
|
||||
|
||||
Generate Service VM image
|
||||
*************************
|
||||
Generate a Service VM image
|
||||
***************************
|
||||
|
||||
Create Service VM image YAML file and script
|
||||
============================================
|
||||
- **Example 1**: `ACRN SDC scenario`
|
||||
Step 1: Create a Service VM YAML file and script
|
||||
================================================
|
||||
|
||||
**Scenario 1: ACRN SDC**
|
||||
|
||||
#. Create the ACRN SDC ``service-os.yaml`` file:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ mkdir -p ~/service-os && cd ~/service-os
|
||||
$ vim service-os.yaml
|
||||
|
||||
Update the ``service-os.yaml`` to:
|
||||
Update the ``service-os.yaml`` file to:
|
||||
|
||||
.. code-block:: bash
|
||||
:emphasize-lines: 51
|
||||
@ -89,15 +90,15 @@ Create Service VM image YAML file and script
|
||||
|
||||
version: 30970
|
||||
|
||||
.. note:: Update version value to your target Clear Linux version.
|
||||
.. note:: Update the version value to your target Clear Linux version.
|
||||
|
||||
#. Create ACRN SDC ``service-os-post.sh``:
|
||||
#. Create the ACRN SDC ``service-os-post.sh`` script:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ vim service-os-post.sh
|
||||
|
||||
Update the ``service-os-post.sh`` to:
|
||||
Update the ``service-os-post.sh`` script to:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -131,16 +132,16 @@ Create Service VM image YAML file and script
|
||||
|
||||
exit 0
|
||||
|
||||
- **Example 2**: `ACRN INDUSTRY scenario`
|
||||
**Scenario 2: ACRN INDUSTRY**
|
||||
|
||||
#. Create ACRN INDUSTRY ``service-os-industry.yaml`` file:
|
||||
#. Create the ACRN INDUSTRY ``service-os-industry.yaml`` file:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ mkdir -p ~/service-os-industry && cd ~/service-os-industry
|
||||
$ vim service-os-industry.yaml
|
||||
|
||||
Update the ``service-os-industry.yaml`` to:
|
||||
Update the ``service-os-industry.yaml`` file to:
|
||||
|
||||
.. code-block:: bash
|
||||
:emphasize-lines: 52
|
||||
@ -198,15 +199,15 @@ Create Service VM image YAML file and script
|
||||
|
||||
version: 30970
|
||||
|
||||
.. note:: Update version value to your target Clear Linux version.
|
||||
.. note:: Update the version value to your target Clear Linux version.
|
||||
|
||||
#. Create ``service-os-industry-post.sh``:
|
||||
#. Create the ``service-os-industry-post.sh`` script:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ vim service-os-industry-post.sh
|
||||
|
||||
Update the ``service-os-industry-post.sh`` to:
|
||||
Update the ``service-os-industry-post.sh`` script to:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -240,35 +241,41 @@ Create Service VM image YAML file and script
|
||||
|
||||
exit 0
|
||||
|
||||
Use clr-installer to build Service VM image
|
||||
===========================================
|
||||
- Build ACRN SDC Service VM image:
|
||||
Step 2: Build the Service VM image
|
||||
==================================
|
||||
|
||||
.. code-block:: console
|
||||
Use the clr-installer to build the Service VM image.
|
||||
|
||||
**Scenario 1: ACRN SDC**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ cd ~/service-os
|
||||
$ sudo clr-installer -c service-os.yaml
|
||||
|
||||
.. note:: The ``service-os.img`` will be generated at current directory.
|
||||
|
||||
The ``service-os.img`` will be generated at current directory.
|
||||
|
||||
|
||||
- Build ACRN INDUSTRY Service VM image:
|
||||
**Scenario 2: ACRN INDUSTRY**
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ cd ~/service-os-industry
|
||||
$ sudo clr-installer -c service-os-industry.yaml
|
||||
|
||||
.. note:: The ``service-os-industry.img`` will be generated at current directory.
|
||||
|
||||
Deploy Service VM image
|
||||
=======================
|
||||
The ``service-os-industry.img`` will be generated at current directory.
|
||||
|
||||
Step 3: Deploy the Service VM image
|
||||
===================================
|
||||
|
||||
#. Prepare a U disk with at least 8GB memory.
|
||||
|
||||
#. Follow these steps to create two partitions on the U disk,
|
||||
the first partition is 4G, and the second partition use the left free space:
|
||||
#. Follow these steps to create two partitions on the U disk.
|
||||
Keep 4GB in the first partition and leave free space in the second parition.
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# sudo gdisk /dev/sdb
|
||||
GPT fdisk (gdisk) version 1.0.3
|
||||
@ -323,7 +330,7 @@ Deploy Service VM image
|
||||
|
||||
#. Download and install a bootable Clear Linux on the U disk:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ wget https://download.clearlinux.org/releases/30970/clear/clear-30970-live-server.iso.xz
|
||||
$ xz -d clear-30970-live-server.iso.xz
|
||||
@ -331,39 +338,39 @@ Deploy Service VM image
|
||||
|
||||
#. Copy the ``service-os.img`` or ``service-os-industry.img`` to the U disk:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ sudo mkfs.ext4 /dev/sdb2
|
||||
$ sudo mount /dev/sdb2 /mnt
|
||||
|
||||
- SDC scenario:
|
||||
- ACRN SDC scenario:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ cp ~/service-os/service-os.img /mnt
|
||||
$ sync && umount /mnt
|
||||
|
||||
- INDUSTRY scenario:
|
||||
- ACRN INDUSTRY scenario:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ cp ~/service-os-industry/service-os-industry.img /mnt
|
||||
$ sync && umount /mnt
|
||||
|
||||
#. Unplug the U disk from development machine and plugin it to your test machine.
|
||||
#. Unplug the U disk from the development machine and plug it in to your test machine.
|
||||
|
||||
#. Reboot the test machine and boot from USB.
|
||||
#. Reboot the test machine and boot from the USB.
|
||||
|
||||
#. Login in Live Service Clear Linux OS with "root" account,
|
||||
mount the second partition on U disk:
|
||||
#. Log in to the Live Service Clear Linux OS with your "root" account and
|
||||
mount the second partition on the U disk:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# mount /dev/sdb2 /mnt
|
||||
|
||||
#. Format the disk which will install the Service VM image:
|
||||
#. Format the disk that will install the Service VM image:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# sudo gdisk /dev/nvme0n1
|
||||
GPT fdisk (gdisk) version 1.0.3
|
||||
@ -391,7 +398,7 @@ Deploy Service VM image
|
||||
|
||||
#. Delete the old ACRN EFI firmware info:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# efibootmgr | grep ACRN | cut -d'*' -f1 | cut -d't' -f2 | xargs -i efibootmgr -b {} -B
|
||||
|
||||
@ -399,40 +406,40 @@ Deploy Service VM image
|
||||
|
||||
- ACRN SDC scenario:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# dd if=/mnt/sos.img of=/dev/nvme0n1 bs=4M oflag=sync status=progress
|
||||
|
||||
- ACRN INDUSTRY scenario:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# dd if=/mnt/sos-industry.img of=/dev/nvme0n1 bs=4M oflag=sync status=progress
|
||||
|
||||
#. Configure the EFI firmware to boot the ACRN hypervisor by default:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
# efibootmgr -c -l "\EFI\acrn\acrn.efi" -d /dev/nvme0n1 -p 1 -L "ACRN"
|
||||
|
||||
#. Unplug the U disk and reboot the test machine, and after the Clear Linux OS boots,
|
||||
everything is ready, you could login as "root" for the first time.
|
||||
#. Unplug the U disk and reboot the test machine. After the Clear Linux OS boots, log in as "root" for the first time.
|
||||
|
||||
.. _set_up_ootb_rtvm:
|
||||
|
||||
Generate User VM Preempt-RT image
|
||||
*********************************
|
||||
Generate a User VM Preempt-RT image
|
||||
***********************************
|
||||
|
||||
Step 1: Create a Preempt-RT image YAML file and script
|
||||
======================================================
|
||||
|
||||
Create Preempt-RT image YAML file and script
|
||||
============================================
|
||||
#. Create the ``preempt-rt.yaml`` file:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ mkdir -p ~/preempt-rt && cd ~/preempt-rt
|
||||
$ vim preempt-rt.yaml
|
||||
|
||||
Update ``preempt-rt.yaml`` to:
|
||||
Update the ``preempt-rt.yaml`` file to:
|
||||
|
||||
.. code-block:: bash
|
||||
:emphasize-lines: 46
|
||||
@ -484,42 +491,44 @@ Create Preempt-RT image YAML file and script
|
||||
|
||||
version: 30970
|
||||
|
||||
.. note:: Update version value to your target Clear Linux version
|
||||
.. note:: Update the version value to your target Clear Linux version
|
||||
|
||||
Build User VM Preempt-RT image
|
||||
==============================
|
||||
Step 2: Build a User VM Preempt-RT image
|
||||
========================================
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ sudo clr-installer -c preempt-rt.yaml
|
||||
|
||||
The ``preempt-rt.img`` will be generated at current directory.
|
||||
|
||||
Deploy User VM Preempt-RT image
|
||||
===============================
|
||||
#. Login the Service VM and copy the ``preempt-rt.img`` from development machine:
|
||||
The ``preempt-rt.img`` will be generated at the current directory.
|
||||
|
||||
.. code-block:: console
|
||||
Step 3: Deploy the User VM Preempt-RT image
|
||||
===========================================
|
||||
|
||||
#. Log in to the Service VM and copy the ``preempt-rt.img`` from the development machine:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ mkdir -p preempt-rt && cd preempt-rt
|
||||
$ scp <development username>@<development machine ip>:<path to preempt-rt.img> .
|
||||
|
||||
#. Write ``preempt-rt.img`` to disk:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ sudo dd if=<path to preempt-rt.img> of=/dev/sda bs=4M oflag=sync status=progress
|
||||
|
||||
#. Copy the ``OVMF.fd`` and ``launch_hard_rt_vm.sh``:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ cp /usr/share/acrn/bios/OVMF.fd .
|
||||
$ cp /usr/share/acrn/samples/nuc/launch_hard_rt_vm.sh .
|
||||
|
||||
#. Launch the Preempt-RT User VM:
|
||||
|
||||
.. code-block:: console
|
||||
.. code-block:: none
|
||||
|
||||
$ chmod +x launch_hard_rt_vm.sh
|
||||
$ ./launch_hard_rt_vm.sh
|
||||
|
Loading…
Reference in New Issue
Block a user