diff options
Diffstat (limited to 'meta/classes/grub-efi.bbclass')
| -rw-r--r-- | meta/classes/grub-efi.bbclass | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass index 762322b28e..1efb43b805 100644 --- a/meta/classes/grub-efi.bbclass +++ b/meta/classes/grub-efi.bbclass | |||
| @@ -22,39 +22,29 @@ GRUB_TIMEOUT ?= "10" | |||
| 22 | GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" | 22 | GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" |
| 23 | 23 | ||
| 24 | EFIDIR = "/EFI/BOOT" | 24 | EFIDIR = "/EFI/BOOT" |
| 25 | GRUB_HDDDIR = "${HDDDIR}${EFIDIR}" | ||
| 26 | GRUB_ISODIR = "${ISODIR}${EFIDIR}" | ||
| 27 | 25 | ||
| 28 | grubefi_populate() { | 26 | grubefi_populate() { |
| 27 | # DEST must be the root of the image so that EFIDIR is not | ||
| 28 | # nested under a top level directory. | ||
| 29 | DEST=$1 | 29 | DEST=$1 |
| 30 | 30 | ||
| 31 | install -d ${DEST} | 31 | install -d ${DEST}${EFIDIR} |
| 32 | |||
| 33 | install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz | ||
| 34 | |||
| 35 | if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then | ||
| 36 | install -m 0644 ${INITRD} ${DEST}/initrd | ||
| 37 | fi | ||
| 38 | |||
| 39 | if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then | ||
| 40 | install -m 0644 ${ROOTFS} ${DEST}/rootfs.img | ||
| 41 | fi | ||
| 42 | 32 | ||
| 43 | GRUB_IMAGE="bootia32.efi" | 33 | GRUB_IMAGE="bootia32.efi" |
| 44 | if [ "${TARGET_ARCH}" = "x86_64" ]; then | 34 | if [ "${TARGET_ARCH}" = "x86_64" ]; then |
| 45 | GRUB_IMAGE="bootx64.efi" | 35 | GRUB_IMAGE="bootx64.efi" |
| 46 | fi | 36 | fi |
| 47 | install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST} | 37 | install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR} |
| 48 | 38 | ||
| 49 | install -m 0644 ${GRUBCFG} ${DEST} | 39 | install -m 0644 ${GRUBCFG} ${DEST}${EFIDIR} |
| 50 | } | 40 | } |
| 51 | 41 | ||
| 52 | grubefi_iso_populate() { | 42 | grubefi_iso_populate() { |
| 53 | grubefi_populate ${GRUB_ISODIR} | 43 | grubefi_populate ${ISODIR} |
| 54 | } | 44 | } |
| 55 | 45 | ||
| 56 | grubefi_hddimg_populate() { | 46 | grubefi_hddimg_populate() { |
| 57 | grubefi_populate ${GRUB_HDDDIR} | 47 | grubefi_populate ${HDDDIR} |
| 58 | } | 48 | } |
| 59 | 49 | ||
| 60 | python build_grub_cfg() { | 50 | python build_grub_cfg() { |
| @@ -109,7 +99,7 @@ python build_grub_cfg() { | |||
| 109 | bb.data.update_data(localdata) | 99 | bb.data.update_data(localdata) |
| 110 | 100 | ||
| 111 | cfgfile.write('\nmenuentry \'%s\'{\n' % (label)) | 101 | cfgfile.write('\nmenuentry \'%s\'{\n' % (label)) |
| 112 | cfgfile.write('linux ${EFIDIR}/vmlinuz LABEL=%s' % (label)) | 102 | cfgfile.write('linux /vmlinuz LABEL=%s' % (label)) |
| 113 | 103 | ||
| 114 | append = localdata.getVar('APPEND', True) | 104 | append = localdata.getVar('APPEND', True) |
| 115 | initrd = localdata.getVar('INITRD', True) | 105 | initrd = localdata.getVar('INITRD', True) |
| @@ -119,7 +109,7 @@ python build_grub_cfg() { | |||
| 119 | cfgfile.write('\n') | 109 | cfgfile.write('\n') |
| 120 | 110 | ||
| 121 | if initrd: | 111 | if initrd: |
| 122 | cfgfile.write('initrd ${EFIDIR}/initrd') | 112 | cfgfile.write('initrd /initrd') |
| 123 | cfgfile.write('\n}\n') | 113 | cfgfile.write('\n}\n') |
| 124 | 114 | ||
| 125 | cfgfile.close() | 115 | cfgfile.close() |
