From f30ddfc379cc8bab917a80b18033f620b51be065 Mon Sep 17 00:00:00 2001 From: Gloria Date: Wed, 12 Aug 2015 19:32:46 +0800 Subject: [PATCH] Adds debian support to iso element Adds support for debian to iso. Updated README to further clarify what the element does. Change-Id: I17ac89cfbc84365860c591fab0e4c78123035983 Co-Authored-By: zhangjian --- elements/iso/README.rst | 7 ++++++- elements/iso/cleanup.d/100-build-iso | 5 +++++ elements/iso/package-installs.yaml | 2 ++ elements/iso/pkg-map | 19 ++++++++++++++++--- .../iso/post-install.d/01-copy-bootloaders | 6 ++++++ 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/elements/iso/README.rst b/elements/iso/README.rst index 26a60663..9bd81098 100644 --- a/elements/iso/README.rst +++ b/elements/iso/README.rst @@ -2,12 +2,13 @@ iso === Generates a bootable ISO image from the kernel/ramdisk generated by the -elements ``baremetal`` or ``ramdisk``. It uses isolinux to boot on BIOS +elements ``baremetal``, ``ironic-agent`` or ``ramdisk``. It uses isolinux to boot on BIOS machines and grub to boot on EFI machines. This element has been tested on the following distro(s): * ubuntu * fedora +* debian **NOTE**: For other distros, please make sure the ``isolinux.bin`` file exists at ``/usr/lib/syslinux/isolinux.bin``. @@ -36,6 +37,10 @@ named ``.iso`` booting the generated kernel and ramdisk. It also automatically appends kernel command-line argument 'boot\_method=vmedia' which is required for Ironic drivers ``iscsi_ilo``. +ironic-agent element +-------------------- +When used with ``ironic-agent`` element, this generates a bootable ISO image named ``.iso`` which boots the agent kernel and agent ramdisk. + **REFERENCES** [1] https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1378658 diff --git a/elements/iso/cleanup.d/100-build-iso b/elements/iso/cleanup.d/100-build-iso index 7614e489..5430a083 100755 --- a/elements/iso/cleanup.d/100-build-iso +++ b/elements/iso/cleanup.d/100-build-iso @@ -63,6 +63,11 @@ function build_iso() { if [ $DISTRO_NAME = "fedora" ]; then EFI_BOOT_DIR="EFI/fedora" EXTRA_KERNEL_PARAMS="usbcore.autosuspend=-1" + #debian + elif [ $DISTRO_NAME = "debian" ]; then + EFI_BOOT_DIR="EFI/debian" + EXTRA_KERNEL_PARAMS="" + #ubuntu: else EFI_BOOT_DIR="EFI/ubuntu" EXTRA_KERNEL_PARAMS="" diff --git a/elements/iso/package-installs.yaml b/elements/iso/package-installs.yaml index c72b1c0b..bbfcd72a 100644 --- a/elements/iso/package-installs.yaml +++ b/elements/iso/package-installs.yaml @@ -1 +1,3 @@ syslinux: +syslinux-common: +isolinux: diff --git a/elements/iso/pkg-map b/elements/iso/pkg-map index b6257ae8..557d7903 100644 --- a/elements/iso/pkg-map +++ b/elements/iso/pkg-map @@ -1,14 +1,27 @@ { + "distro":{ + "debian":{ + "syslinux": "syslinux", + "syslinux-common": "syslinux-common", + "isolinux": "isolinux" + } + }, "family":{ "debian":{ - "syslinux": "syslinux" + "syslinux": "syslinux", + "syslinux-common": "", + "isolinux": "" }, "redhat":{ - "syslinux": "" + "syslinux": "", + "syslinux-common": "", + "isolinux": "" } }, "default":{ - "syslinux": "syslinux" + "syslinux": "syslinux", + "syslinux-common": "", + "isolinux": "" } } diff --git a/elements/iso/post-install.d/01-copy-bootloaders b/elements/iso/post-install.d/01-copy-bootloaders index fe79b768..5e0fb702 100755 --- a/elements/iso/post-install.d/01-copy-bootloaders +++ b/elements/iso/post-install.d/01-copy-bootloaders @@ -22,9 +22,15 @@ else SHIM_FILE="/usr/lib/shim/shim.efi.signed" fi +#fedora if [ $DISTRO_NAME = "fedora" ]; then SYSLINUX_FILE="/usr/share/syslinux/isolinux.bin" LDLINUX_FILE="/usr/share/syslinux/ldlinux.c32" +#debian +elif [ $DISTRO_NAME = "debian" ]; then + SYSLINUX_FILE="/usr/lib/ISOLINUX/isolinux.bin" + LDLINUX_FILE="/usr/lib/syslinux/modules/bios/ldlinux.c32" +#ubuntu else SYSLINUX_FILE="/usr/lib/syslinux/isolinux.bin" LDLINUX_FILE="/usr/lib/syslinux/ldlinux.c32"