Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 1 | DESCRIPTION = "A minimal xen image" |
| 2 | |
| 3 | INITRD_IMAGE = "core-image-minimal-initramfs" |
| 4 | |
| 5 | IMAGE_INSTALL += " \ |
| 6 | packagegroup-core-boot \ |
| 7 | packagegroup-core-ssh-openssh \ |
| 8 | ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \ |
| 9 | kernel-module-xen-blkback \ |
| 10 | kernel-module-xen-gntalloc \ |
| 11 | kernel-module-xen-gntdev \ |
| 12 | kernel-module-xen-netback \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 13 | ${@bb.utils.contains('MACHINE_FEATURES', 'pci', "${XEN_PCIBACK_MODULE}", '', d)} \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 14 | kernel-module-xen-wdt \ |
| 15 | xen-base \ |
| 16 | qemu \ |
| 17 | " |
| 18 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | # Linux kernel option CONFIG_XEN_PCIDEV_BACKEND depends on X86 |
| 20 | XEN_PCIBACK_MODULE = "" |
| 21 | XEN_PCIBACK_MODULE_x86 = "kernel-module-xen-pciback" |
| 22 | XEN_PCIBACK_MODULE_x86-64 = "kernel-module-xen-pciback" |
| 23 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 24 | LICENSE = "MIT" |
| 25 | |
| 26 | inherit core-image |
| 27 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 28 | do_check_xen_state() { |
| 29 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' yes', 'no', d)}" = "no" ]; then |
| 30 | die "DISTRO_FEATURES does not contain 'xen'" |
| 31 | fi |
| 32 | } |
| 33 | |
| 34 | addtask check_xen_state before do_rootfs |
| 35 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 36 | syslinux_iso_populate_append() { |
| 37 | install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${ISODIR}${ISOLINUXDIR} |
| 38 | install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${ISODIR}${ISOLINUXDIR} |
| 39 | } |
| 40 | |
| 41 | syslinux_hddimg_populate_append() { |
| 42 | install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${HDDDIR}${SYSLINUXDIR} |
| 43 | install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR} |
| 44 | } |
| 45 | |
| 46 | grubefi_populate_append() { |
| 47 | install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz |
| 48 | } |
| 49 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | syslinux_populate_append() { |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 51 | install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz |
| 52 | } |
| 53 | |
| 54 | SYSLINUX_XEN_ARGS ?= "loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1" |
| 55 | SYSLINUX_KERNEL_ARGS ?= "ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5" |
| 56 | |
| 57 | build_syslinux_cfg () { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 58 | echo "ALLOWOPTIONS 1" > ${SYSLINUX_CFG} |
| 59 | echo "DEFAULT boot" >> ${SYSLINUX_CFG} |
| 60 | echo "TIMEOUT 10" >> ${SYSLINUX_CFG} |
| 61 | echo "PROMPT 1" >> ${SYSLINUX_CFG} |
| 62 | echo "LABEL boot" >> ${SYSLINUX_CFG} |
| 63 | echo " KERNEL mboot.c32" >> ${SYSLINUX_CFG} |
| 64 | echo " APPEND /xen.gz ${SYSLINUX_XEN_ARGS} --- /vmlinuz ${SYSLINUX_KERNEL_ARGS} --- /initrd" >> ${SYSLINUX_CFG} |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 65 | } |
| 66 | |