aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/bootimg.bbclass31
-rw-r--r--meta/classes/grub-efi.bbclass28
-rw-r--r--meta/classes/syslinux.bbclass34
3 files changed, 46 insertions, 47 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index a717600cf9..1d1a3d04af 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -8,13 +8,13 @@
# End result is two things:
#
# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel,
-# an initrd and a rootfs image. These can be written to harddisks directly and
+# an initrd and a rootfs image. These can be written to harddisks directly and
# also booted on USB flash disks (write them there with dd).
#
# 2. A CD .iso image
-# Boot process is that the initrd will boot and process which label was selected
-# in syslinux. Actions based on the label are then performed (e.g. installing to
+# Boot process is that the initrd will boot and process which label was selected
+# in syslinux. Actions based on the label are then performed (e.g. installing to
# an hdd)
# External variables (also used by syslinux.bbclass)
@@ -29,8 +29,8 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
PACKAGES = " "
EXCLUDE_FROM_WORLD = "1"
-HDDDIR = "${S}/hdd/boot"
-ISODIR = "${S}/cd"
+HDDDIR = "${S}/hddimg"
+ISODIR = "${S}/iso"
BOOTIMG_VOLUME_ID ?= "boot"
BOOTIMG_EXTRA_SPACE ?= "512"
@@ -58,6 +58,22 @@ PCBIOS_CLASS = ${@pcbios_class(d)}
inherit ${PCBIOS_CLASS}
inherit ${EFI_CLASS}
+populate() {
+ DEST=$1
+ install -d ${DEST}
+
+ # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
+ install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz
+
+ if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
+ install -m 0644 ${INITRD} ${DEST}/initrd
+ fi
+
+ if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
+ fi
+
+}
build_iso() {
# Only create an ISO if we have an INITRD and NOISO was not set
@@ -66,7 +82,7 @@ build_iso() {
return
fi
- install -d ${ISODIR}
+ populate ${ISODIR}
if [ "${PCBIOS}" = "1" ]; then
syslinux_iso_populate
@@ -95,7 +111,8 @@ build_iso() {
build_hddimg() {
# Create an HDD image
if [ "${NOHDD}" != "1" ] ; then
- install -d ${HDDDIR}
+ populate ${HDDDIR}
+
if [ "${PCBIOS}" = "1" ]; then
syslinux_hddimg_populate
fi
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"
GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
EFIDIR = "/EFI/BOOT"
-GRUB_HDDDIR = "${HDDDIR}${EFIDIR}"
-GRUB_ISODIR = "${ISODIR}${EFIDIR}"
grubefi_populate() {
+ # DEST must be the root of the image so that EFIDIR is not
+ # nested under a top level directory.
DEST=$1
- install -d ${DEST}
-
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz
-
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
- install -m 0644 ${INITRD} ${DEST}/initrd
- fi
-
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
- fi
+ install -d ${DEST}${EFIDIR}
GRUB_IMAGE="bootia32.efi"
if [ "${TARGET_ARCH}" = "x86_64" ]; then
GRUB_IMAGE="bootx64.efi"
fi
- install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
- install -m 0644 ${GRUBCFG} ${DEST}
+ install -m 0644 ${GRUBCFG} ${DEST}${EFIDIR}
}
grubefi_iso_populate() {
- grubefi_populate ${GRUB_ISODIR}
+ grubefi_populate ${ISODIR}
}
grubefi_hddimg_populate() {
- grubefi_populate ${GRUB_HDDDIR}
+ grubefi_populate ${HDDDIR}
}
python build_grub_cfg() {
@@ -109,7 +99,7 @@ python build_grub_cfg() {
bb.data.update_data(localdata)
cfgfile.write('\nmenuentry \'%s\'{\n' % (label))
- cfgfile.write('linux ${EFIDIR}/vmlinuz LABEL=%s' % (label))
+ cfgfile.write('linux /vmlinuz LABEL=%s' % (label))
append = localdata.getVar('APPEND', True)
initrd = localdata.getVar('INITRD', True)
@@ -119,7 +109,7 @@ python build_grub_cfg() {
cfgfile.write('\n')
if initrd:
- cfgfile.write('initrd ${EFIDIR}/initrd')
+ cfgfile.write('initrd /initrd')
cfgfile.write('\n}\n')
cfgfile.close()
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 91c4275747..1569074b21 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -18,42 +18,34 @@ do_bootimg[depends] += "syslinux:do_populate_sysroot \
SYSLINUXCFG = "${S}/syslinux.cfg"
SYSLINUXMENU = "${S}/menu"
-SYSLINUX_ISODIR = "${ISODIR}/isolinux"
-SYSLINUX_HDDDIR = "${HDDDIR}"
+ISOLINUXDIR = "/isolinux"
+SYSLINUXDIR = "/"
ISO_BOOTIMG = "isolinux/isolinux.bin"
ISO_BOOTCAT = "isolinux/boot.cat"
MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
syslinux_populate() {
DEST=$1
- CFGNAME=$2
+ BOOTDIR=$2
+ CFGNAME=$3
- install -d ${DEST}
-
- # Install the kernel, initrd, and rootfs
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
- install -m 0644 ${INITRD} ${DEST}/initrd
- fi
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
- fi
+ install -d ${DEST}${BOOTDIR}
# Install the config files
- install -m 0644 ${SYSLINUXCFG} ${DEST}/${CFGNAME}
+ install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME}
if [ -f ${SYSLINUXMENU} ]; then
- install -m 0644 ${SYSLINUXMENU} ${DEST}
+ install -m 0644 ${SYSLINUXMENU} ${DEST}${BOOTDIR}
fi
}
syslinux_iso_populate() {
- syslinux_populate ${SYSLINUX_ISODIR} isolinux.cfg
- install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${SYSLINUX_ISODIR}
+ syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg
+ install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
}
syslinux_hddimg_populate() {
- syslinux_populate ${SYSLINUX_HDDDIR} syslinux.cfg
- install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${SYSLINUX_HDDDIR}/ldlinux.sys
+ syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg
+ install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys
}
syslinux_hddimg_install() {
@@ -187,7 +179,7 @@ python build_syslinux_cfg () {
localdata.setVar('OVERRIDES', label + ':' + overrides)
bb.data.update_data(localdata)
- cfgfile.write('LABEL %s\nKERNEL vmlinuz\n' % (label))
+ cfgfile.write('LABEL %s\nKERNEL /vmlinuz\n' % (label))
append = localdata.getVar('APPEND', 1)
initrd = localdata.getVar('INITRD', 1)
@@ -196,7 +188,7 @@ python build_syslinux_cfg () {
cfgfile.write('APPEND ')
if initrd:
- cfgfile.write('initrd=initrd ')
+ cfgfile.write('initrd=/initrd ')
cfgfile.write('LABEL=%s '% (label))
>438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678