blob: b8c2002207566add77ec89a347baf2a336a44a29 [file] [log] [blame]
Patrick Williamsd849ec72016-08-17 14:59:38 -05001DESCRIPTION = "A minimal xen image"
2
3INITRD_IMAGE = "core-image-minimal-initramfs"
4
5IMAGE_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
19LICENSE = "MIT"
20
21inherit core-image
22
Patrick Williamse69d2352017-02-23 20:56:04 -060023do_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
29addtask check_xen_state before do_rootfs
30
Patrick Williamsd849ec72016-08-17 14:59:38 -050031syslinux_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
36syslinux_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
41grubefi_populate_append() {
42 install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz
43}
44
45populate_append() {
46 install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz
47}
48
49SYSLINUX_XEN_ARGS ?= "loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1"
50SYSLINUX_KERNEL_ARGS ?= "ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5"
51
52build_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