All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support
@ 2020-12-03 11:59 Diego Sueiro
  2020-12-03 11:59 ` [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file Diego Sueiro
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Diego Sueiro @ 2020-12-03 11:59 UTC (permalink / raw)
  To: meta-arm; +Cc: nd, Kamil Dziezyk

From: Kamil Dziezyk <kamil.dziezyk@arm.com>

With this patch user can set DISK_DEVICE for guest image.
If guest disk configuration contains DISK_DEVICE setting,
xenguest-manager uses that disk for this guest, insted of default one,
that is set with XENGUEST_VOLUME_DEVICE in xenguest-manager.conf file.
DISK_DEVICE is not set by deafult.

Change-Id: If400850f60097d38339e76a3d18fc0e2b927f3a0
Issue-Id: SCM-1513
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
---
 .../classes/xenguest-image.bbclass            |   8 ++
 .../documentation/xenguest-mkimage.md         |   5 +
 .../xenguest/files/xenguest-manager           | 104 +++++++++++-------
 .../xenguest/xenguest-manager.bb              |   2 +-
 4 files changed, 79 insertions(+), 40 deletions(-)

diff --git a/meta-arm-autonomy/classes/xenguest-image.bbclass b/meta-arm-autonomy/classes/xenguest-image.bbclass
index 8c6b141..5e5c4c7 100644
--- a/meta-arm-autonomy/classes/xenguest-image.bbclass
+++ b/meta-arm-autonomy/classes/xenguest-image.bbclass
@@ -43,6 +43,9 @@ XENGUEST_IMAGE_KERNEL ??= "Image"
 # be included in the xenguest image)
 XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
 
+# set empty partition to be used by xenguest-manager for this image
+XENGUEST_IMAGE_DISK_DEVICE ??= ""
+
 #
 # XENGUEST_IMAGE_DISK_PARTITIONS is used to describe the partitions to setup
 # and their content.
@@ -142,6 +145,11 @@ xenguest_image_create() {
                     call_xenguest_mkimage update --disk-add-part=$arg
                 done
             fi
+            diskdevice="${XENGUEST_IMAGE_DISK_DEVICE}"
+            if [ -n "$diskdevice" ]; then
+                call_xenguest_mkimage update --disk-device="${diskdevice}"
+            fi
+
             ;;
     esac
 
diff --git a/meta-arm-autonomy/documentation/xenguest-mkimage.md b/meta-arm-autonomy/documentation/xenguest-mkimage.md
index d7baa2e..fd142b7 100644
--- a/meta-arm-autonomy/documentation/xenguest-mkimage.md
+++ b/meta-arm-autonomy/documentation/xenguest-mkimage.md
@@ -66,6 +66,11 @@ The file contains the following entries:
   and extract CONTENT as initial partition content (.tar[.gz|.xz|.bz2] file
   or img[.gz|.bz2] file to be dumped in the partition).
   FS and CONTENT can be empty.
+- `DISK_DEVICE=X`: disk or partition to be used by lvm. Setting this option
+  allows to bind guest disk with any partition or disk available on host,
+  e.g. /dev/sda3 or /dev/sdb.
+  This variable is not set by default, but if set, it overrides disk settings
+  inside xenguest-manager.conf - 'XENGUEST_VOLUME_DEVICE'.
 
 The disk-files contain files to be used for initializing the disk partitions
 content. Those should be used to create a LVM or a physical disk and initialize
diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
index cc55b26..fafe4a0 100755
--- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
+++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
@@ -116,51 +116,56 @@ function xenguest_volume_init()
     # Return:
     # 0 - success
     # 1 - failure
-
-    check_private
-
-    if [ -z "${XENGUEST_VOLUME_DEVICE:-}" -o \
-        ! -b ${XENGUEST_VOLUME_DEVICE:-} ]; then
-        echo "${PREF} Invalid volume device in configuration: ${XENGUEST_VOLUME_DEVICE:-}"
-        return 1
+    local diskdevice
+    local volumename
+
+    if [ -z "${DISK_DEVICE}" ]; then
+        # By default guest is using disk defined inside xenguest-manager.conf
+        diskdevice="${XENGUEST_VOLUME_DEVICE}"
+        volumename="${XENGUEST_VOLUME_NAME}"
+    else
+        # If guest configuration contains custom disk setting,
+        # overwrite default one
+        diskdevice="${DISK_DEVICE}"
+        volumename="vg-xen-$(basename ${diskdevice})"
     fi
 
-    if [ -z "${XENGUEST_VOLUME_NAME:-}" ]; then
-        echo "${PREF} No volume name in configuration, using vg-xen..."
-        XENGUEST_VOLUME_NAME="vg-xen"
+    if [ -z "${diskdevice}" -o ! -b "${diskdevice}" ]; then
+        echo "${PREF} Invalid volume device in configuration: ${diskdevice}"
+        return 1
     fi
 
-    pvs ${XENGUEST_VOLUME_DEVICE} > /dev/null 2>&1
+    pvs "${diskdevice}" > /dev/null 2>&1
     if [ $? -ne 0 ]; then
         # Check if there is no filesystem in the block device
-        echo "lsblk -n -o FSTYPE ${XENGUEST_VOLUME_DEVICE}" >> ${LOGFILE} 2>&1
-        filesystem=$(lsblk -n -o FSTYPE ${XENGUEST_VOLUME_DEVICE} 2>> ${LOGFILE})
+        echo "lsblk -n -o FSTYPE ${diskdevice}" >> ${LOGFILE} 2>&1
+        filesystem=$(lsblk -n -o FSTYPE "${diskdevice}" 2>> ${LOGFILE})
         if [[ $? -eq 0 && -z "$filesystem" ]]; then
-            echo "${PREF} Initialize lvm on ${XENGUEST_VOLUME_DEVICE}"
-            echo "pvcreate -f ${XENGUEST_VOLUME_DEVICE}" >> ${LOGFILE} 2>&1
-            pvcreate -f ${XENGUEST_VOLUME_DEVICE} >> ${LOGFILE} 2>&1
+            echo "${PREF} Initialize lvm on ${diskdevice}"
+            echo "pvcreate -f ${diskdevice}" >> ${LOGFILE} 2>&1
+            pvcreate -f "${diskdevice}" >> ${LOGFILE} 2>&1
             if [ $? -ne 0 ]; then
                 echo "${PREF} Error: initialing lvm on " \
-                     "${XENGUEST_VOLUME_DEVICE} failed." | tee -a ${LOGFILE}
+                     "${diskdevice} failed." | tee -a ${LOGFILE}
                 return 1
             fi
         else
             [ -z "$filesystem" ] || \
-                echo "${PREF} Error: The ${XENGUEST_VOLUME_DEVICE} is already " \
+                echo "${PREF} Error: The ${diskdevice} is already " \
                      "formatted as $filesystem." | tee -a ${LOGFILE}
             return 1
         fi
     fi
 
-    vgs ${XENGUEST_VOLUME_NAME} > /dev/null 2>&1
+    vgs "${volumename}" > /dev/null 2>&1
     if [ $? -ne 0 ]; then
-        echo "${PREF} Create ${XENGUEST_VOLUME_NAME} volume"
-        echo "vgcreate ${XENGUEST_VOLUME_NAME} ${XENGUEST_VOLUME_DEVICE}" \
+        echo "${PREF} Create ${volumename} volume"
+        echo "vgcreate ${volumename} ${diskdevice}" \
             >> ${LOGFILE} 2>&1
-        vgcreate ${XENGUEST_VOLUME_NAME} ${XENGUEST_VOLUME_DEVICE} \
+        vgcreate "${volumename}" "${diskdevice}" \
             >> ${LOGFILE} 2>&1
         if [ $? -ne 0 ]; then
-            echo "${PREF} Error: creating ${XENGUEST_VOLUME_NAME} volume " \
+            echo "${PREF} Error: creating ${volumename} volume " \
                  "failed."  | tee -a ${LOGFILE}
             return 1
         fi
@@ -201,9 +206,19 @@ function xenguest_disk_init()
 
     guestname="$1"
     guestfile="$2"
-    devname="/dev/${XENGUEST_VOLUME_NAME}/${guestname}"
 
     source ${XENGUEST_CONF_BASE}/guests/${guestname}/disk.cfg
+    if [ -z "${DISK_DEVICE}" ]; then
+        # By default guest is using disk defined inside xenguest-manager.conf
+        diskdevice="${XENGUEST_VOLUME_DEVICE}"
+        volumename="${XENGUEST_VOLUME_NAME}"
+    else
+        # If guest configuration contains custom disk setting,
+        # overwrite default one
+        diskdevice="${DISK_DEVICE}"
+        volumename="vg-xen-$(basename ${diskdevice})"
+    fi
+    devname="/dev/${volumename}/${guestname}"
 
     DISK_SIZE=$(check_size "${DISK_SIZE}")
     if [ -z "${DISK_SIZE}" ] || [ "${DISK_SIZE}" = "0M" ]; then
@@ -224,11 +239,11 @@ function xenguest_disk_init()
 
 
     # Remove volume if it already exist
-    echo "lvs ${XENGUEST_VOLUME_NAME}/${guestname}"  >> ${LOGFILE} 2>&1
-    lvs ${XENGUEST_VOLUME_NAME}/${guestname} >> ${LOGFILE} 2>&1
+    echo "lvs ${volumename}/${guestname}"  >> ${LOGFILE} 2>&1
+    lvs "${volumename}/${guestname}" >> ${LOGFILE} 2>&1
     if [ $? -eq 0 ]; then
         echo "lvremove -y ${devname}" >> ${LOGFILE} 2>&1
-        lvremove -y ${devname} >> ${LOGFILE} 2>&1
+        lvremove -y "${devname}" >> ${LOGFILE} 2>&1
         if [ $? -ne 0 ]; then
             echo "${PREF} Error removing volume ${guestname}"
             return 1
@@ -236,9 +251,9 @@ function xenguest_disk_init()
     fi
 
     # Create volume
-    echo "lvcreate -y -L ${DISK_SIZE} -n ${guestname} ${XENGUEST_VOLUME_NAME}" \
+    echo "lvcreate -y -L ${DISK_SIZE} -n ${guestname} ${volumename}" \
         >> ${LOGFILE} 2>&1
-    lvcreate -y -L ${DISK_SIZE} -n ${guestname} ${XENGUEST_VOLUME_NAME} \
+    lvcreate -y -L "${DISK_SIZE}" -n "${guestname}" "${volumename}" \
         >> ${LOGFILE} 2>&1
     if [ $? -ne 0 ]; then
         echo "${PREF} Error creating volume ${guestname}"
@@ -247,7 +262,7 @@ function xenguest_disk_init()
 
     # Add partition table
     echo "parted -s ${devname} mklabel msdos" >> ${LOGFILE} 2>&1
-    parted -s ${devname} mklabel msdos >> ${LOGFILE} 2>&1
+    parted -s "${devname}" mklabel msdos >> ${LOGFILE} 2>&1
     if [ $? -ne 0 ]; then
         echo "${PREF} Error creating partition table on ${guestname}"
         return 1
@@ -256,8 +271,8 @@ function xenguest_disk_init()
     # Setup disk name in xen configuration
     echo "xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname}" \
         "--xen-disk=${devname}" >> ${LOGFILE} 2>&1
-    xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname} \
-        --xen-disk=${devname} >> ${LOGFILE} 2>&1
+    xenguest-mkimage update "${XENGUEST_CONF_BASE}/guests/${guestname}" \
+        "--xen-disk=${devname}" >> ${LOGFILE} 2>&1
     if [ $? -ne 0 ]; then
         echo "${PREF} Error setting disk in xen configuration"
         return 1
@@ -311,8 +326,8 @@ function xenguest_disk_init()
             # Create partition
             echo "parted -s ${devname} unit MB mkpart primary ${partstart}" \
                 "${partend}" >> ${LOGFILE} 2>&1
-            parted -s ${devname} unit MB mkpart primary ${partstart} \
-                ${partend} >> ${LOGFILE} 2>&1
+            parted -s "${devname}" unit MB mkpart primary "${partstart}" \
+                "${partend}" >> ${LOGFILE} 2>&1
             if [ $? -ne 0 ]; then
                 echo "${PREF} Error adding partition ${part}"
                 return 1
@@ -346,7 +361,7 @@ function xenguest_disk_init()
 
             # Attach disk to xen
             echo "xl block-attach 0 phy:${devname} xvda w" >> ${LOGFILE} 2>&1
-            xl block-attach 0 phy:${devname} xvda w >> ${LOGFILE} 2>&1
+            xl block-attach 0 "phy:${devname}" xvda w >> ${LOGFILE} 2>&1
             if [ $? -ne 0 ]; then
                 echo "${PREF} Error attaching partition ${part}"
                 return 1
@@ -528,16 +543,27 @@ function xenguest_guest_remove()
     check_private
 
     guestname="$1"
-    devname="/dev/${XENGUEST_VOLUME_NAME}/${guestname}"
+    source ${XENGUEST_CONF_BASE}/guests/${guestname}/disk.cfg
+    if [ -z "${DISK_DEVICE}" ]; then
+        # By default guest is using disk defined inside xenguest-manager.conf
+        diskdevice="${XENGUEST_VOLUME_DEVICE}"
+        volumename="${XENGUEST_VOLUME_NAME}"
+    else
+        # If guest configuration contains custom disk setting,
+        # overwrite default one
+        diskdevice="${DISK_DEVICE}"
+        volumename="vg-xen-$(basename ${diskdevice})"
+    fi
+    devname="/dev/${volumename}/${guestname}"
 
     # check if guest had a volume
-    echo "lvs ${XENGUEST_VOLUME_NAME}/${guestname}"  >> ${LOGFILE} 2>&1
-    lvs ${XENGUEST_VOLUME_NAME}/${guestname} >> ${LOGFILE} 2>&1
+    echo "lvs ${volumename}/${guestname}"  >> ${LOGFILE} 2>&1
+    lvs ${volumename}/${guestname} >> ${LOGFILE} 2>&1
     if [ $? -eq 0 ]; then
         # Remove guest volume
         echo "${PREF} Removing ${guestname} volume. This might take a while..."
         echo "lvremove -y ${devname}" >> ${LOGFILE} 2>&1
-        lvremove -y ${devname} >> ${LOGFILE} 2>&1
+        lvremove -y "${devname}" >> ${LOGFILE} 2>&1
         if [ $? -ne 0 ]; then
             echo "${PREF} Error removing volume ${guestname}"
             exit 1
diff --git a/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb b/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb
index 9c29bde..c55d879 100644
--- a/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb
+++ b/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb
@@ -17,7 +17,7 @@ S = "${WORKDIR}"
 # Please refer to documentation/xenguest-manager.md for documentation on those
 # parameters
 XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
-XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen"
+XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen-$(basename ${XENGUEST_MANAGER_VOLUME_DEVICE})"
 XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
 
 # We add an init script to create and start guests automatically
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file
  2020-12-03 11:59 [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Diego Sueiro
@ 2020-12-03 11:59 ` Diego Sueiro
  2021-01-08 10:58   ` Diego Sueiro
  2020-12-03 11:59 ` [PATCH 3/4] arm-autonomy/autonomy-host: add user defined partition to wic image Diego Sueiro
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Diego Sueiro @ 2020-12-03 11:59 UTC (permalink / raw)
  To: meta-arm; +Cc: nd, Kamil Dziezyk

From: Kamil Dziezyk <kamil.dziezyk@arm.com>

This patch also appends 'wic wic.gz wic.bmap' images,
to IMAGE_FSTYPES.

WKS file contains two partition entries:
 * first is rootfs partition
 * second is empty partition (4 GiB by default)

Issue-Id: SCM-1520
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: Ic0c79ee5eb4b08ad8f9c133b267feda1c85519a3
---
 .../conf/machine/juno-extra-settings.inc      | 20 +++++++++++++++++++
 .../wic/arm-autonomy-juno-disk.wks.in         | 11 ++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in

diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
index 110865d..ec7ed35 100644
--- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
@@ -3,3 +3,23 @@
 # Juno board has 2 network interfaces, add both of them to the bridge
 XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
 XEN_DEVICETREE_DOM0_SIZE ?= "0x02400000"
+
+# We need to extend the wks search path to be able to find the wks file set in
+# ARM_AUTONOMY_WKS_FILE.
+WKS_SEARCH_PATH_prepend := "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic:"
+
+ARM_AUTONOMY_WKS_FILE ?= "arm-autonomy-juno-disk.wks.in"
+# set wks file only if INITRAMFS_IMAGE_BUNDLE is not set
+WKS_FILE = "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
+                                 '${ARM_AUTONOMY_WKS_FILE}', d)}"
+
+# Set the wks guest partition size and unit. It must be aligned with the sum of
+# all XENGUEST_IMAGE_DISK_SIZE set for the guests. By default, LVM2 metadata is
+# 1 MiB per physical volume, hence it needs to be taken into account when
+# setting GUEST_PART_SIZE. The XENGUEST_IMAGE_DISK_SIZE default value is 4GiB.
+GUEST_PART_SIZE ?= "4097"
+GUEST_PART_SIZE_UNIT ?= "M"
+
+# set wic image type only if INITRAMFS_IMAGE_BUNDLE is not set
+IMAGE_FSTYPES += "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
+                                       'wic wic.gz wic.bmap', d)}"
diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
new file mode 100644
index 0000000..5c5b24a
--- /dev/null
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
@@ -0,0 +1,11 @@
+# short-description: Create a disk image
+# long-description: Creates a partitioned disk image that the user
+# can directly dd to boot media.
+
+# For Juno first partition is rootfs normally populated as /dev/sda1
+part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
+
+# Second partition to accomodate guests images normally populated as /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
+part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
+
+bootloader --ptable msdos
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] arm-autonomy/autonomy-host: add user defined partition to wic image
  2020-12-03 11:59 [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Diego Sueiro
  2020-12-03 11:59 ` [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file Diego Sueiro
@ 2020-12-03 11:59 ` Diego Sueiro
  2021-01-08 10:58   ` Diego Sueiro
  2020-12-03 11:59 ` [PATCH 4/4] arm-autonomy/juno-firmware: add compressed kernel support Diego Sueiro
  2020-12-07 18:32 ` [meta-arm] [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Jon Mason
  3 siblings, 1 reply; 9+ messages in thread
From: Diego Sueiro @ 2020-12-03 11:59 UTC (permalink / raw)
  To: meta-arm; +Cc: nd, Kamil Dziezyk

From: Kamil Dziezyk <kamil.dziezyk@arm.com>

With this patch user can define additional partition entry,
via AUTONOMY_HOST_EXTRA_PARTITION variable.

Issue-Id: SCM-1514
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Change-Id: Ic103a40de44ea6cd88caa60f06033a9c678b265f
---
 .../documentation/arm-autonomy-multiconfig.md | 34 +++++++++++++++++++
 .../wic/arm-autonomy-juno-disk.wks.in         |  3 ++
 .../wic/arm-autonomy-n1sdp-efidisk.wks.in     |  3 ++
 3 files changed, 40 insertions(+)

diff --git a/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md b/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
index 8c33501..4f4bb74 100644
--- a/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
+++ b/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
@@ -159,3 +159,37 @@ and everything between `---Guest Config Start---` and
 Any copies of variables that start `MC_GUEST` must be altered to avoid
 collisions (e.g. `MC_GUEST_2_*`), and the name of the conf file must also
 be added to BBMULTICONFIG.
+
+
+Guest with provisioned disk
+----------------
+
+To add guest rootfs partition to host wic image,
+set `AUTONOMY_HOST_EXTRA_PARTITION` with proper wks partition entry, e.g:
+
+```
+AUTONOMY_HOST_EXTRA_PARTITION = "part --label provisioned-guest --source rawcopy --fstype=ext4 --ondisk sda --align 1024 \
+--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
+```
+
+inside host.conf file.
+
+The rest of the configuration has to be appended to guest.conf file:
+
+```
+XENGUEST_IMAGE_DISK_SIZE = "0"
+XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
+XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
+XENGUEST_IMAGE_ROOT = "/dev/xvda"
+IMAGE_ROOTFS_SIZE = "102400"
+IMAGE_FSTYPES = "ext4"
+```
+
+content of rootdisk.cfg"
+
+```
+disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
+```
+
+`_GUEST_DISK_DEVICE_` should be substituted with `/dev/sdaX`,
+according to wks file.
diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
index 5c5b24a..bfacb20 100644
--- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
@@ -8,4 +8,7 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
 # Second partition to accomodate guests images normally populated as /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
 part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
 
+# Third partition is user defined entry normally populated as /dev/sda3
+${AUTONOMY_HOST_EXTRA_PARTITION}
+
 bootloader --ptable msdos
diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in
index ded628c..b48ec77 100644
--- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in
@@ -11,4 +11,7 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
 # Third partition to accomodate guests images normally populated as /dev/sda3 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
 part --label guests --source empty --ondisk sda --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
 
+# Fourth partition is user defined entry normally populated as /dev/sda4
+${AUTONOMY_HOST_EXTRA_PARTITION}
+
 bootloader --ptable msdos --configfile="${GRUB_CFG_FILE}"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] arm-autonomy/juno-firmware: add compressed kernel support
  2020-12-03 11:59 [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Diego Sueiro
  2020-12-03 11:59 ` [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file Diego Sueiro
  2020-12-03 11:59 ` [PATCH 3/4] arm-autonomy/autonomy-host: add user defined partition to wic image Diego Sueiro
@ 2020-12-03 11:59 ` Diego Sueiro
  2021-01-08 10:58   ` Diego Sueiro
  2020-12-07 18:32 ` [meta-arm] [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Jon Mason
  3 siblings, 1 reply; 9+ messages in thread
From: Diego Sueiro @ 2020-12-03 11:59 UTC (permalink / raw)
  To: meta-arm; +Cc: nd, Kamil Dziezyk, Diego Sueiro

From: Kamil Dziezyk <kamil.dziezyk@arm.com>

This patch adds support for lzma compressed kernel,
by setting KERNEL_ALT_IMAGETYPE to 'Image.lzma' and
adding additional decompression step during u-boot boot stage.

U-boot automatic Image decompression cannot be used here,
because if xen binary is the target of 'booti' command,
Image is not being decompressed neither by u-boot nor by xen.

Lzma compression is supported in u-boot with 'lzmadec' command,
and does not require setting additional dependencies inside kernel recipe.

Change-Id: I51b9aea962f8905f88b60ac28e71017c7d500189
Issue-Id: SCM-1769
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
 .../conf/machine/juno-extra-settings.inc      |  1 +
 .../images/firmware-image-juno.bbappend       |  8 +++
 .../firmware-image-juno/add-xen-support.patch | 69 ++++++++++++++-----
 3 files changed, 60 insertions(+), 18 deletions(-)

diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
index ec7ed35..f8a16f4 100644
--- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
@@ -1,4 +1,5 @@
 # Extra machine settings for juno
+KERNEL_ALT_IMAGETYPE = "Image.lzma"
 
 # Juno board has 2 network interfaces, add both of them to the bridge
 XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend
index 847e252..6b94dc9 100644
--- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend
@@ -39,4 +39,12 @@ do_deploy_prepend_xen() {
     done
 
     bbnote "Xen binaries added under SOFTWARE/XEN directory"
+
+    if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" -a "${KERNEL_ALT_IMAGETYPE}" = "Image.lzma" ]; then
+        # KERNEL_ALT_IMAGETYPE is expected to be Image.lzma,
+        # however NOR flash filesystem is DOS compatible with 8.3 naming,
+        # so we need to replace ".lzma" with ".lzm"
+        cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_ALT_IMAGETYPE} \
+                 ${D}/${UNPACK_DIR}/SOFTWARE/Image.lzm
+    fi
 }
diff --git a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch
index 04098e1..29f1e06 100644
--- a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch
+++ b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch
@@ -9,9 +9,9 @@ It also adds customization for uEnv.txt file, that allows to autoboot xen.
 Upstream-Status: Inappropriate [configuration]
 Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
 
-diff -r -u a/images-r0.txt b/images-r0.txt
---- a/images-r0.txt	2020-11-13 17:26:27.945942230 +0100
-+++ b/images-r0.txt	2020-11-13 17:26:43.221881902 +0100
+diff -u a/images-r0.txt b/images-r0.txt
+--- a/images-r0.txt	2020-11-25 20:25:38.677687712 +0100
++++ b/images-r0.txt	2020-11-25 20:36:55.482194294 +0100
 @@ -1,7 +1,7 @@
  TITLE: Versatile Express Images Configuration File
  
@@ -21,7 +21,16 @@ diff -r -u a/images-r0.txt b/images-r0.txt
  
  NOR0UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
  NOR0ADDRESS: 0x00000000          ;Image Flash Address
-@@ -24,7 +24,7 @@
+@@ -17,14 +17,14 @@
+ 
+ NOR2UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
+ NOR2ADDRESS: 0x00500000          ;Image Flash Address
+-NOR2FILE: \SOFTWARE\Image        ;Image File Name
+-NOR2NAME: norkern                ;Rename kernel to norkern
++NOR2FILE: \SOFTWARE\Image.lzm    ;Image File Name
++NOR2NAME: norkern.lzm            ;Rename kernel to norkern.lzm
+ NOR2LOAD: 00000000               ;Image Load Address
+ NOR2ENTRY: 00000000              ;Image Entry Point
  
  NOR3UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
  NOR3ADDRESS: 0x02900000          ;Image Flash Address
@@ -46,9 +55,9 @@ diff -r -u a/images-r0.txt b/images-r0.txt
 +NOR10NAME: xen
 +NOR10LOAD: 00000000              ;Image Load Address
 +NOR10ENTRY: 00000000             ;Image Entry Point
-diff -r -u a/images-r1.txt b/images-r1.txt
---- a/images-r1.txt	2020-11-13 17:26:27.945942230 +0100
-+++ b/images-r1.txt	2020-11-13 17:26:43.221881902 +0100
+diff -u a/images-r1.txt b/images-r1.txt
+--- a/images-r1.txt	2020-11-25 20:40:19.005177152 +0100
++++ b/images-r1.txt	2020-11-25 20:41:17.500886263 +0100
 @@ -1,7 +1,7 @@
  TITLE: Versatile Express Images Configuration File
  
@@ -58,7 +67,16 @@ diff -r -u a/images-r1.txt b/images-r1.txt
  
  NOR0UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
  NOR0ADDRESS: 0x00000000          ;Image Flash Address
-@@ -24,7 +24,7 @@
+@@ -17,14 +17,14 @@
+ 
+ NOR2UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
+ NOR2ADDRESS: 0x00500000          ;Image Flash Address
+-NOR2FILE: \SOFTWARE\Image        ;Image File Name
+-NOR2NAME: norkern                ;Rename kernel to norkern
++NOR2FILE: \SOFTWARE\Image.lzm    ;Image File Name
++NOR2NAME: norkern.lzm            ;Rename kernel to norkern.lzm
+ NOR2LOAD: 00000000               ;Image Load Address
+ NOR2ENTRY: 00000000              ;Image Entry Point
  
  NOR3UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
  NOR3ADDRESS: 0x02900000          ;Image Flash Address
@@ -83,9 +101,9 @@ diff -r -u a/images-r1.txt b/images-r1.txt
 +NOR10NAME: xen
 +NOR10LOAD: 00000000              ;Image Load Address
 +NOR10ENTRY: 00000000             ;Image Entry Point
-diff -r -u a/images-r2.txt b/images-r2.txt
---- a/images-r2.txt	2020-11-13 17:26:27.949942214 +0100
-+++ b/images-r2.txt	2020-11-13 17:26:43.221881902 +0100
+diff -u a/images-r2.txt b/images-r2.txt
+--- a/images-r2.txt	2020-11-25 20:40:30.625119321 +0100
++++ b/images-r2.txt	2020-11-25 20:41:30.720820597 +0100
 @@ -1,7 +1,7 @@
  TITLE: Versatile Express Images Configuration File
  
@@ -95,7 +113,16 @@ diff -r -u a/images-r2.txt b/images-r2.txt
  
  NOR0UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
  NOR0ADDRESS: 0x00000000          ;Image Flash Address
-@@ -24,7 +24,7 @@
+@@ -17,14 +17,14 @@
+ 
+ NOR2UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
+ NOR2ADDRESS: 0x00500000          ;Image Flash Address
+-NOR2FILE: \SOFTWARE\Image        ;Image File Name
+-NOR2NAME: norkern                ;Rename kernel to norkern
++NOR2FILE: \SOFTWARE\Image.lzm    ;Image File Name
++NOR2NAME: norkern.lzm            ;Rename kernel to norkern.lzm
+ NOR2LOAD: 00000000               ;Image Load Address
+ NOR2ENTRY: 00000000              ;Image Entry Point
  
  NOR3UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
  NOR3ADDRESS: 0x02900000          ;Image Flash Address
@@ -120,21 +147,27 @@ diff -r -u a/images-r2.txt b/images-r2.txt
 +NOR10NAME: xen
 +NOR10LOAD: 00000000              ;Image Load Address
 +NOR10ENTRY: 00000000             ;Image Entry Point
-diff -r -u a/uEnv.txt b/uEnv.txt
---- a/uEnv.txt	2020-11-13 17:26:27.949942214 +0100
-+++ b/uEnv.txt	2020-11-13 17:26:43.221881902 +0100
-@@ -1,3 +1,5 @@
+diff -u a/uEnv.txt b/uEnv.txt
+--- a/uEnv.txt	2020-11-20 13:48:31.845078690 +0100
++++ b/uEnv.txt	2020-11-25 20:30:00.572306675 +0100
+@@ -1,11 +1,16 @@
 +xen_name=xen
 +xen_addr=0x84000000
  uenvcmd=run mybootcmd
++kernel_alt_name=norkern.lzm
++kernel_comp_addr_r=0x88080000
  mybootcmd=echo Loading custom boot command; \
  echo Loading kernel; \
-@@ -7,5 +9,7 @@
+ afs load ${kernel_name} ${kernel_addr_r} ; \
+-if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr_r}; fi; \
++if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of ${kernel_name}; afs load ${kernel_alt_name} ${kernel_comp_addr_r}; lzmadec ${kernel_comp_addr_r} ${kernel_addr_r}; fi; \
+ echo Loading device tree; \
  afs load  ${fdtfile} ${fdt_addr_r}; \
  if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
  afs load ${fdt_alt_name} ${fdt_addr_r}; fi; fdt addr ${fdt_addr_r}; fdt resize; \
 -booti ${kernel_addr_r} - ${fdt_addr_r};
+-
 +echo Loading Xen; \
 +afs load  ${xen_name} ${xen_addr}; \
 +if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr_r}; fi;
- 
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [meta-arm] [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support
  2020-12-03 11:59 [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Diego Sueiro
                   ` (2 preceding siblings ...)
  2020-12-03 11:59 ` [PATCH 4/4] arm-autonomy/juno-firmware: add compressed kernel support Diego Sueiro
@ 2020-12-07 18:32 ` Jon Mason
  3 siblings, 0 replies; 9+ messages in thread
From: Jon Mason @ 2020-12-07 18:32 UTC (permalink / raw)
  To: Diego Sueiro; +Cc: meta-arm, nd, Kamil Dziezyk

On Thu, Dec 03, 2020 at 11:59:21AM +0000, Diego Sueiro wrote:
> From: Kamil Dziezyk <kamil.dziezyk@arm.com>
> 
> With this patch user can set DISK_DEVICE for guest image.
> If guest disk configuration contains DISK_DEVICE setting,
> xenguest-manager uses that disk for this guest, insted of default one,
> that is set with XENGUEST_VOLUME_DEVICE in xenguest-manager.conf file.
> DISK_DEVICE is not set by deafult.
> 
> Change-Id: If400850f60097d38339e76a3d18fc0e2b927f3a0
> Issue-Id: SCM-1513
> Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>

Series pulled into master.

Thanks,
Jon

> ---
>  .../classes/xenguest-image.bbclass            |   8 ++
>  .../documentation/xenguest-mkimage.md         |   5 +
>  .../xenguest/files/xenguest-manager           | 104 +++++++++++-------
>  .../xenguest/xenguest-manager.bb              |   2 +-
>  4 files changed, 79 insertions(+), 40 deletions(-)
> 
> diff --git a/meta-arm-autonomy/classes/xenguest-image.bbclass b/meta-arm-autonomy/classes/xenguest-image.bbclass
> index 8c6b141..5e5c4c7 100644
> --- a/meta-arm-autonomy/classes/xenguest-image.bbclass
> +++ b/meta-arm-autonomy/classes/xenguest-image.bbclass
> @@ -43,6 +43,9 @@ XENGUEST_IMAGE_KERNEL ??= "Image"
>  # be included in the xenguest image)
>  XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
>  
> +# set empty partition to be used by xenguest-manager for this image
> +XENGUEST_IMAGE_DISK_DEVICE ??= ""
> +
>  #
>  # XENGUEST_IMAGE_DISK_PARTITIONS is used to describe the partitions to setup
>  # and their content.
> @@ -142,6 +145,11 @@ xenguest_image_create() {
>                      call_xenguest_mkimage update --disk-add-part=$arg
>                  done
>              fi
> +            diskdevice="${XENGUEST_IMAGE_DISK_DEVICE}"
> +            if [ -n "$diskdevice" ]; then
> +                call_xenguest_mkimage update --disk-device="${diskdevice}"
> +            fi
> +
>              ;;
>      esac
>  
> diff --git a/meta-arm-autonomy/documentation/xenguest-mkimage.md b/meta-arm-autonomy/documentation/xenguest-mkimage.md
> index d7baa2e..fd142b7 100644
> --- a/meta-arm-autonomy/documentation/xenguest-mkimage.md
> +++ b/meta-arm-autonomy/documentation/xenguest-mkimage.md
> @@ -66,6 +66,11 @@ The file contains the following entries:
>    and extract CONTENT as initial partition content (.tar[.gz|.xz|.bz2] file
>    or img[.gz|.bz2] file to be dumped in the partition).
>    FS and CONTENT can be empty.
> +- `DISK_DEVICE=X`: disk or partition to be used by lvm. Setting this option
> +  allows to bind guest disk with any partition or disk available on host,
> +  e.g. /dev/sda3 or /dev/sdb.
> +  This variable is not set by default, but if set, it overrides disk settings
> +  inside xenguest-manager.conf - 'XENGUEST_VOLUME_DEVICE'.
>  
>  The disk-files contain files to be used for initializing the disk partitions
>  content. Those should be used to create a LVM or a physical disk and initialize
> diff --git a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> index cc55b26..fafe4a0 100755
> --- a/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> +++ b/meta-arm-autonomy/recipes-extended/xenguest/files/xenguest-manager
> @@ -116,51 +116,56 @@ function xenguest_volume_init()
>      # Return:
>      # 0 - success
>      # 1 - failure
> -
> -    check_private
> -
> -    if [ -z "${XENGUEST_VOLUME_DEVICE:-}" -o \
> -        ! -b ${XENGUEST_VOLUME_DEVICE:-} ]; then
> -        echo "${PREF} Invalid volume device in configuration: ${XENGUEST_VOLUME_DEVICE:-}"
> -        return 1
> +    local diskdevice
> +    local volumename
> +
> +    if [ -z "${DISK_DEVICE}" ]; then
> +        # By default guest is using disk defined inside xenguest-manager.conf
> +        diskdevice="${XENGUEST_VOLUME_DEVICE}"
> +        volumename="${XENGUEST_VOLUME_NAME}"
> +    else
> +        # If guest configuration contains custom disk setting,
> +        # overwrite default one
> +        diskdevice="${DISK_DEVICE}"
> +        volumename="vg-xen-$(basename ${diskdevice})"
>      fi
>  
> -    if [ -z "${XENGUEST_VOLUME_NAME:-}" ]; then
> -        echo "${PREF} No volume name in configuration, using vg-xen..."
> -        XENGUEST_VOLUME_NAME="vg-xen"
> +    if [ -z "${diskdevice}" -o ! -b "${diskdevice}" ]; then
> +        echo "${PREF} Invalid volume device in configuration: ${diskdevice}"
> +        return 1
>      fi
>  
> -    pvs ${XENGUEST_VOLUME_DEVICE} > /dev/null 2>&1
> +    pvs "${diskdevice}" > /dev/null 2>&1
>      if [ $? -ne 0 ]; then
>          # Check if there is no filesystem in the block device
> -        echo "lsblk -n -o FSTYPE ${XENGUEST_VOLUME_DEVICE}" >> ${LOGFILE} 2>&1
> -        filesystem=$(lsblk -n -o FSTYPE ${XENGUEST_VOLUME_DEVICE} 2>> ${LOGFILE})
> +        echo "lsblk -n -o FSTYPE ${diskdevice}" >> ${LOGFILE} 2>&1
> +        filesystem=$(lsblk -n -o FSTYPE "${diskdevice}" 2>> ${LOGFILE})
>          if [[ $? -eq 0 && -z "$filesystem" ]]; then
> -            echo "${PREF} Initialize lvm on ${XENGUEST_VOLUME_DEVICE}"
> -            echo "pvcreate -f ${XENGUEST_VOLUME_DEVICE}" >> ${LOGFILE} 2>&1
> -            pvcreate -f ${XENGUEST_VOLUME_DEVICE} >> ${LOGFILE} 2>&1
> +            echo "${PREF} Initialize lvm on ${diskdevice}"
> +            echo "pvcreate -f ${diskdevice}" >> ${LOGFILE} 2>&1
> +            pvcreate -f "${diskdevice}" >> ${LOGFILE} 2>&1
>              if [ $? -ne 0 ]; then
>                  echo "${PREF} Error: initialing lvm on " \
> -                     "${XENGUEST_VOLUME_DEVICE} failed." | tee -a ${LOGFILE}
> +                     "${diskdevice} failed." | tee -a ${LOGFILE}
>                  return 1
>              fi
>          else
>              [ -z "$filesystem" ] || \
> -                echo "${PREF} Error: The ${XENGUEST_VOLUME_DEVICE} is already " \
> +                echo "${PREF} Error: The ${diskdevice} is already " \
>                       "formatted as $filesystem." | tee -a ${LOGFILE}
>              return 1
>          fi
>      fi
>  
> -    vgs ${XENGUEST_VOLUME_NAME} > /dev/null 2>&1
> +    vgs "${volumename}" > /dev/null 2>&1
>      if [ $? -ne 0 ]; then
> -        echo "${PREF} Create ${XENGUEST_VOLUME_NAME} volume"
> -        echo "vgcreate ${XENGUEST_VOLUME_NAME} ${XENGUEST_VOLUME_DEVICE}" \
> +        echo "${PREF} Create ${volumename} volume"
> +        echo "vgcreate ${volumename} ${diskdevice}" \
>              >> ${LOGFILE} 2>&1
> -        vgcreate ${XENGUEST_VOLUME_NAME} ${XENGUEST_VOLUME_DEVICE} \
> +        vgcreate "${volumename}" "${diskdevice}" \
>              >> ${LOGFILE} 2>&1
>          if [ $? -ne 0 ]; then
> -            echo "${PREF} Error: creating ${XENGUEST_VOLUME_NAME} volume " \
> +            echo "${PREF} Error: creating ${volumename} volume " \
>                   "failed."  | tee -a ${LOGFILE}
>              return 1
>          fi
> @@ -201,9 +206,19 @@ function xenguest_disk_init()
>  
>      guestname="$1"
>      guestfile="$2"
> -    devname="/dev/${XENGUEST_VOLUME_NAME}/${guestname}"
>  
>      source ${XENGUEST_CONF_BASE}/guests/${guestname}/disk.cfg
> +    if [ -z "${DISK_DEVICE}" ]; then
> +        # By default guest is using disk defined inside xenguest-manager.conf
> +        diskdevice="${XENGUEST_VOLUME_DEVICE}"
> +        volumename="${XENGUEST_VOLUME_NAME}"
> +    else
> +        # If guest configuration contains custom disk setting,
> +        # overwrite default one
> +        diskdevice="${DISK_DEVICE}"
> +        volumename="vg-xen-$(basename ${diskdevice})"
> +    fi
> +    devname="/dev/${volumename}/${guestname}"
>  
>      DISK_SIZE=$(check_size "${DISK_SIZE}")
>      if [ -z "${DISK_SIZE}" ] || [ "${DISK_SIZE}" = "0M" ]; then
> @@ -224,11 +239,11 @@ function xenguest_disk_init()
>  
>  
>      # Remove volume if it already exist
> -    echo "lvs ${XENGUEST_VOLUME_NAME}/${guestname}"  >> ${LOGFILE} 2>&1
> -    lvs ${XENGUEST_VOLUME_NAME}/${guestname} >> ${LOGFILE} 2>&1
> +    echo "lvs ${volumename}/${guestname}"  >> ${LOGFILE} 2>&1
> +    lvs "${volumename}/${guestname}" >> ${LOGFILE} 2>&1
>      if [ $? -eq 0 ]; then
>          echo "lvremove -y ${devname}" >> ${LOGFILE} 2>&1
> -        lvremove -y ${devname} >> ${LOGFILE} 2>&1
> +        lvremove -y "${devname}" >> ${LOGFILE} 2>&1
>          if [ $? -ne 0 ]; then
>              echo "${PREF} Error removing volume ${guestname}"
>              return 1
> @@ -236,9 +251,9 @@ function xenguest_disk_init()
>      fi
>  
>      # Create volume
> -    echo "lvcreate -y -L ${DISK_SIZE} -n ${guestname} ${XENGUEST_VOLUME_NAME}" \
> +    echo "lvcreate -y -L ${DISK_SIZE} -n ${guestname} ${volumename}" \
>          >> ${LOGFILE} 2>&1
> -    lvcreate -y -L ${DISK_SIZE} -n ${guestname} ${XENGUEST_VOLUME_NAME} \
> +    lvcreate -y -L "${DISK_SIZE}" -n "${guestname}" "${volumename}" \
>          >> ${LOGFILE} 2>&1
>      if [ $? -ne 0 ]; then
>          echo "${PREF} Error creating volume ${guestname}"
> @@ -247,7 +262,7 @@ function xenguest_disk_init()
>  
>      # Add partition table
>      echo "parted -s ${devname} mklabel msdos" >> ${LOGFILE} 2>&1
> -    parted -s ${devname} mklabel msdos >> ${LOGFILE} 2>&1
> +    parted -s "${devname}" mklabel msdos >> ${LOGFILE} 2>&1
>      if [ $? -ne 0 ]; then
>          echo "${PREF} Error creating partition table on ${guestname}"
>          return 1
> @@ -256,8 +271,8 @@ function xenguest_disk_init()
>      # Setup disk name in xen configuration
>      echo "xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname}" \
>          "--xen-disk=${devname}" >> ${LOGFILE} 2>&1
> -    xenguest-mkimage update ${XENGUEST_CONF_BASE}/guests/${guestname} \
> -        --xen-disk=${devname} >> ${LOGFILE} 2>&1
> +    xenguest-mkimage update "${XENGUEST_CONF_BASE}/guests/${guestname}" \
> +        "--xen-disk=${devname}" >> ${LOGFILE} 2>&1
>      if [ $? -ne 0 ]; then
>          echo "${PREF} Error setting disk in xen configuration"
>          return 1
> @@ -311,8 +326,8 @@ function xenguest_disk_init()
>              # Create partition
>              echo "parted -s ${devname} unit MB mkpart primary ${partstart}" \
>                  "${partend}" >> ${LOGFILE} 2>&1
> -            parted -s ${devname} unit MB mkpart primary ${partstart} \
> -                ${partend} >> ${LOGFILE} 2>&1
> +            parted -s "${devname}" unit MB mkpart primary "${partstart}" \
> +                "${partend}" >> ${LOGFILE} 2>&1
>              if [ $? -ne 0 ]; then
>                  echo "${PREF} Error adding partition ${part}"
>                  return 1
> @@ -346,7 +361,7 @@ function xenguest_disk_init()
>  
>              # Attach disk to xen
>              echo "xl block-attach 0 phy:${devname} xvda w" >> ${LOGFILE} 2>&1
> -            xl block-attach 0 phy:${devname} xvda w >> ${LOGFILE} 2>&1
> +            xl block-attach 0 "phy:${devname}" xvda w >> ${LOGFILE} 2>&1
>              if [ $? -ne 0 ]; then
>                  echo "${PREF} Error attaching partition ${part}"
>                  return 1
> @@ -528,16 +543,27 @@ function xenguest_guest_remove()
>      check_private
>  
>      guestname="$1"
> -    devname="/dev/${XENGUEST_VOLUME_NAME}/${guestname}"
> +    source ${XENGUEST_CONF_BASE}/guests/${guestname}/disk.cfg
> +    if [ -z "${DISK_DEVICE}" ]; then
> +        # By default guest is using disk defined inside xenguest-manager.conf
> +        diskdevice="${XENGUEST_VOLUME_DEVICE}"
> +        volumename="${XENGUEST_VOLUME_NAME}"
> +    else
> +        # If guest configuration contains custom disk setting,
> +        # overwrite default one
> +        diskdevice="${DISK_DEVICE}"
> +        volumename="vg-xen-$(basename ${diskdevice})"
> +    fi
> +    devname="/dev/${volumename}/${guestname}"
>  
>      # check if guest had a volume
> -    echo "lvs ${XENGUEST_VOLUME_NAME}/${guestname}"  >> ${LOGFILE} 2>&1
> -    lvs ${XENGUEST_VOLUME_NAME}/${guestname} >> ${LOGFILE} 2>&1
> +    echo "lvs ${volumename}/${guestname}"  >> ${LOGFILE} 2>&1
> +    lvs ${volumename}/${guestname} >> ${LOGFILE} 2>&1
>      if [ $? -eq 0 ]; then
>          # Remove guest volume
>          echo "${PREF} Removing ${guestname} volume. This might take a while..."
>          echo "lvremove -y ${devname}" >> ${LOGFILE} 2>&1
> -        lvremove -y ${devname} >> ${LOGFILE} 2>&1
> +        lvremove -y "${devname}" >> ${LOGFILE} 2>&1
>          if [ $? -ne 0 ]; then
>              echo "${PREF} Error removing volume ${guestname}"
>              exit 1
> diff --git a/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb b/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb
> index 9c29bde..c55d879 100644
> --- a/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb
> +++ b/meta-arm-autonomy/recipes-extended/xenguest/xenguest-manager.bb
> @@ -17,7 +17,7 @@ S = "${WORKDIR}"
>  # Please refer to documentation/xenguest-manager.md for documentation on those
>  # parameters
>  XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
> -XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen"
> +XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen-$(basename ${XENGUEST_MANAGER_VOLUME_DEVICE})"
>  XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
>  
>  # We add an init script to create and start guests automatically
> -- 
> 2.17.1
> 

> 
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file
  2020-12-03 11:59 ` [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file Diego Sueiro
@ 2021-01-08 10:58   ` Diego Sueiro
  2021-01-11 14:34     ` [meta-arm] " Jon Mason
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Sueiro @ 2021-01-08 10:58 UTC (permalink / raw)
  To: meta-arm

Hi Jon,

Can you please backport this patch to gatesgarth?

Cheers,
Diego Sueiro

On Thu, Dec  3, 2020 at 12:01 PM, Diego Sueiro wrote:

>
> From: Kamil Dziezyk <kamil.dziezyk@arm.com>
> 
> This patch also appends 'wic wic.gz wic.bmap' images,
> to IMAGE_FSTYPES.
> 
> WKS file contains two partition entries:
>  * first is rootfs partition
>  * second is empty partition (4 GiB by default)
> 
> Issue-Id: SCM-1520
> Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
> Change-Id: Ic0c79ee5eb4b08ad8f9c133b267feda1c85519a3
> ---
>  .../conf/machine/juno-extra-settings.inc      | 20 +++++++++++++++++++
>  .../wic/arm-autonomy-juno-disk.wks.in         | 11 ++++++++++
>  2 files changed, 31 insertions(+)
>  create mode 100644
> meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> 
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> index 110865d..ec7ed35 100644
> ---
> a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> @@ -3,3 +3,23 @@
>  # Juno board has 2 network interfaces, add both of them to the bridge
>  XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
>  XEN_DEVICETREE_DOM0_SIZE ?= "0x02400000"
> +
> +# We need to extend the wks search path to be able to find the wks file set
> in
> +# ARM_AUTONOMY_WKS_FILE.
> +WKS_SEARCH_PATH_prepend := "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic:"
> +
> +ARM_AUTONOMY_WKS_FILE ?= "arm-autonomy-juno-disk.wks.in"
> +# set wks file only if INITRAMFS_IMAGE_BUNDLE is not set
> +WKS_FILE = "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
> +                                 '${ARM_AUTONOMY_WKS_FILE}', d)}"
> +
> +# Set the wks guest partition size and unit. It must be aligned with the sum
> of
> +# all XENGUEST_IMAGE_DISK_SIZE set for the guests. By default, LVM2 metadata
> is
> +# 1 MiB per physical volume, hence it needs to be taken into account when
> +# setting GUEST_PART_SIZE. The XENGUEST_IMAGE_DISK_SIZE default value is
> 4GiB.
> +GUEST_PART_SIZE ?= "4097"
> +GUEST_PART_SIZE_UNIT ?= "M"
> +
> +# set wic image type only if INITRAMFS_IMAGE_BUNDLE is not set
> +IMAGE_FSTYPES += "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
> +                                       'wic wic.gz wic.bmap', d)}"
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> new file mode 100644
> index 0000000..5c5b24a
> --- /dev/null
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> @@ -0,0 +1,11 @@
> +# short-description: Create a disk image
> +# long-description: Creates a partitioned disk image that the user
> +# can directly dd to boot media.
> +
> +# For Juno first partition is rootfs normally populated as /dev/sda1
> +part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
> +
> +# Second partition to accomodate guests images normally populated as
> /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
> +part --label guests --source empty --ondisk sda
> --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
> +
> +bootloader --ptable msdos
> -- 
> 2.17.1
> 
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] arm-autonomy/autonomy-host: add user defined partition to wic image
  2020-12-03 11:59 ` [PATCH 3/4] arm-autonomy/autonomy-host: add user defined partition to wic image Diego Sueiro
@ 2021-01-08 10:58   ` Diego Sueiro
  0 siblings, 0 replies; 9+ messages in thread
From: Diego Sueiro @ 2021-01-08 10:58 UTC (permalink / raw)
  To: meta-arm

Hi Jon,

Can you please backport this patch to gatesgarth?

Cheers,
Diego Sueiro

On Thu, Dec  3, 2020 at 12:02 PM, Diego Sueiro wrote:

>
> From: Kamil Dziezyk <kamil.dziezyk@arm.com>
> 
> With this patch user can define additional partition entry,
> via AUTONOMY_HOST_EXTRA_PARTITION variable.
> 
> Issue-Id: SCM-1514
> Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
> Change-Id: Ic103a40de44ea6cd88caa60f06033a9c678b265f
> ---
>  .../documentation/arm-autonomy-multiconfig.md | 34 +++++++++++++++++++
>  .../wic/arm-autonomy-juno-disk.wks.in         |  3 ++
>  .../wic/arm-autonomy-n1sdp-efidisk.wks.in     |  3 ++
>  3 files changed, 40 insertions(+)
> 
> diff --git a/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
> b/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
> index 8c33501..4f4bb74 100644
> --- a/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
> +++ b/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
> @@ -159,3 +159,37 @@ and everything between `---Guest Config Start---` and
>  Any copies of variables that start `MC_GUEST` must be altered to avoid
>  collisions (e.g. `MC_GUEST_2_*`), and the name of the conf file must also
>  be added to BBMULTICONFIG.
> +
> +
> +Guest with provisioned disk
> +----------------
> +
> +To add guest rootfs partition to host wic image,
> +set `AUTONOMY_HOST_EXTRA_PARTITION` with proper wks partition entry, e.g:
> +
> +```
> +AUTONOMY_HOST_EXTRA_PARTITION = "part --label provisioned-guest --source
> rawcopy --fstype=ext4 --ondisk sda --align 1024 \
> +--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
> +```
> +
> +inside host.conf file.
> +
> +The rest of the configuration has to be appended to guest.conf file:
> +
> +```
> +XENGUEST_IMAGE_DISK_SIZE = "0"
> +XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
> +XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
> +XENGUEST_IMAGE_ROOT = "/dev/xvda"
> +IMAGE_ROOTFS_SIZE = "102400"
> +IMAGE_FSTYPES = "ext4"
> +```
> +
> +content of rootdisk.cfg"
> +
> +```
> +disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
> +```
> +
> +`_GUEST_DISK_DEVICE_` should be substituted with `/dev/sdaX`,
> +according to wks file.
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> index 5c5b24a..bfacb20 100644
> ---
> a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> @@ -8,4 +8,7 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label root
> --align 1024
>  # Second partition to accomodate guests images normally populated as
> /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
>  part --label guests --source empty --ondisk sda
> --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
>
> +# Third partition is user defined entry normally populated as /dev/sda3
> +${AUTONOMY_HOST_EXTRA_PARTITION}
> +
>  bootloader --ptable msdos
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in
> index ded628c..b48ec77 100644
> ---
> a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-efidisk.wks.in
> @@ -11,4 +11,7 @@ part / --source rootfs --ondisk sda --fstype=ext4 --label
> root --align 1024
>  # Third partition to accomodate guests images normally populated as /dev/sda3
> (used by XENGUEST_MANAGER_VOLUME_DEVICE)
>  part --label guests --source empty --ondisk sda
> --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
>
> +# Fourth partition is user defined entry normally populated as /dev/sda4
> +${AUTONOMY_HOST_EXTRA_PARTITION}
> +
>  bootloader --ptable msdos --configfile="${GRUB_CFG_FILE}"
> -- 
> 2.17.1
> 
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] arm-autonomy/juno-firmware: add compressed kernel support
  2020-12-03 11:59 ` [PATCH 4/4] arm-autonomy/juno-firmware: add compressed kernel support Diego Sueiro
@ 2021-01-08 10:58   ` Diego Sueiro
  0 siblings, 0 replies; 9+ messages in thread
From: Diego Sueiro @ 2021-01-08 10:58 UTC (permalink / raw)
  To: meta-arm

Hi Jon,

Can you please backport this patch to gatesgarth?

Cheers,
Diego Sueiro

On Thu, Dec  3, 2020 at 12:03 PM, Diego Sueiro wrote:

>
> From: Kamil Dziezyk <kamil.dziezyk@arm.com>
> 
> This patch adds support for lzma compressed kernel,
> by setting KERNEL_ALT_IMAGETYPE to 'Image.lzma' and
> adding additional decompression step during u-boot boot stage.
> 
> U-boot automatic Image decompression cannot be used here,
> because if xen binary is the target of 'booti' command,
> Image is not being decompressed neither by u-boot nor by xen.
> 
> Lzma compression is supported in u-boot with 'lzmadec' command,
> and does not require setting additional dependencies inside kernel recipe.
> 
> Change-Id: I51b9aea962f8905f88b60ac28e71017c7d500189
> Issue-Id: SCM-1769
> Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
> Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
> ---
>  .../conf/machine/juno-extra-settings.inc      |  1 +
>  .../images/firmware-image-juno.bbappend       |  8 +++
>  .../firmware-image-juno/add-xen-support.patch | 69 ++++++++++++++-----
>  3 files changed, 60 insertions(+), 18 deletions(-)
> 
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> index ec7ed35..f8a16f4 100644
> ---
> a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> @@ -1,4 +1,5 @@
>  # Extra machine settings for juno
> +KERNEL_ALT_IMAGETYPE = "Image.lzma"
>
>  # Juno board has 2 network interfaces, add both of them to the bridge
>  XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend
> index 847e252..6b94dc9 100644
> ---
> a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno.bbappend
> @@ -39,4 +39,12 @@ do_deploy_prepend_xen() {
>      done
>
>      bbnote "Xen binaries added under SOFTWARE/XEN directory"
> +
> +    if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" -a "${KERNEL_ALT_IMAGETYPE}" =
> "Image.lzma" ]; then
> +        # KERNEL_ALT_IMAGETYPE is expected to be Image.lzma,
> +        # however NOR flash filesystem is DOS compatible with 8.3 naming,
> +        # so we need to replace ".lzma" with ".lzm"
> +        cp -L -f ${DEPLOY_DIR_IMAGE}/${KERNEL_ALT_IMAGETYPE} \
> +                 ${D}/${UNPACK_DIR}/SOFTWARE/Image.lzm
> +    fi
>  }
> diff --git
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch
> index 04098e1..29f1e06 100644
> ---
> a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch
> +++
> b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-bsp/images/firmware-image-juno/add-xen-support.patch
> @@ -9,9 +9,9 @@ It also adds customization for uEnv.txt file, that allows to
> autoboot xen.
>  Upstream-Status: Inappropriate [configuration]
>  Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
>
> -diff -r -u a/images-r0.txt b/images-r0.txt
> ---- a/images-r0.txt	2020-11-13 17:26:27.945942230 +0100
> -+++ b/images-r0.txt	2020-11-13 17:26:43.221881902 +0100
> +diff -u a/images-r0.txt b/images-r0.txt
> +--- a/images-r0.txt	2020-11-25 20:25:38.677687712 +0100
> ++++ b/images-r0.txt	2020-11-25 20:36:55.482194294 +0100
>  @@ -1,7 +1,7 @@
>   TITLE: Versatile Express Images Configuration File
>   
> @@ -21,7 +21,16 @@ diff -r -u a/images-r0.txt b/images-r0.txt
>   
>   NOR0UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
>   NOR0ADDRESS: 0x00000000          ;Image Flash Address
> -@@ -24,7 +24,7 @@
> +@@ -17,14 +17,14 @@
> + 
> + NOR2UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
> + NOR2ADDRESS: 0x00500000          ;Image Flash Address
> +-NOR2FILE: \SOFTWARE\Image        ;Image File Name
> +-NOR2NAME: norkern                ;Rename kernel to norkern
> ++NOR2FILE: \SOFTWARE\Image.lzm    ;Image File Name
> ++NOR2NAME: norkern.lzm            ;Rename kernel to norkern.lzm
> + NOR2LOAD: 00000000               ;Image Load Address
> + NOR2ENTRY: 00000000              ;Image Entry Point
>   
>   NOR3UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
>   NOR3ADDRESS: 0x02900000          ;Image Flash Address
> @@ -46,9 +55,9 @@ diff -r -u a/images-r0.txt b/images-r0.txt
>  +NOR10NAME: xen
>  +NOR10LOAD: 00000000              ;Image Load Address
>  +NOR10ENTRY: 00000000             ;Image Entry Point
> -diff -r -u a/images-r1.txt b/images-r1.txt
> ---- a/images-r1.txt	2020-11-13 17:26:27.945942230 +0100
> -+++ b/images-r1.txt	2020-11-13 17:26:43.221881902 +0100
> +diff -u a/images-r1.txt b/images-r1.txt
> +--- a/images-r1.txt	2020-11-25 20:40:19.005177152 +0100
> ++++ b/images-r1.txt	2020-11-25 20:41:17.500886263 +0100
>  @@ -1,7 +1,7 @@
>   TITLE: Versatile Express Images Configuration File
>   
> @@ -58,7 +67,16 @@ diff -r -u a/images-r1.txt b/images-r1.txt
>   
>   NOR0UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
>   NOR0ADDRESS: 0x00000000          ;Image Flash Address
> -@@ -24,7 +24,7 @@
> +@@ -17,14 +17,14 @@
> + 
> + NOR2UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
> + NOR2ADDRESS: 0x00500000          ;Image Flash Address
> +-NOR2FILE: \SOFTWARE\Image        ;Image File Name
> +-NOR2NAME: norkern                ;Rename kernel to norkern
> ++NOR2FILE: \SOFTWARE\Image.lzm    ;Image File Name
> ++NOR2NAME: norkern.lzm            ;Rename kernel to norkern.lzm
> + NOR2LOAD: 00000000               ;Image Load Address
> + NOR2ENTRY: 00000000              ;Image Entry Point
>   
>   NOR3UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
>   NOR3ADDRESS: 0x02900000          ;Image Flash Address
> @@ -83,9 +101,9 @@ diff -r -u a/images-r1.txt b/images-r1.txt
>  +NOR10NAME: xen
>  +NOR10LOAD: 00000000              ;Image Load Address
>  +NOR10ENTRY: 00000000             ;Image Entry Point
> -diff -r -u a/images-r2.txt b/images-r2.txt
> ---- a/images-r2.txt	2020-11-13 17:26:27.949942214 +0100
> -+++ b/images-r2.txt	2020-11-13 17:26:43.221881902 +0100
> +diff -u a/images-r2.txt b/images-r2.txt
> +--- a/images-r2.txt	2020-11-25 20:40:30.625119321 +0100
> ++++ b/images-r2.txt	2020-11-25 20:41:30.720820597 +0100
>  @@ -1,7 +1,7 @@
>   TITLE: Versatile Express Images Configuration File
>   
> @@ -95,7 +113,16 @@ diff -r -u a/images-r2.txt b/images-r2.txt
>   
>   NOR0UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
>   NOR0ADDRESS: 0x00000000          ;Image Flash Address
> -@@ -24,7 +24,7 @@
> +@@ -17,14 +17,14 @@
> + 
> + NOR2UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
> + NOR2ADDRESS: 0x00500000          ;Image Flash Address
> +-NOR2FILE: \SOFTWARE\Image        ;Image File Name
> +-NOR2NAME: norkern                ;Rename kernel to norkern
> ++NOR2FILE: \SOFTWARE\Image.lzm    ;Image File Name
> ++NOR2NAME: norkern.lzm            ;Rename kernel to norkern.lzm
> + NOR2LOAD: 00000000               ;Image Load Address
> + NOR2ENTRY: 00000000              ;Image Entry Point
>   
>   NOR3UPDATE: AUTO                 ;Image Update:NONE/AUTO/FORCE
>   NOR3ADDRESS: 0x02900000          ;Image Flash Address
> @@ -120,21 +147,27 @@ diff -r -u a/images-r2.txt b/images-r2.txt
>  +NOR10NAME: xen
>  +NOR10LOAD: 00000000              ;Image Load Address
>  +NOR10ENTRY: 00000000             ;Image Entry Point
> -diff -r -u a/uEnv.txt b/uEnv.txt
> ---- a/uEnv.txt	2020-11-13 17:26:27.949942214 +0100
> -+++ b/uEnv.txt	2020-11-13 17:26:43.221881902 +0100
> -@@ -1,3 +1,5 @@
> +diff -u a/uEnv.txt b/uEnv.txt
> +--- a/uEnv.txt	2020-11-20 13:48:31.845078690 +0100
> ++++ b/uEnv.txt	2020-11-25 20:30:00.572306675 +0100
> +@@ -1,11 +1,16 @@
>  +xen_name=xen
>  +xen_addr=0x84000000
>   uenvcmd=run mybootcmd
> ++kernel_alt_name=norkern.lzm
> ++kernel_comp_addr_r=0x88080000
>   mybootcmd=echo Loading custom boot command; \
>   echo Loading kernel; \
> -@@ -7,5 +9,7 @@
> + afs load ${kernel_name} ${kernel_addr_r} ; \
> +-if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of
> ${kernel_name}; afs load ${kernel_alt_name} ${kernel_addr_r}; fi; \
> ++if test $? -eq 1; then echo Loading ${kernel_alt_name} instead of
> ${kernel_name}; afs load ${kernel_alt_name} ${kernel_comp_addr_r}; lzmadec
> ${kernel_comp_addr_r} ${kernel_addr_r}; fi; \
> + echo Loading device tree; \
>   afs load  ${fdtfile} ${fdt_addr_r}; \
>   if test $? -eq 1; then echo Loading ${fdt_alt_name} instead of ${fdtfile}; \
>   afs load ${fdt_alt_name} ${fdt_addr_r}; fi; fdt addr ${fdt_addr_r}; fdt
> resize; \
>  -booti ${kernel_addr_r} - ${fdt_addr_r};
> +-
>  +echo Loading Xen; \
>  +afs load  ${xen_name} ${xen_addr}; \
>  +if test $? -eq 0; then echo Booting Xen; bootefi ${xen_addr} ${fdt_addr_r};
> fi;
> - 
> +
> -- 
> 2.17.1
> 
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [meta-arm] [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file
  2021-01-08 10:58   ` Diego Sueiro
@ 2021-01-11 14:34     ` Jon Mason
  0 siblings, 0 replies; 9+ messages in thread
From: Jon Mason @ 2021-01-11 14:34 UTC (permalink / raw)
  To: Diego Sueiro; +Cc: meta-arm

On Fri, Jan 08, 2021 at 02:58:18AM -0800, Diego Sueiro wrote:
> Hi Jon,
> 
> Can you please backport this patch to gatesgarth?

Done.  I had to include "arm-autonomy/arm-autonomy-host-image-minimal:
Added multiconfig support" for these to be applied cleanly.

Thanks,
Jon

> 
> Cheers,
> Diego Sueiro
> 
> On Thu, Dec  3, 2020 at 12:01 PM, Diego Sueiro wrote:
> 
> >
> > From: Kamil Dziezyk <kamil.dziezyk@arm.com>
> > 
> > This patch also appends 'wic wic.gz wic.bmap' images,
> > to IMAGE_FSTYPES.
> > 
> > WKS file contains two partition entries:
> >  * first is rootfs partition
> >  * second is empty partition (4 GiB by default)
> > 
> > Issue-Id: SCM-1520
> > Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
> > Change-Id: Ic0c79ee5eb4b08ad8f9c133b267feda1c85519a3
> > ---
> >  .../conf/machine/juno-extra-settings.inc      | 20 +++++++++++++++++++
> >  .../wic/arm-autonomy-juno-disk.wks.in         | 11 ++++++++++
> >  2 files changed, 31 insertions(+)
> >  create mode 100644
> > meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> > 
> > diff --git
> > b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> > index 110865d..ec7ed35 100644
> > ---
> > a/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> > +++
> > b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/juno-extra-settings.inc
> > @@ -3,3 +3,23 @@
> >  # Juno board has 2 network interfaces, add both of them to the bridge
> >  XENGUEST_NETWORK_BRIDGE_MEMBERS ?= "eth0 eth1"
> >  XEN_DEVICETREE_DOM0_SIZE ?= "0x02400000"
> > +
> > +# We need to extend the wks search path to be able to find the wks file set
> > in
> > +# ARM_AUTONOMY_WKS_FILE.
> > +WKS_SEARCH_PATH_prepend := "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic:"
> > +
> > +ARM_AUTONOMY_WKS_FILE ?= "arm-autonomy-juno-disk.wks.in"
> > +# set wks file only if INITRAMFS_IMAGE_BUNDLE is not set
> > +WKS_FILE = "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
> > +                                 '${ARM_AUTONOMY_WKS_FILE}', d)}"
> > +
> > +# Set the wks guest partition size and unit. It must be aligned with the sum
> > of
> > +# all XENGUEST_IMAGE_DISK_SIZE set for the guests. By default, LVM2 metadata
> > is
> > +# 1 MiB per physical volume, hence it needs to be taken into account when
> > +# setting GUEST_PART_SIZE. The XENGUEST_IMAGE_DISK_SIZE default value is
> > 4GiB.
> > +GUEST_PART_SIZE ?= "4097"
> > +GUEST_PART_SIZE_UNIT ?= "M"
> > +
> > +# set wic image type only if INITRAMFS_IMAGE_BUNDLE is not set
> > +IMAGE_FSTYPES += "${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', '',\
> > +                                       'wic wic.gz wic.bmap', d)}"
> > diff --git
> > b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> > new file mode 100644
> > index 0000000..5c5b24a
> > --- /dev/null
> > +++
> > b/meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-juno-disk.wks.in
> > @@ -0,0 +1,11 @@
> > +# short-description: Create a disk image
> > +# long-description: Creates a partitioned disk image that the user
> > +# can directly dd to boot media.
> > +
> > +# For Juno first partition is rootfs normally populated as /dev/sda1
> > +part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
> > +
> > +# Second partition to accomodate guests images normally populated as
> > /dev/sda2 (used by XENGUEST_MANAGER_VOLUME_DEVICE)
> > +part --label guests --source empty --ondisk sda
> > --size="${GUEST_PART_SIZE}${GUEST_PART_SIZE_UNIT}" --system-id 8e --align 1024
> > +
> > +bootloader --ptable msdos
> > -- 
> > 2.17.1
> > 
> >

> 
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-11 14:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 11:59 [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Diego Sueiro
2020-12-03 11:59 ` [PATCH 2/4] arm-autonomy/juno-image-customization: add host wks file Diego Sueiro
2021-01-08 10:58   ` Diego Sueiro
2021-01-11 14:34     ` [meta-arm] " Jon Mason
2020-12-03 11:59 ` [PATCH 3/4] arm-autonomy/autonomy-host: add user defined partition to wic image Diego Sueiro
2021-01-08 10:58   ` Diego Sueiro
2020-12-03 11:59 ` [PATCH 4/4] arm-autonomy/juno-firmware: add compressed kernel support Diego Sueiro
2021-01-08 10:58   ` Diego Sueiro
2020-12-07 18:32 ` [meta-arm] [PATCH 1/4] arm-autonomy/xenguest-tools: add multiple disk devices support Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.