debian: Fixup ACRN lifemngr package build

Part of fix for
https://github.com/tttech-industrial-buchsbaum/acrn-hypervisor/issues/6

Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
This commit is contained in:
Helmut Buchsbaum
2022-05-03 11:29:05 +02:00
committed by acrnsi-robot
parent a22d0497d7
commit f792336c1c
8 changed files with 97 additions and 38 deletions

View File

@@ -1,9 +0,0 @@
# ACRN lifemngr invocation configuration file
# set the following items accordingly to override default:
# Use 'sos' or 'uos' here. Usually detect automatically.
# LIFEMNGR_VM=<vm type>
# Use the respective serial port here:
# LIFEMNGR_TTY=<serial port device>

20
debian/lifemngr/life_mngr.conf.user_vm vendored Normal file
View File

@@ -0,0 +1,20 @@
# The VM type of a VM which lifecycle manager will run on
# -service_vm the lifecycle manager will be run on the service VM
# -user_vm the lifecycle manager will be run on the user VM
VM_TYPE=user_vm
# The VM name of a VM which lifecycle manager will run on, the name should
# be unique in the whole system, this name will be embedded log message to
# help user to do system debugging.
VM_NAME=user_VM
# The device type and device names of the devices which are used to
# communicate with other VMs in lifecycle manager.
# For user VM, the default value is tty:/dev/ttyS1;
#
# For service VM, the default setting rule of this field: /dev/ttyS8 is to
# communicate with VM1 (VM ID in hypervisor = 1), /dev/ttyS9 is for VM2 (VM ID is 2),
# /dev/ttyS10 is for VM3 (VM ID is 3) ... /dev/ttyS14 is for VM7 (VM ID is 7)
# note: need to double check related communication vuarts are valid in hypervisor scenario config
# file.
DEV_NAME=tty:/dev/ttyS1

View File

@@ -1,14 +1,16 @@
#!/bin/sh
# helper to start ACRN lifemnr according to VM type
LIFEMNGR_CONF=/usr/share/acrn-lifemngr/acrn-lifemngr.conf
# must coincide with fixed coding in
# misc/services/life_mngr/config.h
LIFE_MNGR_CONFIG_PATH="/etc/life_mngr/life_mngr.conf"
# distinguish service/user VM
LIFEMNGR_VM=${LIFEMNGR_VM:-$(if [ -c /dev/acrn_hsm ]; then echo service_vm; else echo user_vm; fi)}
# eventually include configuration for overriding default configuration
if [ -f ${LIFEMNGR_CONF} ]; then
. ${LIFEMNGR_CONF}
# eventually install default configuration
if [ ! -f ${LIFE_MNGR_CONFIG_PATH} ]; then
mkdir -p $(dirname ${LIFE_MNGR_CONFIG_PATH})
cp /usr/share/acrn-lifemngr/life_mngr.conf.${LIFEMNGR_VM} ${LIFE_MNGR_CONFIG_PATH}
fi
LIFEMNGR_VM=${LIFEMNGR_VM:-$(if [ -c /dev/acrn_hsm ]; then echo sos; else echo uos; fi)}
LIFEMNGR_TTY=${LIFEMNGR_TTY:-/dev/ttyS1}
/usr/bin/acrn-lifemngr ${LIFEMNGR_VM} ${LIFEMNGR_TTY}
exec /usr/bin/acrn-lifemngr