• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..22-Aug-2025-

acrn-board-inspector/21-Aug-2025-

acrnlog/21-Aug-2025-

configs/21-Aug-2025-

docker/21-Aug-2025-

grub/21-Aug-2025-

lifemngr/21-Aug-2025-

source/21-Aug-2025-

INSTALL.rst A D21-Aug-202519.9 KiB461321

README.rst A D21-Aug-202512.1 KiB320235

acrn-dev.install A D21-Aug-202544 22

acrn-dev.links A D21-Aug-202553 21

acrn-devicemodel.install A D21-Aug-202539 32

acrn-devicemodel.links A D21-Aug-202561 21

acrn-devicemodel.lintian-overrides A D21-Aug-202594 32

acrn-doc-index-html.in A D21-Aug-202593 11

acrn-doc.doc-base A D21-Aug-2025362 119

acrn-doc.install A D21-Aug-202526 21

acrn-doc.links A D21-Aug-202553 21

acrn-hypervisor.config.in A D21-Aug-20251.1 KiB4531

acrn-hypervisor.links A D21-Aug-202560 21

acrn-hypervisor.postinst.in A D21-Aug-20251.5 KiB5536

acrn-hypervisor.postrm.in A D21-Aug-20251.3 KiB5828

acrn-hypervisor.prerm.in A D21-Aug-20251.3 KiB5425

acrn-hypervisor.templates.in A D21-Aug-2025432 1412

acrn-hypervisor.triggers A D21-Aug-202533 21

acrn-lifemngr.install A D21-Aug-202592 43

acrn-lifemngr.links A D21-Aug-202558 21

acrn-lifemngr.lintian-overrides A D21-Aug-202597 32

acrn-lifemngr.postrm A D21-Aug-20251.4 KiB4717

acrn-tools.README.Debian A D21-Aug-2025272 85

acrn-tools.install.debug A D21-Aug-2025395 1615

acrn-tools.links A D21-Aug-202555 21

acrn-tools.lintian-overrides A D21-Aug-2025479 109

acrnd.dirs A D21-Aug-202524 11

acrnd.install A D21-Aug-202597 54

acrnd.links A D21-Aug-202550 21

acrnd.lintian-overrides A D21-Aug-2025128 43

control A D21-Aug-20254.6 KiB158147

copyright A D21-Aug-20251.9 KiB3935

debian_build.sh A D21-Aug-20253.8 KiB132115

gbp.conf A D21-Aug-202535 32

grub-acrn.README.Debian A D21-Aug-20251.4 KiB3222

grub-acrn.install A D21-Aug-202578 22

grub-acrn.postinst A D21-Aug-2025546 3015

grub-acrn.postrm A D21-Aug-20251.1 KiB4315

grub-acrn.triggers A D21-Aug-202533 21

not-installed A D21-Aug-202580 53

python3-acrn-board-inspector.install A D21-Aug-2025290 75

python3-acrn-board-inspector.lintian-overrides A D21-Aug-2025109 22

python3-acrn-board-inspector.postinst A D21-Aug-2025640 3116

python3-acrn-board-inspector.postrm A D21-Aug-20251.2 KiB4516

python3-acrn-board-inspector.trigger A D21-Aug-202533 21

rules A D21-Aug-202517.1 KiB412297

README.rst

1ACRN Debianization
2==================
3
4ACRN is a flexible, lightweight reference hypervisor, built with
5real-time and safety-criticality in mind, optimized to streamline
6embedded development through an open source platform. This part
7represents the debianization for ACRN.
8
9Table of Contents
10-----------------
11
121. `Building <#building>`__
132. `Development Build from Source
14   Package <#development-build-from-source-package>`__
153. `Package Maintenance <#package-maintenance>`__
164. `Special Package Properties <#special-package-properties>`__
175. `About initramfs on Debian/Ubuntu
18   Systems <#about-initramfs-on-debianubuntu-systems>`__
196. `Scenario Configuration - GRUB
20   configuration <#scenario-configuration---grub-configuration>`__
217. `Known Build Warnings <#known-build-warnings>`__
228. `General Remarks and
23   Restrictions <#general-remarks-and-restrictions>`__
24
25The Debian source package ``acrn-hypervisor`` provides the following
26Debian packages:
27
28-  ``acrn-dev``: Public headers and libraries for ACRN manager.
29-  ``acrn-devicemodel``: Device model for ACRN Hypervisor
30-  ``acrn-doc``: Reference to ACRN Documentation
31-  ``acrn-hypervisor``: ACRN Hypervisor for IoT
32-  ``acrn-lifemngr``: ACRN life manager service
33-  ``acrn-system``: metapackage to deploy a minimum of ACRN packages
34-  ``acrn-tools``: Supplementary tools for ACRN Hypervisor
35-  ``acrnd``: ACRN Hypervisor control daemon
36-  ``grub-acrn``: Grub setup scripts for ACRN Hypervisor
37-  ``python3-acrn-board-inspector``: Generate Board Configuration for
38   ACRN
39
40Building
41--------
42
43The ``acrn-hypervisor`` source package uses ``git-buildpackage``
44(``gbp``) for package building (see ``debian/gbp.conf``). For more
45information on ``gbp`` refer to the `Git-Buildpackage
46manual <http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html>`__.
47
48To ease the build process a shell script wrapper around a docker
49controlled build is provided:
50
51::
52
53   debian/docker/acrn-docker-build.sh
54
55This script features the ``DISTRO`` and ``VENDOR`` environment variables
56to set the Debian or Ubuntu distribution the ACRN packages are built
57for. ``VENDOR`` defaults to ``debian`` and ``DISTRO`` defaults to
58``stable``, which then is transformed to its canonical name
59(``bullseye`` for now).
60
61To build ACRN packages on master branch for Debian Buster use:
62
63::
64
65   VENDOR=debian DISTRO=buster debian/docker/acrn-docker-build.sh
66
67or for Ubuntu 20.04:
68
69VENDOR=ubuntu DISTRO=focal debian/docker/acrn-docker-build.sh
70
71If building on any other branch, the ``debian/gbp.conf`` file has to be
72adapted accordingly. To override this necessity simply add a
73``--git-ignore-branch``:
74
75::
76
77   debian/docker/acrn-docker-build.sh --git-ignore-branch
78
79This not only builds the ACRN packages listed above, but eventually all
80required packages (for build or runtime), too.
81
82Remark: Since the required, dependent package repositories are accessed
83at build time, your build machine needs a properly configured internet
84access.
85
86All these build results including the required third party packages are
87located in the ``build/<distroname>`` folder and prepared to be used as
88a local APT repository. To use it as such, add a proper apt
89configuration (assuming the result folder has been copied to ``/apt``):
90
91::
92
93   echo "deb [trusted=yes] file:/apt ./" > /etc/apt/sources.list.d/acrn-local.list
94   echo "deb-src [trusted=yes] file:/apt ./" >> /etc/apt/sources.list.d/acrn-local.list
95
96Now ``apt update`` will also take into account all the local packages,
97so you can easily install, e.g. board-inspector via:
98
99::
100
101   apt install python3-acrn-board-inspector
102
103This will install python3-acrn-board-inspector with all required
104dependencies.
105
106Development Build from Source Package
107-------------------------------------
108
109Once the local APT repository is in place, it can also be used to
110quickly create proprietary built ACRN packages from the acrn-hypervisor
111soure package, e.g. to add a new scenario for testing or change the list
112of supported board. Many thanks to Pirouf for bringing in this idea!
113
114::
115
116   apt-get install devscripts build-essential
117   cd <working dir>
118   apt-get source acrn-hypervisor
119   apt-get build-dep acrn-hypervisor
120   cd acrn-hypervisor-<version>
121
122Now you can make your changes, e.g. use a new board and scenario, preferrably using ``debian/config`` as a hook directory for proprietary configurations, see also `debian/configs/README.rst <configs/README.rst>`__:
123
124::
125
126   mkdir -p debian/config/newboard
127   cp <user>/newboard.xml debian/config/newboard/newboard.xml
128   cp <user>/newscenario.xml debian/config/newboard/newscenario.xml
129   cat << EOF > debian/config/configurations.mk
130   ACRN_BOARDLIST += newboard
131   ACRN_SCENARIOLIST += newscenario
132   EOF
133   dpkg-buildpackage
134
135The resulting packages are then located in ``<working dir>``.
136
137Package Maintenance
138-------------------
139
140During development ``debian/changelog`` should always present the
141``UNRELEASED`` stage of package build. Before creating new (temporary)
142packages ``debian/changelog`` can be easily updated using
143
144::
145
146   DEBEMAIL="<add your email here> DEBFULLNAME="<enter your full name here>" gbp dch --snapshot --git-ignore-branch
147
148This updates/creates an ``UNRELEASED`` changelog entry, which has to be
149committed separately. BTW, I always use the following to align with what
150is already configured in git:
151
152::
153
154   DEBEMAIL=$(git config user.email) DEBFULLNAME=$(git config user.name) gbp dch --snapshot --git-ignore-branch
155
156At release create a proper entry using
157
158::
159
160   DEBEMAIL="<add your email here> DEBFULLNAME="<enter your full name here>" gbp dch --release
161
162This fires up the editor to review the newly created
163``debian/changelog`` entry. Edit, save and commit it to finish the
164package release from a Debian point of view.
165
166Special Package Properties
167--------------------------
168
169acrn-hypervisor
170~~~~~~~~~~~~~~~
171
172This package contains multiple ACRN hypervisor binaries, with the final
173binary being chosen usually at install time via Debian’s ``debconf``
174mechanism. This allows you to choose the board as well as the respective
175scenario but still use the same Debian package for various hardware
176platforms.
177
178**WARNING**
179
180Always choose an appropriate board/scenario setting! Wrong settings may
181refuse to boot!
182
183You can also preseed your choice by setting the respective ``debconf``
184keys ``acrn-hypervisor/board`` and ``acrn-hypervisor/scenario``,
185e.g. during image creation. Please refer to
186https://wiki.debian.org/debconf for details.
187
188To reconfigure the choice later, use
189
190::
191
192   dpkg-reconfigure acrn-hypervisor
193
194The ACRN hypervisor configurations are chosen as follows: All
195directories given in ``CONFIGDIRS`` in ``acrn-hypervisor.conf.mk`` are
196searched for valid board- and scenario-configuration files. The
197``ACRN_BOARDLIST`` and ``ACRN_SCENARIOLIST`` in
198``acrn-hypervisor.conf.mk`` can be used to restrict the
199hypervisor/scenario configurations built into ``acrn-hypervisor``
200package. If unset, all possible configurations found under the
201directories given are built.
202
203acrn-lifemngr
204~~~~~~~~~~~~~
205
206To adapt the needs of a Debian distribution the service file has been
207adapted and a start script wrapper added to automatically set up the
208parameters for User VMs or the Service VM.
209
210acrnd
211~~~~~
212
213There is also an adapted variant for the systemd service file. As for
214``acrn-lifemngr`` this also is provided as part of the Debian packaging
215process rather than patching the files provided with the sources.
216
217About initramfs on Debian/Ubuntu Systems
218----------------------------------------
219
220If the ``ramdisk_mod`` node in the scenario configuration is empty (at
221the moment this is true especially for all ``shared`` scenarios), an
222initrd/initramfs image is neither required nor used. Grub config helper
223then creates a rootfs parameter using the respective device name at
224install time, like ``/dev/sda2``. Since this depends on device
225enumeration of the kernel, which might change when additional storage
226devices are added (your ``/dev/sda2`` might turn into
227e.g. ``/dev/sdb2``, but your grub configuration stays unchanged!)
228Debian/Ubuntu decided to use UUIDs to identify the storage device
229partitions. This is implemented by respective scripts provided in
230initrd/initramfs and **NOT** within the kernel, so apparently
231initrd/initramfs is required!
232
233To use this feature properly (as the standard distribution setup does)
234add a ``ramdisk_mod`` node value (usually ``Linux_initrd``) in the
235scenario configuration and provide a kernel package with
236initrd/initramfs support. This is state-of-the-art nowadays and also
237supported by the acrn-kernel service vm configuration. It enables the
238UUID boot device support and avoids the device enumeration issues
239completely, see the ``shared+initrd`` scenarios in ``debian/configs``
240for an example.
241
242Scenario Configuration - GRUB configuration
243-------------------------------------------
244
245The following subnodes of the ``SERVICE_VM`` node (VM with
246``load_order=SERVICE_VM``) are considered by grub-acrn when creating the
247GRUB menu entries for ACRN:
248
249-  ``kern_mod`` must not be empty to add a menu entry
250-  ``ramdisk_mod`` enables initrd/initramfs image usage (see above)
251-  ``bootargs``: kernel boot parameters, that are added to the kernel
252   boot command line. Exception: ``rootfs`` parameter is ignored, since
253   this is automatically determined by GRUB config helpers. This can be
254   used e.g. to add ``hvlog`` parameter for logging support.
255
256Known Build Warnings
257--------------------
258
259Depending to which distribution the build is targeted, the following
260warnings can occur, but can safely be ignored:
261
262-  in ``override_dh_strip`` build stage:
263
264   These warnings only occur in builds for the most recent
265   distributions, but do not harm the binary packages. The usability of
266   dbgsym packages is questionable in this case (untested).
267
268   -  ``debugedit: .debug_line offset 0xXXXX referenced multiple times``
269   -  ``Unknown DWARF DW_FORM 0xXXXX``
270
271-  in ``override_dh_auto_build-indep`` build stage:
272
273   -  ``package init file '<...>/__init__.py' not found (or not a regular file)``
274
275   This is a result of the the python components not being structured
276   for packaging with setuptools. The warnings are harmless and do not
277   imply any restrictions to the python packages.
278
279-  in ``override_dh_auto_install-arch`` build stage
280
281   -  ``/usr/bin/ld: <...>/boot_mod.a(cpu_primary.o): warning: relocation in read-only section 'multiboot_header'``
282
283   This warning is emitted on all but the oldest distros (gcc/binutils
284   version dependent?). **This might be of concern and must be
285   investigated.** Up till now, no issues have been found when using the
286   binaries triggering this warning.
287
288-  lintian
289
290   -  ``elf-error In program headers: Unable to find program interpreter name``
291
292   This is a known issue, see `Debian
293   Bug#1000977 <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000977>`__
294   and `Debian
295   Bug#1000449 <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000449>`__.
296
297General Remarks and Restrictions
298--------------------------------
299
300-  ACRN >=2.6 needs a Linux 5.10 kernel with the respective Intel/ACRN
301   patches applied, see `Project ACRN
302   Documentation <https://projectacrn.github.io/latest/index.html>`__
303   for details.
304-  The packages are built in debug mode to be able to access the HV
305   console. This can be changed by setting the ``RELEASE`` variable in
306   ``debian/rules`` to 1.
307-  The built configurations are restricted to the hardware platforms
308   available for testing.
309-  The systemd services provided by various ACRN packages are enabled at
310   install time but not started, since they are most likely installed on
311   a non-ACRN system which requires a reboot anyway. Only the acrn-tools
312   related services (acrnlog, acrnprobe, usercrash) might be installed
313   on a running ACRN system and then either need a reboot or must be
314   started manually (``systemd start <service name>``).
315-  acrn-configurator is still under heavy development and therefore not
316   yet packaged.
317
318-- Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
319Sat, 06 May 2022 20:07:19 +0200
320