Skip to content

[RFC] Add Debian packaging for release_1.6, release_2.0 and master #4833

@tttech-industrial-buchsbaum

Description

Motivation

To be able to install ACRN and friends easily on a Debian system the Debian packaging data have to provided. These are located in the debian directory which contains all the packaging control files. This proposal only adds this directory.

The presented solution has been applied to the the release_1.6 branch of ACRN and uses git-buildpackage via a Docker container to build the ACRN Debian packages.

These packages are meant to be installed on a vanilla Debian Buster installation and have been verified on an Intel NUC7i7DNH and a Kontron COMe-mAL10 based industrial PC.

Prerequisites

  • Appropriate Grub Package
    A grub bootloader with "multiboot2: Set min address for mbi allocation to 0x1000" patch applied (http://git.savannah.gnu.org/cgit/grub.git/commit/?id=0f3f5b7c13fa9b677a64cf11f20eca0f850a2b20) is required. I am using a the grub-2.04-7 package build of Debian unstable (https://salsa.debian.org/grub-team/grub) with the above patch added and rebuilt resulting in a grub-2.04-7.1 package.

  • Multiboot2 boot protocol
    Since deprivileged boot mode is deprecated according to Like Yan, and furthermore needs adjusting the EFI boot variables at install time, I switched to direct boot mode, and since I need an EFI enable Linux guest system multiboot2 boot protocol is the only choice.

  • ACRN SOS Enabled Debian Linux Image Package
    This is required, since this also guarantees the creation of an appropriate initramfs image file needed for booting. It can be easily created by using the ACRN kernel at https://github.com/projectacrn/acrn-kernel with the kernel_config_uefi_sos as config to start with and creating your own Debian linux-image-*.deb (use make bindeb-pkg) required to be installed as an SOS.

Board and Scenario Configurations

Since all configurations contained within the ACRN source tree do not specify an initramfs tag entry for the SOS they cannot be used without change. Instead, I provide the configurations I tested with my Kontron-based IPC and an Intel NUC7i7DNH:
Boards/Scenarios:

  • kontron-COMe-mAL10: industry, industry2 (no KATA, but two RT-VMs)
  • nuc7i7dnb2: industry

The nuc7i7dnb2 board configuration is derived from the original nuc7i7dnb board configuration basically with the stuff removed a more generic configuration for different variants of target board does not really need. I compared what my NUC7i7DNH provided using board_parser.py with the
original nuc7i7dnb configuration and just left what they have in common. BTW, I also did this for different variants of my kontron-COMe-mAL10!

This also makes it easy to add custom configurations without patching the upstream sources!

Remark: If you switch to the source built-in configs (see debian/rules), they all build, but at least the nuc7i7dnb does not run!

Patches

As you can see in debian/patches there are several patches contained in that build. They are subject to be discussed and solved in separate issues (to be posted ASAP) and touch the following topics:

  • Makefile related: fixups & reproducibility
  • kontron-COMe-mAL10 related issues
  • Provide arbitary initramfs sizes
  • Make mandatory config items optional
  • Multiboot2 related issues

Usage

Checkout my fork at https://github.com/tttech-industrial-buchsbaum/acrn-hypervisor/tree/debian/1.6 (debian/1.6 branch) and simply run debian/run-docker-build.sh. This will create a Docker image and run the package build in a respective container. The resulting package files are then available in build/debs.

Packages

acrnd_1.6.1-1_amd64.deb: ACRN control daemon
acrnd-dbgsym_1.6.1-1_amd64.deb: Debug symbols of ACRN control daemon
acrn-dev_1.6.1-1_amd64.deb: ACRN header files and libacrn-mngr.a
acrn-devicemodel_1.6.1-1_amd64.deb: ACRN devicemodel
acrn-devicemodel-dbgsym_1.6.1-1_amd64.deb: Debug symbols of ACRN devicemodel
acrn-doc_1.6.1-1_all.deb: ACRN documentation
acrn-hypervisor_1.6.1-1_amd64.deb: ACRN hypervisors
acrn-lifemngr_1.6.1-1_amd64.deb: ACRN lifemngr for UOS
acrn-lifemngr-dbgsym_1.6.1-1_amd64.deb: Debug symbols of ACRN lifemngr
acrn-system_1.6.1-1_amd64.deb: Metapackage to install an ACRN system
acrn-tools_1.6.1-1_amd64.deb: ACRN helper/debugging tools
acrn-tools-dbgsym_1.6.1-1_amd64.deb: Debug symbols of ACRN tools
grub-acrn_1.6.1-1_amd64.deb: Grub setup scripts for ACRN

Other files make up the Debian source package of ACRN.

Build Remarks

ACRN is built as DEBUG version (RELEASE=0), so the ACRN console on the respective serial interface is available.

The acrn-hypervisor package contains ALL possible board/scenario configs which you choose from at install time. This is done using debconf.

The build of the acrn-doc package requires some ACRN kernel files. These are downloaded file by file during build instead of cloning the entire ACRN kernel repository.

Unfortunately there is neither a python3-kconfig nor a python3-sphinx-tab package available for Debian (required for ACRN build). To circumvent these deficiencies you have either to install them via 'pip3 install' on a native build system or use the Dockerfile provided for the build. Whenever there are such packages available, they must be added to the build dependencies for a clean Debian package build!

Installation

On your NUC7i7DN(B/H) or Kontron-COMe-mAL10 based board do:

  • install Debian Buster
  • install an appropriately updated grub package
  • install the ACRN SOS enabled kernel package
  • install acrnd, acrn-devicemodel, grub-acrn and acrn-hypervisor packages: beware to choose the appropriate board/scenario configuration!

Rebooting should now automatically boot ACRN and the Linux ACRN SOS.

  • recommended: switch networking configuration to systemd-networkd
  • optional: install ACRN enabled libvirt

For convenience I provide the respective packages I used during testing
via Dropbox, use them on your own risk:
https://www.dropbox.com/sh/54niwn5rubuuale/AACrdXvpcfXSbdwdudqmzRi6a?dl=0

TODOs

  • Important: Add & resolve issues to get rid of the patches!
  • Rebase/Cherry-Pick the packaging from debian/1.6 to debian/master (and eventually to the upcoming release branch debian/2.0) to be able to build the 'bleeding edge' of ACRN. This work has already been started.
  • Extend this to be able to use it with Ubuntu or any other Debian based distribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions