diff --git a/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md b/meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md index 8c335014..4f4bb746 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 5c5b24ad..bfacb208 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 ded628c6..b48ec77e 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}"