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 \ |
| 13 | ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'kernel-module-xen-pciback', '', d)} \ |
| 14 | kernel-module-xen-wdt \ |
| 15 | xen-base \ |
| 16 | qemu \ |
| 17 | " |
| 18 | |
| 19 | LICENSE = "MIT" |
| 20 | |
| 21 | inherit core-image |
| 22 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame^] | 23 | do_check_xen_state() { |
| 24 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' yes', 'no', d)}" = "no" ]; then |
| 25 | die "DISTRO_FEATURES does not contain 'xen'" |
| 26 | fi |
| 27 | } |
| 28 | |
| 29 | addtask check_xen_state before do_rootfs |
| 30 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 31 | syslinux_iso_populate_append() { |
| 32 | install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${ISODIR}${ISOLINUXDIR} |
| 33 | install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${ISODIR}${ISOLINUXDIR} |
| 34 | } |
| 35 | |
| 36 | syslinux_hddimg_populate_append() { |
| 37 | install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${HDDDIR}${SYSLINUXDIR} |
| 38 | install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR} |
| 39 | } |
| 40 | |
| 41 | grubefi_populate_append() { |
| 42 | install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz |
| 43 | } |
| 44 | |
| 45 | populate_append() { |
| 46 | install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz |
| 47 | } |
| 48 | |
| 49 | SYSLINUX_XEN_ARGS ?= "loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1" |
| 50 | SYSLINUX_KERNEL_ARGS ?= "ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5" |
| 51 | |
| 52 | build_syslinux_cfg () { |
| 53 | echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG} |
| 54 | echo "DEFAULT boot" >> ${SYSLINUXCFG} |
| 55 | echo "TIMEOUT 10" >> ${SYSLINUXCFG} |
| 56 | echo "PROMPT 1" >> ${SYSLINUXCFG} |
| 57 | echo "LABEL boot" >> ${SYSLINUXCFG} |
| 58 | echo " KERNEL mboot.c32" >> ${SYSLINUXCFG} |
| 59 | echo " APPEND /xen.gz ${SYSLINUX_XEN_ARGS} --- /vmlinuz ${SYSLINUX_KERNEL_ARGS} --- /initrd" >> ${SYSLINUXCFG} |
| 60 | } |
| 61 | |